From: Ben Hutchings <bhutchings@solarflare.com>
To: Amit Kumar Salecha <amit.salecha@qlogic.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
ameen.rahman@qlogic.com, anirban.chakraborty@qlogic.com,
Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Subject: Re: [NEXT PATCH 2/3] qlcnic: support rcv ring configuration through ethtool
Date: Thu, 28 Apr 2011 01:02:42 +0100 [thread overview]
Message-ID: <1303948962.2875.178.camel@bwh-desktop> (raw)
In-Reply-To: <1303951426-4341-3-git-send-email-amit.salecha@qlogic.com>
On Wed, 2011-04-27 at 17:43 -0700, Amit Kumar Salecha wrote:
> From: Sucheta Chakraborty <sucheta.chakraborty@qlogic.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.
next prev parent reply other threads:[~2011-04-28 0:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 0:43 [NEXT PATCH 0/3]qlcnic: updates Amit Kumar Salecha
2011-04-28 0:43 ` [NEXT PATCH 1/3] qlcnic: fix memory leak in qlcnic_blink_led Amit Kumar Salecha
2011-04-28 20:44 ` David Miller
2011-04-28 0:43 ` [NEXT PATCH 2/3] qlcnic: support rcv ring configuration through ethtool Amit Kumar Salecha
2011-04-28 0:02 ` Ben Hutchings [this message]
2011-04-28 21:05 ` Amit Salecha
2011-04-28 20:44 ` David Miller
2011-04-28 0:43 ` [NEXT PATCH 3/3] qlcnic: Support for GBE port settings Amit Kumar Salecha
2011-04-28 20:44 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1303948962.2875.178.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=ameen.rahman@qlogic.com \
--cc=amit.salecha@qlogic.com \
--cc=anirban.chakraborty@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sucheta.chakraborty@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).