From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by dpdk.org (Postfix) with ESMTP id B3D0D1B1B3 for ; Tue, 13 Feb 2018 23:54:36 +0100 (CET) Received: by mail-qk0-f195.google.com with SMTP id n198so167716qke.7 for ; Tue, 13 Feb 2018 14:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WgRzJdERXbHGmPacs/NtKhN4rt43Adj44PzhC+OgZu4=; b=IlCHbDn629UwZ2XcdHNwSDqiGjojmqzb5BgO3E9cnGLtEwgFasroEVp+R9mjH2HyCP 2WIvwYL7szq51tDoVA514gVBc+VsHEg+qOy4vsUn0Ccs29f7lL4yHFPf7o6bP2lkucTB eDan5mGEVA1NcCGinsJPndXxiE8cxn66aW8Xz04a/AZ1nw/WrlgXeg0pxEbvxgl7zunN Z3HImYqmXESh74hYtI8ADbbURM+HBIqRl0o/pi/m1d5izn66qw5Piu6Wd+AYnyTo2kML 2nwtXXHU0yI/gJXMBreKivOsjjeOQMAdOvzvFsDK6/Jc/d6xCyKsYbSAj9N45qIeIk/a yIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WgRzJdERXbHGmPacs/NtKhN4rt43Adj44PzhC+OgZu4=; b=Kl28ls8ba9ZJW30jns5I6W18nV+URRO3jDcA6O4BxX9IVNwgUT3tw5tS+pc13ztJRf WmzBpf03bUsi0znIjxBC8GESuoCz8wJVbUP1M+Hxrqr4ZNy+EBlWfpEuINdqfaZWvHz/ /iFVYxNiVKupKE3jTPjOBwuPThcuAejSZDxTIQcEE1vsjfrakaArFTJkfUCL5Kw+YZfi Z4uITsjiNOiiIXuuDfSgbN21C+JmXowZRDVsI+P1HHplyzGctOy6JiihqKX+iCtxbQSf Vws9krpO9N1jeFbOYuuwhssSB983m0ghBjkBVmZida0VYYlHmR5L91QlGGWHJAG/a818 Imkw== X-Gm-Message-State: APf1xPDSfQGRIdww6xb3fjAVC6pJ5pxf1L7c1KJc2y+Q6dSmTXult5BK iSow3xSXDOwJw9/6elGorfjGpQ== X-Google-Smtp-Source: AH8x224Z4vffZn3qL3g16iso//2JfM+wRKTS2QBFnpSqZEZ46otIYiAHawX8TxIJniVnuuTmYWrDuA== X-Received: by 10.55.168.80 with SMTP id r77mr4565932qke.157.1518562475953; Tue, 13 Feb 2018 14:54:35 -0800 (PST) Received: from monolith.home (pool-173-79-224-159.washdc.fios.verizon.net. [173.79.224.159]) by smtp.gmail.com with ESMTPSA id w201sm915632qkb.52.2018.02.13.14.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 14:54:35 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: declan.doherty@intel.com, Chas Williams Date: Tue, 13 Feb 2018 17:54:30 -0500 Message-Id: <20180213225430.15556-1-3chas3@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/bonding: fix link properties with autoneg X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 22:54:37 -0000 From: Chas Williams 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 --- 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