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: <ZVYu4eR+HmHBA76V@boxer>
Date: Thu, 16 Nov 2023 16:01:53 +0100
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: Larysa Zaremba <larysa.zaremba@...el.com>
CC: <bpf@...r.kernel.org>, <ast@...nel.org>, <daniel@...earbox.net>,
	<andrii@...nel.org>, <martin.lau@...ux.dev>, <song@...nel.org>, <yhs@...com>,
	<john.fastabend@...il.com>, <kpsingh@...nel.org>, <sdf@...gle.com>,
	<haoluo@...gle.com>, <jolsa@...nel.org>, David Ahern <dsahern@...il.com>,
	Jakub Kicinski <kuba@...nel.org>, Willem de Bruijn <willemb@...gle.com>,
	Jesper Dangaard Brouer <hawk@...nel.org>, Anatoly Burakov
	<anatoly.burakov@...el.com>, Alexander Lobakin <alexandr.lobakin@...el.com>,
	Magnus Karlsson <magnus.karlsson@...il.com>, Maryam Tahhan
	<mtahhan@...hat.com>, <xdp-hints@...-project.net>, <netdev@...r.kernel.org>,
	Willem de Bruijn <willemdebruijn.kernel@...il.com>, Alexei Starovoitov
	<alexei.starovoitov@...il.com>, Tariq Toukan <tariqt@...lanox.com>, "Saeed
 Mahameed" <saeedm@...lanox.com>
Subject: Re: [PATCH bpf-next v7 08/18] ice: Support XDP hints in AF_XDP ZC
 mode

On Thu, Nov 16, 2023 at 04:01:01AM +0100, Larysa Zaremba wrote:
> On Thu, Nov 16, 2023 at 01:49:36PM +0100, Maciej Fijalkowski wrote:
> > On Wed, Nov 15, 2023 at 06:52:50PM +0100, Larysa Zaremba wrote:
> > > In AF_XDP ZC, xdp_buff is not stored on ring,
> > > instead it is provided by xsk_buff_pool.
> > > Space for metadata sources right after such buffers was already reserved
> > > in commit 94ecc5ca4dbf ("xsk: Add cb area to struct xdp_buff_xsk").
> > > 
> > > Some things (such as pointer to packet context) do not change on a
> > > per-packet basis, so they can be set at the same time as RX queue info.
> > > On the other hand, RX descriptor is unique for each packet, but is already
> > > known when setting DMA addresses. This minimizes performance impact of
> > > hints on regular packet processing.
> > > 
> > > Update AF_XDP ZC packet processing to support XDP hints.
> > > 
> > > Co-developed-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> > > Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
> > > ---
> > >  drivers/net/ethernet/intel/ice/ice_base.c | 13 +++++++++++++
> > >  drivers/net/ethernet/intel/ice/ice_xsk.c  | 17 +++++++++++------
> > >  2 files changed, 24 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
> > > index 2d83f3c029e7..d3396c1c87a9 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_base.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_base.c
> > > @@ -519,6 +519,18 @@ static int ice_setup_rx_ctx(struct ice_rx_ring *ring)
> > >  	return 0;
> > >  }
> > >  
> > > +static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring)
> > > +{
> > > +	void *ctx_ptr = &ring->pkt_ctx;
> > > +	struct xsk_cb_desc desc = {};
> > > +
> > > +	desc.src = &ctx_ptr;
> > > +	desc.off = offsetof(struct ice_xdp_buff, pkt_ctx) -
> > > +		   sizeof(struct xdp_buff);
> > 
> > Took me a while to figure out this offset calculation:D
> >
> 
> Do you have a suggestion, how to make it easier to understand?
>  

Not really, thought about moving the xdp_buff size subtraction to
xp_fill_cb but that would limit its usage. Let us keep it this way, I was
just probably being slow.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ