lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ef30zh8k.fsf@toke.dk>
Date:   Mon, 08 Jul 2019 17:19:23 +0200
From:   Toke Høiland-Jørgensen <toke@...hat.com>
To:     Jonathan Lemon <jlemon@...gsvamp.com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...nel.org>, netdev@...r.kernel.org,
        David Miller <davem@...emloft.net>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Björn Töpel <bjorn.topel@...il.com>
Subject: Re: [PATCH bpf-next 2/3] xdp: Refactor devmap allocation code for reuse

"Jonathan Lemon" <jlemon@...gsvamp.com> writes:

> On 5 Jul 2019, at 10:56, Toke Høiland-Jørgensen wrote:
>
>> From: Toke Høiland-Jørgensen <toke@...hat.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@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ