From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7470B2B8B for ; Wed, 2 Nov 2016 11:20:56 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 02 Nov 2016 03:20:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="26465648" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 02 Nov 2016 03:20:55 -0700 From: Yuanhan Liu To: Eric Kinzie Date: Wed, 2 Nov 2016 18:21:06 +0800 Message-Id: <1478082097-16957-10-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: Bernard Iremonger , dpdk stable Subject: [dpdk-stable] patch 'net/bonding: validate speed after link up' has been queued to stable release 16.07.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 10:20:56 -0000 Hi, FYI, your patch has been queued to stable release 16.07.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/06/16. So please shout if anyone has objections. Thanks. --yliu --- >>From d6a7d563feb8eab31dc5404a0704a1354b9a441a Mon Sep 17 00:00:00 2001 From: Eric Kinzie Date: Thu, 4 Aug 2016 11:24:42 -0700 Subject: [PATCH] net/bonding: validate speed after link up [ upstream commit b4092cacf6bd6470c0c37937862255639293e9b0 ] It's possible for the bonding driver to mistakenly reject an interface based in it's, as yet, unnegotiated link speed and duplex. Always allow the interface to be added to the bonding interface but require link properties validation to succeed before slave is activated. Fixes: 2efb58cbab6e ("bond: new link bonding library") Signed-off-by: Eric Kinzie Acked-by: Bernard Iremonger --- drivers/net/bonding/rte_eth_bond_api.c | 15 --------------- drivers/net/bonding/rte_eth_bond_pmd.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 203ebe9..3c16973 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -373,21 +373,6 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) internals->candidate_max_rx_pktlen = dev_info.max_rx_pktlen; } else { - /* Check slave link properties are supported if props are set, - * all slaves must be the same */ - if (internals->link_props_set) { - if (link_properties_valid(&(bonded_eth_dev->data->dev_link), - &(slave_eth_dev->data->dev_link))) { - slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_SLAVE); - RTE_BOND_LOG(ERR, - "Slave port %d link speed/duplex not supported", - slave_port_id); - return -1; - } - } else { - link_properties_set(bonded_eth_dev, - &(slave_eth_dev->data->dev_link)); - } internals->rx_offload_capa &= dev_info.rx_offload_capa; internals->tx_offload_capa &= dev_info.tx_offload_capa; internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b20a272..25fe00a 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1985,6 +1985,16 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, /* Inherit eth dev link properties from first active slave */ link_properties_set(bonded_eth_dev, &(slave_eth_dev->data->dev_link)); + } else { + if (link_properties_valid( + &bonded_eth_dev->data->dev_link, &link) != 0) { + slave_eth_dev->data->dev_flags &= + (~RTE_ETH_DEV_BONDED_SLAVE); + RTE_LOG(ERR, PMD, + "port %u invalid speed/duplex\n", + port_id); + return; + } } activate_slave(bonded_eth_dev, port_id); -- 1.9.0