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:
 <DBBP189MB1433AECC674945B7176D18DB9538A@DBBP189MB1433.EURP189.PROD.OUTLOOK.COM>
Date: Tue, 18 Jul 2023 11:26:39 +0000
From: Sriram Yagnaraman <sriram.yagnaraman@....tech>
To: Simon Horman <simon.horman@...igine.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"bpf@...r.kernel.org" <bpf@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, Jesse Brandeburg <jesse.brandeburg@...el.com>, Tony
 Nguyen <anthony.l.nguyen@...el.com>, "David S . Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Alexei Starovoitov
	<ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard
 Brouer <hawk@...nel.org>, John Fastabend <john.fastabend@...il.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>
Subject: RE: [PATCH iwl-next v3 3/4] igb: add AF_XDP zero-copy Rx support



> -----Original Message-----
> From: Simon Horman <simon.horman@...igine.com>
> Sent: Saturday, 15 July 2023 11:23
> To: Sriram Yagnaraman <sriram.yagnaraman@....tech>
> Cc: intel-wired-lan@...ts.osuosl.org; bpf@...r.kernel.org;
> netdev@...r.kernel.org; Jesse Brandeburg <jesse.brandeburg@...el.com>;
> Tony Nguyen <anthony.l.nguyen@...el.com>; David S . Miller
> <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub
> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; Alexei
> Starovoitov <ast@...nel.org>; Daniel Borkmann <daniel@...earbox.net>;
> Jesper Dangaard Brouer <hawk@...nel.org>; John Fastabend
> <john.fastabend@...il.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>
> Subject: Re: [PATCH iwl-next v3 3/4] igb: add AF_XDP zero-copy Rx support
> 
> On Thu, Jul 13, 2023 at 12:47:16PM +0200, Sriram Yagnaraman wrote:
> > Add support for AF_XDP zero-copy receive path.
> >
> > When AF_XDP zero-copy is enabled, the rx buffers are allocated from
> > the xsk buff pool using igb_alloc_rx_buffers_zc.
> >
> > Use xsk_pool_get_rx_frame_size to set SRRCTL rx buf size when
> > zero-copy is enabled.
> >
> > Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@....tech>
> 
> ...
> 
> > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> > b/drivers/net/ethernet/intel/igb/igb_main.c
> > index 2c1e1d70bcf9..8eed3d0ab4fc 100644
> > --- a/drivers/net/ethernet/intel/igb/igb_main.c
> > +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> > @@ -502,12 +502,14 @@ static void igb_dump(struct igb_adapter
> > *adapter)
> >
> >  		for (i = 0; i < rx_ring->count; i++) {
> >  			const char *next_desc;
> > -			struct igb_rx_buffer *buffer_info;
> > -			buffer_info = &rx_ring->rx_buffer_info[i];
> > +			struct igb_rx_buffer *buffer_info = NULL;
> >  			rx_desc = IGB_RX_DESC(rx_ring, i);
> >  			u0 = (struct my_u0 *)rx_desc;
> >  			staterr = le32_to_cpu(rx_desc-
> >wb.upper.status_error);
> >
> > +			if (!rx_ring->xsk_pool)
> > +				buffer_info = &rx_ring->rx_buffer_info[i];
> > +
> >  			if (i == rx_ring->next_to_use)
> >  				next_desc = " NTU";
> >  			else if (i == rx_ring->next_to_clean) @@ -530,7 +532,7
> @@ static
> > void igb_dump(struct igb_adapter *adapter)
> >  					(u64)buffer_info->dma,
> 
> Hi Sriram,
> 
> Here buffer_info is dereferenced...
> 
> >  					next_desc);
> >
> > -				if (netif_msg_pktdata(adapter) &&
> > +				if (netif_msg_pktdata(adapter) && buffer_info
> &&
> 
> And here buffer_info is checked against NULL.
> 
> This combination doesn't seem quite right.

ACK, I will fix this. I am unable to test this path though.

> 
> >  				    buffer_info->dma && buffer_info->page) {
> >  					print_hex_dump(KERN_INFO, "",
> >  					  DUMP_PREFIX_ADDRESS,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ