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: <55ef319de7084614b1883018f69de1eb@huawei.com>
Date: Thu, 29 Feb 2024 12:52:08 +0000
From: wangyunjian <wangyunjian@...wei.com>
To: Paolo Abeni <pabeni@...hat.com>, "mst@...hat.com" <mst@...hat.com>,
	"willemdebruijn.kernel@...il.com" <willemdebruijn.kernel@...il.com>,
	"jasowang@...hat.com" <jasowang@...hat.com>, "kuba@...nel.org"
	<kuba@...nel.org>, "bjorn@...nel.org" <bjorn@...nel.org>,
	"magnus.karlsson@...el.com" <magnus.karlsson@...el.com>,
	"maciej.fijalkowski@...el.com" <maciej.fijalkowski@...el.com>,
	"jonathan.lemon@...il.com" <jonathan.lemon@...il.com>, "davem@...emloft.net"
	<davem@...emloft.net>
CC: "bpf@...r.kernel.org" <bpf@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"virtualization@...ts.linux.dev" <virtualization@...ts.linux.dev>, xudingke
	<xudingke@...wei.com>, "liwei (DT)" <liwei395@...wei.com>
Subject: RE: [PATCH net-next v2 1/3] xsk: Remove non-zero 'dma_page' check in
 xp_assign_dev

> -----Original Message-----
> From: Paolo Abeni [mailto:pabeni@...hat.com]
> Sent: Thursday, February 29, 2024 6:43 PM
> To: wangyunjian <wangyunjian@...wei.com>; mst@...hat.com;
> willemdebruijn.kernel@...il.com; jasowang@...hat.com; kuba@...nel.org;
> bjorn@...nel.org; magnus.karlsson@...el.com; maciej.fijalkowski@...el.com;
> jonathan.lemon@...il.com; davem@...emloft.net
> Cc: bpf@...r.kernel.org; netdev@...r.kernel.org;
> linux-kernel@...r.kernel.org; kvm@...r.kernel.org;
> virtualization@...ts.linux.dev; xudingke <xudingke@...wei.com>; liwei (DT)
> <liwei395@...wei.com>
> Subject: Re: [PATCH net-next v2 1/3] xsk: Remove non-zero 'dma_page' check in
> xp_assign_dev
> 
> On Wed, 2024-02-28 at 19:05 +0800, Yunjian Wang wrote:
> > Now dma mappings are used by the physical NICs. However the vNIC maybe
> > do not need them. So remove non-zero 'dma_page' check in
> > xp_assign_dev.
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@...wei.com>
> > ---
> >  net/xdp/xsk_buff_pool.c | 7 -------
> >  1 file changed, 7 deletions(-)
> >
> > diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index
> > ce60ecd48a4d..a5af75b1f43c 100644
> > --- a/net/xdp/xsk_buff_pool.c
> > +++ b/net/xdp/xsk_buff_pool.c
> > @@ -219,16 +219,9 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
> >  	if (err)
> >  		goto err_unreg_pool;
> >
> > -	if (!pool->dma_pages) {
> > -		WARN(1, "Driver did not DMA map zero-copy buffers");
> > -		err = -EINVAL;
> > -		goto err_unreg_xsk;
> > -	}
> 
> This would unconditionally remove an otherwise valid check for most NIC. What
> about let the driver declare it wont need DMA map with a
> (pool?) flag.

This check is redundant. The NIC's driver determines whether a DMA map is required.
If the NIC'driver requires the DMA map, it uses the xsk_pool_dma_map function, which
initializes the DMA map and performs a check.

Thanks

> 
> Cheers,
> 
> Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ