From: Cong Wang <amwang@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
netdev@vger.kernel.org, herbert.xu@redhat.com,
nhorman@redhat.com, davem@davemloft.net
Subject: Re: [Patch 2/2] mlx4: add dynamic LRO disable support
Date: Thu, 17 Jun 2010 18:54:28 +0800 [thread overview]
Message-ID: <4C19FEE4.4000804@redhat.com> (raw)
In-Reply-To: <20100615113926.30d0cd01@dhcp-lab-109.englab.brq.redhat.com>
On 06/15/10 17:39, Stanislaw Gruszka wrote:
> On Tue, 15 Jun 2010 16:53:27 +0800
> Cong Wang<amwang@redhat.com> wrote:
>
>>> If so, it's better to stop device before modify LRO settings. I suggest
>>> something like that in mlx4_ethtool_op_set_flags:
>>>
>>> if (!!(data& ETH_FLAG_LRO) != !!(dev->features& NETIF_F_LRO)) {
>>
>> What does this line mean? This is to ignore all other flags, right?
>
> Yes, plus check if we are really changing current settings.
>
>>> /* Need to toggle LRO */
>>>
>>> if (netdev_running(dev)) {
>>> mutex_lock(&mdev->state_lock);
>>> mlx4_en_stop_port(dev);
>>> rc = mlx4_en_start_port(dev);
>>> if (rc)
>>> en_err(priv, "Failed to restart port\n");
>>> }
>>>
>>> dev->features ^= NETIF_F_LRO;
>>>
>>> if (netdev_running(dev))
>>> mutex_unlock(&mdev->state_lock);
>>> }
>>>
>>
>> I don't think mdev->state_lock is used to protect dev->feature.
>> rtnl_lock is. I think switching to mlx4_ethtool_op_set_flags()
>> from the default one has already solved this.
>
> Ahh, you have right, may intention was use it to stop and start
> port. Code rather should look like below:
>
> if (netdev_running(dev)) {
> mutex_lock(&mdev->state_lock);
> mlx4_en_stop_port(dev);
> }
>
> dev->features ^= NETIF_F_LRO;
>
> if (netdev_running(dev)) {
> rc = mlx4_en_start_port(dev);
> mutex_unlock(&mdev->state_lock);
> if (rc)
> en_err(priv, "Failed to restart port\n");
> }
>
Hmm, you mean ->features should be changed after port is stopped?
Why?
next prev parent reply other threads:[~2010-06-17 10:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-03 3:38 [Patch 1/2] s2io: add dynamic LRO disable support Amerigo Wang
2010-06-03 3:39 ` [Patch 2/2] mlx4: " Amerigo Wang
2010-06-03 12:37 ` Ben Hutchings
2010-06-04 1:56 ` Cong Wang
2010-06-04 14:25 ` Ben Hutchings
2010-06-07 8:51 ` Cong Wang
2010-06-07 11:00 ` Stanislaw Gruszka
2010-06-07 13:15 ` Cong Wang
2010-06-09 9:23 ` Cong Wang
2010-06-09 10:49 ` Stanislaw Gruszka
2010-06-15 8:53 ` Cong Wang
2010-06-15 9:39 ` Stanislaw Gruszka
2010-06-17 10:54 ` Cong Wang [this message]
2010-06-17 12:03 ` Stanislaw Gruszka
2010-06-18 3:10 ` Cong Wang
2010-06-03 13:38 ` [Patch 1/2] s2io: " Michal Schmidt
2010-06-05 8:53 ` Ramkrishna Vepa
2010-06-07 9:01 ` 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=4C19FEE4.4000804@redhat.com \
--to=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 \
--cc=sgruszka@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.