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: Fri, 15 Dec 2023 18:41:07 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
 linux@...linux.org.uk, andrew@...n.ch, netdev@...r.kernel.org,
 mengyuanlou@...-swift.com
Subject: Re: [PATCH net-next v5 7/8] net: wangxun: add ethtool_ops for
 channel number

On Thu, 14 Dec 2023 10:54:55 +0800 Jiawen Wu wrote:
> +	if (!(wx->msix_q_entries)) {

pointless brackets

> +void wx_get_channels(struct net_device *dev,
> +		     struct ethtool_channels *ch)
> +{
> +	struct wx *wx = netdev_priv(dev);
> +
> +	/* report maximum channels */
> +	ch->max_combined = wx_max_channels(wx);
> +
> +	/* report info for other vector */
> +	if (wx->msix_q_entries) {
> +		ch->max_other = 1;
> +		ch->other_count = 1;
> +	}
> +
> +	/* record RSS queues */
> +	ch->combined_count = wx->ring_feature[RING_F_RSS].indices;
> +
> +	/* nothing else to report if RSS is disabled */
> +	if (ch->combined_count == 1)
> +		return;

pointless return

> +}
> +EXPORT_SYMBOL(wx_get_channels);
> +
> +int wx_set_channels(struct net_device *dev,
> +		    struct ethtool_channels *ch)
> +{
> +	unsigned int count = ch->combined_count;
> +	struct wx *wx = netdev_priv(dev);
> +
> +	/* verify they are not requesting separate vectors */
> +	if (!count || ch->rx_count || ch->tx_count)
> +		return -EOPNOTSUPP;

core shouldn't allow this to reach you

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ