public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat•com>
To: Jonathan Lemon <jlemon@flugsvamp•com>
Cc: "Daniel Borkmann" <daniel@iogearbox•net>,
	"Alexei Starovoitov" <ast@kernel•org>,
	netdev@vger•kernel.org, "David Miller" <davem@davemloft•net>,
	"Jesper Dangaard Brouer" <brouer@redhat•com>,
	"Jakub Kicinski" <jakub.kicinski@netronome•com>,
	"Björn Töpel" <bjorn.topel@gmail•com>
Subject: Re: [PATCH bpf-next 2/3] xdp: Refactor devmap allocation code for reuse
Date: Mon, 08 Jul 2019 17:19:23 +0200	[thread overview]
Message-ID: <87ef30zh8k.fsf@toke.dk> (raw)
In-Reply-To: <A2ABED10-8475-4878-93DF-F16D106FC33D@flugsvamp.com>

"Jonathan Lemon" <jlemon@flugsvamp•com> writes:

> On 5 Jul 2019, at 10:56, Toke Høiland-Jørgensen wrote:
>
>> From: Toke Høiland-Jørgensen <toke@redhat•com>
>>
>> The subsequent patch to add a new devmap sub-type can re-use much of 
>> the
>> initialisation and allocation code, so refactor it into separate 
>> functions.
>>
>> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat•com>
>> ---
>>  kernel/bpf/devmap.c |  137 
>> +++++++++++++++++++++++++++++++--------------------
>>  1 file changed, 84 insertions(+), 53 deletions(-)
>>
>> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
>> index d83cf8ccc872..a2fe16362129 100644
>> --- a/kernel/bpf/devmap.c
>> +++ b/kernel/bpf/devmap.c
>> @@ -60,7 +60,7 @@ struct xdp_bulk_queue {
>>  struct bpf_dtab_netdev {
>>  	struct net_device *dev; /* must be first member, due to tracepoint 
>> */
>>  	struct bpf_dtab *dtab;
>> -	unsigned int bit;
>> +	unsigned int idx; /* keep track of map index for tracepoint */
>>  	struct xdp_bulk_queue __percpu *bulkq;
>>  	struct rcu_head rcu;
>>  };
>> @@ -75,28 +75,22 @@ struct bpf_dtab {
>>  static DEFINE_SPINLOCK(dev_map_lock);
>>  static LIST_HEAD(dev_map_list);
>>
>> -static struct bpf_map *dev_map_alloc(union bpf_attr *attr)
>> +static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr 
>> *attr,
>> +			    bool check_memlock)
>
> This check_memlock parameter appears to be unused.

Ah yes, good catch! That was left over from when the patch set also
contained the "default map" stuff. Will fix.

-Toke

  reply	other threads:[~2019-07-08 15:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 17:56 [PATCH bpf-next 0/3] xdp: Add devmap_hash map type Toke Høiland-Jørgensen
2019-07-05 17:56 ` [PATCH bpf-next 2/3] xdp: Refactor devmap allocation code for reuse Toke Høiland-Jørgensen
2019-07-08 15:06   ` Jonathan Lemon
2019-07-08 15:19     ` Toke Høiland-Jørgensen [this message]
2019-07-05 17:56 ` [PATCH bpf-next 3/3] xdp: Add devmap_hash map type for looking up devices by hashed index Toke Høiland-Jørgensen
2019-07-05 22:04   ` Y Song
2019-07-06  8:41     ` Toke Høiland-Jørgensen
2019-07-05 17:56 ` [PATCH bpf-next 1/3] include/bpf.h: Remove map_insert_ctx() stubs Toke Høiland-Jørgensen
2019-07-08 15:10 ` [PATCH bpf-next 0/3] xdp: Add devmap_hash map type Jonathan Lemon
2019-07-08 15:40   ` Toke Høiland-Jørgensen
2019-07-08 16:50     ` Jonathan Lemon

Reply instructions:

You may reply publicly 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=87ef30zh8k.fsf@toke.dk \
    --to=toke@redhat$(echo .)com \
    --cc=ast@kernel$(echo .)org \
    --cc=bjorn.topel@gmail$(echo .)com \
    --cc=brouer@redhat$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=jakub.kicinski@netronome$(echo .)com \
    --cc=jlemon@flugsvamp$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox