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: <38b31e5b-57a6-44ab-a5ca-8f890bed6074@kernel.org>
Date: Fri, 9 Aug 2024 12:02:29 +0200
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: Daniel Xu <dxu@...uu.xyz>,
 Alexander Lobakin <aleksander.lobakin@...el.com>,
 Lorenzo Bianconi <lorenzo.bianconi@...hat.com>
Cc: Alexander Lobakin <alexandr.lobakin@...el.com>,
 Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
 Andrii Nakryiko <andrii@...nel.org>,
 Larysa Zaremba <larysa.zaremba@...el.com>,
 Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
 Björn Töpel <bjorn@...nel.org>,
 Magnus Karlsson <magnus.karlsson@...el.com>,
 Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
 Jonathan Lemon <jonathan.lemon@...il.com>, "toke@...hat.com"
 <toke@...hat.com>, Lorenzo Bianconi <lorenzo@...nel.org>,
 David Miller <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Jesse Brandeburg <jesse.brandeburg@...el.com>,
 John Fastabend <john.fastabend@...il.com>, Yajun Deng
 <yajun.deng@...ux.dev>, Willem de Bruijn <willemb@...gle.com>,
 "bpf@...r.kernel.org" <bpf@...r.kernel.org>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, xdp-hints@...-project.net,
 Stanislav Fomichev <sdf@...gle.com>, kernel-team <kernel-team@...udflare.com>
Subject: Re: [xdp-hints] Re: [PATCH RFC bpf-next 32/52] bpf, cpumap: switch to
 GRO from netif_receive_skb_list()


On 08/08/2024 22.52, Daniel Xu wrote:
> 
> On Thu, Aug 8, 2024, at 7:57 AM, Alexander Lobakin wrote:
>>
[...]
>> The only concern for having GRO in cpumap without metadata from the NIC
>> descriptor was that when the checksum status is missing, GRO calculates
>> the checksum on CPU, which is not really fast.
>> But I remember sometimes GRO was faster despite that.
 >
> Good to know, thanks. IIUC some kind of XDP hint support landed already?
> 

The XDP-hints ended-up being called 'XDP RX metadata' in kernel docs[1],
which makes it difficult to talk about without talking past each-other.
The TX side only got implemented for AF_XDP.

  [1] https://www.kernel.org/doc/html/latest/networking/xdp-rx-metadata.html
  [2] https://www.kernel.org/doc/html/latest/networking/xsk-tx-metadata.html

What landed 'XDP RX metadata'[1] is that we (via kfunc calls)  get
access to reading hardware RX offloads/hints directly from the
RX-descriptor. This implies a limitation that we only have access to
this data in the running XDP-program as the RX-descriptor is short lived.

Thus, we need to store the RX-descriptor information somewhere, to make
it available to 'cpumap' on the remote CPU. After failing to standardize
formatting XDP metadata area. My "new" opinion is that we should simply
extend struct xdp_frame with the fields needed for SKB creation.  Then
we can create some kfunc helpers that allow XDP-prog stores this info.


> My use case could also use HW RSS hash to avoid a rehash in XDP prog.
> And HW RX timestamp to not break SO_TIMESTAMPING. These two
> are on one of my TODO lists. But I can’t get to them for at least
> a few weeks. So free to take it if you’d like.

The kfuncs you need should be available:

  HW RSS hash = bpf_xdp_metadata_rx_hash()
  HW RX timestamp = bpf_xdp_metadata_rx_timestamp()

We just need to implement storing the information, such that it is
available to CPUMAP, and make it generic such that it also works for
veth when getting a XDP redirected xdp_frame.

Hoping someone can works on this soon,
--Jesper




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ