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: <b62f3795-0842-95fe-65fc-8b769c77b81c@intel.com>
Date:   Fri, 19 Feb 2021 18:47:01 +0100
From:   Björn Töpel <bjorn.topel@...el.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>,
        Björn Töpel <bjorn.topel@...il.com>,
        ast@...nel.org, daniel@...earbox.net, netdev@...r.kernel.org,
        bpf@...r.kernel.org
Cc:     maciej.fijalkowski@...el.com, hawk@...nel.org,
        magnus.karlsson@...el.com, john.fastabend@...il.com,
        kuba@...nel.org, davem@...emloft.net
Subject: Re: [PATCH bpf-next 1/2] bpf, xdp: per-map bpf_redirect_map functions
 for XDP

On 2021-02-19 18:05, Toke Høiland-Jørgensen wrote:
> Björn Töpel <bjorn.topel@...il.com> writes:
> 

[...]


>> @@ -4110,22 +4094,17 @@ static const struct bpf_func_proto bpf_xdp_redirect_proto = {
>>   	.arg2_type      = ARG_ANYTHING,
>>   };
>>   
>> -BPF_CALL_3(bpf_xdp_redirect_map, struct bpf_map *, map, u32, ifindex,
>> -	   u64, flags)
>> +static __always_inline s64 __bpf_xdp_redirect_map(struct bpf_map *map, u32 ifindex, u64 flags,
>> +						  void *lookup_elem(struct bpf_map *map,
>> +								    u32 key))
>>   {
>>   	struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info);
>>   
>> -	/* Lower bits of the flags are used as return code on lookup failure */
>>   	if (unlikely(flags > XDP_TX))
>>   		return XDP_ABORTED;
>>   
>> -	ri->tgt_value = __xdp_map_lookup_elem(map, ifindex);
>> +	ri->tgt_value = lookup_elem(map, ifindex);
>>   	if (unlikely(!ri->tgt_value)) {
>> -		/* If the lookup fails we want to clear out the state in the
>> -		 * redirect_info struct completely, so that if an eBPF program
>> -		 * performs multiple lookups, the last one always takes
>> -		 * precedence.
>> -		 */
> 
> Why remove the comments?
>

Ugh, no reason. I'll do a v2. LKP had a warning as well.


Thanks,
Björn

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ