public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: zhuyj <zyjzyj2000@gmail.com>
Cc: netdev@vger.kernel.org, "Tantilov,
	Emil S" <emil.s.tantilov@intel.com>,
	Veaceslav Falico <vfalico@gmail.com>,
	dingtianhong <dingtianhong@huawei.com>,
	Andy Gospodarek <gospo@cumulusnetworks.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 net] bonding: don't use stale speed and duplex information
Date: Thu, 25 Feb 2016 05:33:55 -0800	[thread overview]
Message-ID: <11163.1456407235@nyx> (raw)
In-Reply-To: <56CEBCC6.3040008@gmail.com>

zhuyj <zyjzyj2000@gmail.com> wrote:
[...]
>I delved into the source code and Emil's tests. I think that the problem
>that this patch expects to fix occurs very unusually.
>
>Do you agree with me?
>
>If so, maybe the following patch can reduce the performance loss.
>Please comment on it. Thanks a lot.
>
>
>diff --git a/drivers/net/bonding/bond_main.c
>b/drivers/net/bonding/bond_main.c
>index b7f1a99..c4c511a 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2129,7 +2129,9 @@ static void bond_miimon_commit(struct bonding *bond)
>                        continue;
>
>                case BOND_LINK_UP:
>-                       bond_update_speed_duplex(slave);
>+                       if (slave->speed == SPEED_UNKNOWN)
>+                               bond_update_speed_duplex(slave);
>+
>                        bond_set_slave_link_state(slave, BOND_LINK_UP,
>BOND_SLAVE_NOTIFY_NOW);
>                        slave->last_link_up = jiffies;

	I don't believe the speed is necessarily SPEED_UNKNOWN coming in
here.  If the race occurs at a time later than the initial enslavement,
speed may already be set (and the race manifests if the new speed
changes, i.e., the link changes from 1 Gb/sec to 10 Gb/sec), so I don't
think this is functionally correct.

	Also, the call to bond_miimon_commit itself is already gated by
bond_miimon_inspect finding a link state change.  The performance impact
here should be minimal.

	-J

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

  reply	other threads:[~2016-02-25 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 20:10 [PATCH v2 net] bonding: don't use stale speed and duplex information Jay Vosburgh
2016-02-14  2:36 ` Ding Tianhong
2016-02-16 20:14 ` David Miller
2016-02-18 20:25   ` Jay Vosburgh
2016-02-18 20:27     ` David Miller
2016-02-25  8:35 ` zhuyj
2016-02-25 13:33   ` Jay Vosburgh [this message]
2016-02-26  2:21     ` zhuyj
2016-02-29  5:39       ` Jay Vosburgh
2016-02-29  6:41         ` zhuyj

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=11163.1456407235@nyx \
    --to=jay.vosburgh@canonical.com \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.com \
    --cc=zyjzyj2000@gmail.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