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]
Date:	Tue, 10 Jun 2014 11:10:45 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Fugang Duan' <b38611@...escale.com>,
	"davem@...emloft.net" <davem@...emloft.net>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"ezequiel.garcia@...e-electrons.com" 
	<ezequiel.garcia@...e-electrons.com>,
	"b20596@...escale.com" <b20596@...escale.com>,
	"eric.dumazet@...il.com" <eric.dumazet@...il.com>
Subject: RE: [PATCH v4 5/6] net: fec: Add Scatter/gather support

From: Fugang Duan
> Add Scatter/gather support for FEC.
> This feature allows to improve outbound throughput performance.
...
> +static int fec_enet_get_free_txdesc_num(struct fec_enet_private *fep)
> +{
> +	int entries;
> +
> +	entries = ((const char *)fep->dirty_tx -
> +			(const char *)fep->cur_tx) / fep->bufdesc_size;
> +
> +	return (fep->cur_tx >= fep->dirty_tx) ?
> +		entries += fep->tx_ring_size : entries;
> +}

That is a strange return statement - why += ??

You could also check the sign of 'entries'.
Say:
	return entries > 0 ? entries : entries + fep->tx_ring_size;

Actually do you ever use the last entry?
If you do then the full and empty conditions are not separated.

	David



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ