From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Amerigo Wang <amwang@redhat.com>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, nhorman@redhat.com,
herbert.xu@redhat.com, bhutchings@solarflare.com,
Ramkrishna.Vepa@exar.com, davem@davemloft.net
Subject: Re: [v2 Patch 2/2] mlx4: add dynamic LRO disable support
Date: Wed, 9 Jun 2010 13:05:57 +0200 [thread overview]
Message-ID: <20100609110556.GC2599@dhcp-lab-161.englab.brq.redhat.com> (raw)
In-Reply-To: <20100609100938.6573.73536.sendpatchset@localhost.localdomain>
On Wed, Jun 09, 2010 at 06:05:34AM -0400, Amerigo Wang wrote:
> diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c
> index d5afd03..2c77805 100644
> --- a/drivers/net/mlx4/en_ethtool.c
> +++ b/drivers/net/mlx4/en_ethtool.c
> @@ -387,6 +387,37 @@ static void mlx4_en_get_ringparam(struct net_device *dev,
> param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size;
> }
>
> +static int mlx4_ethtool_op_set_flags(struct net_device *dev, u32 data)
> +{
> + struct mlx4_en_priv *priv = netdev_priv(dev);
> + struct mlx4_en_dev *mdev = priv->mdev;
> + int rc = 0;
> + int changed = 0;
> +
> + if (data & ETH_FLAG_LRO) {
> + if (!(dev->features & NETIF_F_LRO)) {
> + dev->features |= NETIF_F_LRO;
> + changed = 1;
> + mdev->profile.num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS);
I do not understand why you override mdev->profile.num_lro in v2 patch.
If in Rx patch NETIF_F_LRO flag is used we do not need this IMHO.
> + }
> + } else if (dev->features & NETIF_F_LRO) {
> + dev->features &= ~NETIF_F_LRO;
> + changed = 1;
> + mdev->profile.num_lro = 0;
> + }
[snip]
> const struct ethtool_ops mlx4_en_ethtool_ops = {
> .get_drvinfo = mlx4_en_get_drvinfo,
> .get_settings = mlx4_en_get_settings,
> @@ -415,7 +446,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
> .get_ringparam = mlx4_en_get_ringparam,
> .set_ringparam = mlx4_en_set_ringparam,
> .get_flags = ethtool_op_get_flags,
> - .set_flags = ethtool_op_set_flags,
> + .set_flags = mlx4_ethtool_op_set_flags,
> };
Since we modify .set_flags, please assure we return -EOPNOTSUPP
if someone will try to setup ETH_FLAG_NTUPLE and ETH_FLAG_RXHASH.
BTW: seems default ethtool_op_set_flags introduce a bug on many
devices regarding ETH_FLAG_RXHASH. I think default should
be EOPNOTSUPP, and these few devices that actually support RXHASH
should have custom ethtool_ops->set_flags
Stanislaw
next prev parent reply other threads:[~2010-06-09 11:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 10:05 [v2 Patch 1/2] s2io: add dynamic LRO disable support Amerigo Wang
2010-06-09 10:05 ` [v2 Patch 2/2] mlx4: " Amerigo Wang
2010-06-09 11:05 ` Stanislaw Gruszka [this message]
2010-06-15 8:35 ` Cong Wang
2010-06-15 10:14 ` Stanislaw Gruszka
2010-06-17 10:48 ` Cong Wang
2010-06-09 14:00 ` [v2 Patch 1/2] s2io: " Ben Hutchings
2010-06-09 18:52 ` Ramkrishna Vepa
2010-06-15 8:26 ` Cong Wang
2010-06-15 16:07 ` Ramkrishna Vepa
2010-06-15 17:21 ` 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=20100609110556.GC2599@dhcp-lab-161.englab.brq.redhat.com \
--to=sgruszka@redhat.com \
--cc=Ramkrishna.Vepa@exar.com \
--cc=amwang@redhat.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=herbert.xu@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.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).