BPF Archive on lore.kernel.org
 help / color / Atom feed
From: Toshiaki Makita <toshiaki.makita1@gmail.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	netdev@vger.kernel.org, xdp-newbies@vger.kernel.org,
	bpf@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH bpf 2/3] devmap: Add missing bulk queue free
Date: Fri, 14 Jun 2019 22:03:57 +0900
Message-ID: <4ab32fa0-0c79-79c7-141b-9620f844d23b@gmail.com> (raw)
In-Reply-To: <20190614135806.4bcb1a31@carbon>

On 19/06/14 (金) 20:58:06, Jesper Dangaard Brouer wrote:
> On Fri, 14 Jun 2019 17:20:14 +0900
> Toshiaki Makita <toshiaki.makita1@gmail.com> wrote:
> 
>> dev_map_free() forgot to free bulk queue when freeing its entries.
>>
>> Fixes: 5d053f9da431 ("bpf: devmap prepare xdp frames for bulking")
>> Signed-off-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
>> ---
>>   kernel/bpf/devmap.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
>> index e001fb1..a126d95 100644
>> --- a/kernel/bpf/devmap.c
>> +++ b/kernel/bpf/devmap.c
>> @@ -186,6 +186,7 @@ static void dev_map_free(struct bpf_map *map)
>>   		if (!dev)
>>   			continue;
>>   
>> +		free_percpu(dev->bulkq);
>>   		dev_put(dev->dev);
>>   		kfree(dev);
>>   	}
> 
> Do we need to call need to call dev_map_flush_old() before
> free_percpu(dev->bulkq) ?
> 
> Looking the code, I guess this is not needed as, above we are ensuring
> all pending flush operations have completed.

My understanding is the same. The code waits for NAPI to flush the 
queue, so no need for dev_map_flush_old().

> 
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

Thanks!

Toshiaki Makita

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  8:20 [PATCH bpf 0/3] Devmap fixes around memory and RCU Toshiaki Makita
2019-06-14  8:20 ` [PATCH bpf 1/3] devmap: Fix premature entry free on destroying map Toshiaki Makita
2019-06-14 11:04   ` Toke Høiland-Jørgensen
2019-06-14 12:10     ` Toke Høiland-Jørgensen
2019-06-14 12:59       ` Toshiaki Makita
2019-06-14 13:09         ` Toke Høiland-Jørgensen
2019-06-14 23:07           ` Daniel Borkmann
2019-06-15 10:10             ` Toke Høiland-Jørgensen
2019-06-14 12:20     ` Jesper Dangaard Brouer
2019-06-14  8:20 ` [PATCH bpf 2/3] devmap: Add missing bulk queue free Toshiaki Makita
2019-06-14 11:58   ` Jesper Dangaard Brouer
2019-06-14 13:03     ` Toshiaki Makita [this message]
2019-06-14  8:20 ` [PATCH bpf 3/3] devmap: Add missing RCU read lock on flush Toshiaki Makita
2019-06-14 11:07   ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ab32fa0-0c79-79c7-141b-9620f844d23b@gmail.com \
    --to=toshiaki.makita1@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=xdp-newbies@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org bpf@archiver.kernel.org
	public-inbox-index bpf


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/ public-inbox