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
next prev parent 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 1/3] include/bpf.h: Remove map_insert_ctx() stubs Toke Høiland-Jørgensen
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-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.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=jlemon@flugsvamp.com \
--cc=netdev@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.