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: <t2zyihqylk53fwnu4svxt6rrq22noulgbumos2tu2calwclsho@dpcfos6aldo3>
Date: Thu, 21 Aug 2025 11:06:01 +0000
From: Dragos Tatulea <dtatulea@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: almasrymina@...gle.com, asml.silence@...il.com, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, cratiu@...dia.com, 
	parav@...dia.com, netdev@...r.kernel.org, sdf@...a.com, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v4 1/7] queue_api: add support for fetching per
 queue DMA dev

On Wed, Aug 20, 2025 at 06:01:00PM -0700, Jakub Kicinski wrote:
> On Wed, 20 Aug 2025 20:11:52 +0300 Dragos Tatulea wrote:
> > + * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used
> > + *			   for this queue. When such device is not available,
> > + *			   the function will return NULL.
> 
> nit: I think you're using a different tense/grammar than the doc for
> other callbacks (which is admittedly somewhat unusual :$) 
> Also should we indicate that "not available" is an error? Maybe just:
> 
> 	Get dma device for zero-copy operations to be used
> 	for this queue. Return NULL on error.
>
Sure. Will fix.

> >   * Note that @ndo_queue_mem_alloc and @ndo_queue_mem_free may be called while
> >   * the interface is closed. @ndo_queue_start and @ndo_queue_stop will only
> >   * be called for an interface which is open.
> 
> > +/**
> > + * netdev_queue_get_dma_dev() - get dma device for zero-copy operations
> > + * @dev:	net_device
> > + * @idx:	queue index
> > + *
> > + * Get dma device for zero-copy operations to be used for this queue.
> > + * When such device is not available or valid, the function will return NULL.
> 
> Unfortunately kdoc really wants us to add Return: statements to all
> functions...
>
Ack. Will fix.

> > + */
> > +struct device *netdev_queue_get_dma_dev(struct net_device *dev, int idx)
> > +{
> > +	const struct netdev_queue_mgmt_ops *queue_ops = dev->queue_mgmt_ops;
> > +	struct device *dma_dev;
> > +
> > +	if (queue_ops && queue_ops->ndo_queue_get_dma_dev)
> > +		dma_dev = queue_ops->ndo_queue_get_dma_dev(dev, idx);
> > +	else
> > +		dma_dev = dev->dev.parent;
> > +
> > +	return dma_dev && dma_dev->dma_mask ? dma_dev : NULL;
> > +}
> > +EXPORT_SYMBOL(netdev_queue_get_dma_dev);
> > \ No newline at end of file
> 
> This is in desperate need of a terminating new line.
> 
Ack. Will fix.

> But also -- why the export? iouring and devmem can't be modules.
Oh, right! Will replace with a newline.

Thanks,
Dragos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ