From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, nhorman@redhat.com,
herbert.xu@redhat.com, bhutchings@solarflare.com,
Ramkrishna.Vepa@exar.com, davem@davemloft.net
Subject: Re: [v3 Patch 2/2] mlx4: add dynamic LRO disable support
Date: Mon, 21 Jun 2010 11:02:15 +0200 [thread overview]
Message-ID: <20100621090214.GB3240@dhcp-lab-161.englab.brq.redhat.com> (raw)
In-Reply-To: <4C1ECD04.20609@redhat.com>
On Mon, Jun 21, 2010 at 10:23:00AM +0800, Cong Wang wrote:
> On 06/18/10 19:09, Stanislaw Gruszka wrote:
>> On Fri, Jun 18, 2010 at 06:55:38AM -0400, Amerigo Wang wrote:
>>> +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_NTUPLE | ETH_FLAG_RXHASH))
>>> + return -EOPNOTSUPP;
As we are here, better would be
if (data & ~ETH_FLAG_LRO)
return -EOPNOTSUPP;
code will persist correct when someone add new flags.
>>> +
>>> + if (data& ETH_FLAG_LRO) {
>>> + if (!(dev->features& NETIF_F_LRO))
>>> + changed = 1;
>>> + } else if (dev->features& NETIF_F_LRO) {
>>> + changed = 1;
>>> + mdev->profile.num_lro = 0;
>>
>> Everything fine except that, what for you zero num_lro value?
>>
>> If we set it to zero it will stay zero and we will not create
>> proper number of lro descriptors in mlx4_en_create_rx_ring()
>> (called from mlx4_en_set_ringparam() -> mlx4_en_alloc_resources())
>> when someone enable LRO again on.
>>
>
> Huh? Isn't ->num_lro which controls LRO of mlx4 driver?
It is, but only in mlx4_en_add() just before register_netdev(),
when we setup default dev->features. Otherwise dev->features
tells if LRO is enabled or disabled.
This realize me, that we should not dev->features |= NETIF_F_LRO
if mdev->profile.num_lro == 0 .
Stanislaw
next prev parent reply other threads:[~2010-06-21 9:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 10:55 [v3 Patch 1/2] s2io: add dynamic LRO disable support Amerigo Wang
2010-06-18 10:55 ` [v3 Patch 2/2] mlx4: " Amerigo Wang
2010-06-18 11:09 ` Stanislaw Gruszka
2010-06-21 2:23 ` Cong Wang
2010-06-21 9:02 ` Stanislaw Gruszka [this message]
2010-06-22 8:42 ` Cong Wang
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=20100621090214.GB3240@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).