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: <DB8PR04MB67953DBABBB9B1B85759AE58E6839@DB8PR04MB6795.eurprd04.prod.outlook.com>
Date:   Sat, 20 Feb 2021 07:52:46 +0000
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "peppe.cavallaro@...com" <peppe.cavallaro@...com>,
        "alexandre.torgue@...com" <alexandre.torgue@...com>,
        "joabreu@...opsys.com" <joabreu@...opsys.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V4 net 5/5] net: stmmac: re-init rx buffers when mac
 resume back


> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: 2021年2月7日 4:38
> To: Joakim Zhang <qiangqing.zhang@....com>
> Cc: peppe.cavallaro@...com; alexandre.torgue@...com;
> joabreu@...opsys.com; davem@...emloft.net; netdev@...r.kernel.org;
> dl-linux-imx <linux-imx@....com>
> Subject: Re: [PATCH V4 net 5/5] net: stmmac: re-init rx buffers when mac
> resume back
> 
> On Thu,  4 Feb 2021 19:21:44 +0800 Joakim Zhang wrote:
> > +err_reinit_rx_buffers:
> > +	while (queue >= 0) {
> > +		while (--i >= 0)
> > +			stmmac_free_rx_buffer(priv, queue, i);
> > +
> > +		if (queue == 0)
> > +			break;
> > +
> > +		i = priv->dma_rx_size;
> > +		queue--;
> > +	}
> 
> nit:
> 
> 	do {
> 		...
> 	} while (queue-- > 0);

OK, will change it.

> > +
> > +	return -ENOMEM;
> 
> the caller ignores the return value anyway, so you make make this function
> void.

OK.

> I'm not sure why you recycle and reallocate every buffer. Isn't it enough to
> reinitialize the descriptors with the buffers which are already allocated?

As I know, the receive buffer address is not fixed after allocated, it will recycle and re-allocate in stmmac_rx(), where to handle the receive buffers.
It should be enough to re-initialize the descriptors with the buffers if it is possible. Could you point me how to do it?

Best Regards,
Joakim Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ