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] [day] [month] [year] [list]
Message-ID: <e829b776-f6a6-5b5d-8625-8913986c8036@gmail.com>
Date:   Mon, 22 Mar 2021 09:05:33 -0600
From:   David Ahern <dsahern@...il.com>
To:     Eelco Chaudron <echaudro@...hat.com>
Cc:     Lorenzo Bianconi <lorenzo@...nel.org>, bpf@...r.kernel.org,
        netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
        davem@...emloft.net, kuba@...nel.org, ast@...nel.org,
        daniel@...earbox.net, shayagr@...zon.com, john.fastabend@...il.com,
        dsahern@...nel.org, brouer@...hat.com, jasowang@...hat.com,
        alexander.duyck@...il.com, saeed@...nel.org,
        maciej.fijalkowski@...el.com, sameehj@...zon.com
Subject: Re: [PATCH v7 bpf-next 10/14] bpf: add new frame_length field to the
 XDP ctx

On 3/22/21 3:29 AM, Eelco Chaudron wrote:
> 
> 
> On 20 Mar 2021, at 4:42, David Ahern wrote:
> 
>> On 3/19/21 3:47 PM, Lorenzo Bianconi wrote:
>>> diff --git a/include/net/xdp.h b/include/net/xdp.h
>>> index 19cd6642e087..e47d9e8da547 100644
>>> --- a/include/net/xdp.h
>>> +++ b/include/net/xdp.h
>>> @@ -75,6 +75,10 @@ struct xdp_buff {
>>>      struct xdp_txq_info *txq;
>>>      u32 frame_sz:31; /* frame size to deduce data_hard_end/reserved
>>> tailroom*/
>>>      u32 mb:1; /* xdp non-linear buffer */
>>> +    u32 frame_length; /* Total frame length across all buffers. Only
>>> needs
>>> +               * to be updated by helper functions, as it will be
>>> +               * initialized at XDP program start.
>>> +               */
>>>  };
>>>
>>>  static __always_inline void
>>
>> If you do another version of this set ...
>>
>> I think you only need 17-bits for the frame length (size is always <=
>> 128kB). It would be helpful for extensions to xdp if you annotated how
>> many bits are really needed here.
> 
> Guess this can be done, but I did not too avoid the use of constants to
> do the BPF extraction.
> Here is an example of what might need to be added, as adding them before
> made people unhappy ;)
> 
> https://elixir.bootlin.com/linux/v5.12-rc4/source/include/linux/skbuff.h#L801
> 
> 

I was just referring to a code comment that bits can be taken from
frame_length for extensions - just like the mb bit takes from frame_sz
(and it too has bits available since 2GB is way larger than actually
needed).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ