DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Cc: declan.doherty@intel.com, Chas Williams <chas3@att.com>
Subject: [dpdk-dev] [PATCH] net/bonding: fix link properties with autoneg
Date: Tue, 13 Feb 2018 17:54:30 -0500	[thread overview]
Message-ID: <20180213225430.15556-1-3chas3@gmail.com> (raw)

From: Chas Williams <chas3@att.com>

If a link is carrier down and using autonegotiation, then the PMD may not
have detected a speed yet.  In this case the best we can do is ignore the
link speed and duplex since they aren't valid.  To be completely correct,
there should be additional checks to prevent a slave that negotiates a
different speed from being activated.

Signed-off-by: Chas Williams <chas3@att.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 92ad688..5559879 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1545,9 +1545,10 @@ link_properties_valid(struct rte_eth_dev *ethdev,
 	if (bond_ctx->mode == BONDING_MODE_8023AD) {
 		struct rte_eth_link *bond_link = &bond_ctx->mode4.slave_link;
 
-		if (bond_link->link_duplex != slave_link->link_duplex ||
-			bond_link->link_autoneg != slave_link->link_autoneg ||
-			bond_link->link_speed != slave_link->link_speed)
+		if (bond_link->link_autoneg != slave_link->link_autoneg ||
+		    (bond_link->link_autoneg != ETH_LINK_AUTONEG &&
+		     (bond_link->link_duplex != slave_link->link_duplex ||
+		      bond_link->link_speed != slave_link->link_speed)))
 			return -1;
 	}
 
-- 
2.9.5

             reply	other threads:[~2018-02-13 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 22:54 Chas Williams [this message]
2018-02-13 23:03 ` Thomas Monjalon
2018-04-16  8:06 ` Matan Azrad
2018-04-16 16:44   ` Chas Williams
2018-04-16 19:09     ` Matan Azrad
2018-06-14 17:04       ` Ferruh Yigit
2018-06-16 17:29         ` Chas Williams

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=20180213225430.15556-1-3chas3@gmail.com \
    --to=3chas3@gmail.com \
    --cc=chas3@att.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).