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: <1303948962.2875.178.camel@bwh-desktop>
Date:	Thu, 28 Apr 2011 01:02:42 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Amit Kumar Salecha <amit.salecha@...gic.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	ameen.rahman@...gic.com, anirban.chakraborty@...gic.com,
	Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
Subject: Re: [NEXT PATCH 2/3] qlcnic: support rcv ring configuration
 through ethtool

On Wed, 2011-04-27 at 17:43 -0700, Amit Kumar Salecha wrote:
> From: Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
> 
> o Support ethtool command ETHTOOL_GCHANNELS and ETHTOOL_SCHANNELS.
> o Number of rcv rings configuration depend upon number of msix vector.
[...]
> --- a/drivers/net/qlcnic/qlcnic_ethtool.c
> +++ b/drivers/net/qlcnic/qlcnic_ethtool.c
> @@ -474,6 +474,49 @@ qlcnic_set_ringparam(struct net_device *dev,
>  	return qlcnic_reset_context(adapter);
>  }
>  
> +static void qlcnic_get_channels(struct net_device *dev,
> +		struct ethtool_channels *channel)
> +{
> +	struct qlcnic_adapter *adapter = netdev_priv(dev);
> +
> +	channel->max_rx = rounddown_pow_of_two(min_t(int,
> +			adapter->max_rx_ques, num_online_cpus()));
> +	channel->max_tx = adapter->max_tx_ques;
> +
> +	channel->rx_count = adapter->max_sds_rings;
> +	channel->tx_count = QLCNIC_MIN_NUM_TX_DESC_RINGS;
> +}
> +
> +static int qlcnic_set_channels(struct net_device *dev,
> +		struct ethtool_channels *channel)
> +{
> +	struct qlcnic_adapter *adapter = netdev_priv(dev);
> +	int err;
> +
> +	if (channel->other_count || channel->combined_count)
> +		return -EOPNOTSUPP;

Should be -EINVAL.

> +	if (channel->tx_count &&
> +		(channel->tx_count != QLCNIC_MIN_NUM_TX_DESC_RINGS)) {
> +		netdev_info(dev, "valid value for tx_count 0x%x\n",
> +				QLCNIC_MIN_NUM_TX_DESC_RINGS);
> +		return -EINVAL;
> +	}
[...]

If tx_count cannot be changed, why does qlcnic_get_channels() set
tx_count and max_tx to different values?

Also I don't think you should treat tx_count == 0 as a special case; it
should be rejected as invalid.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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