From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by dpdk.org (Postfix) with ESMTP id 025B32C29 for ; Thu, 4 Aug 2016 20:25:04 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id g202so18729448pfb.1 for ; Thu, 04 Aug 2016 11:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rWVsZlc2bGumMXgtyxLQhBC76zJaOrqMDtnr1O8F2q4=; b=HLKF4MkXuXNUe0H9p3PKjKRSzI8skK94KY3A6siTjnHzTUEVhCMFYC6hIwT2YYUvEz 5e5B6YroN53EJ8MDieRBbeXjELIupmMd9bCH3Gp3UVGKd6vEYcwt0V+GjQHfVJbyoVur RPiFtuYC3ei85x1TUo7+Dxcfsv49nYiC4KB15SiSnfTFKsIciaejnHdvUTbz0PBycv2M vIFRynCOxy/2mv02wcj3Bra2kkqElhzoFGDAdOkUEHo8EhLa8XmDoBrkIcDquHlIaWpw Xv3lfBqOUWigxTkM5fuUxnyhcYbW6gvUzo8X6GdnS76Be1YuzSr8pM9OhGGOAUIYR5dN Dz/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rWVsZlc2bGumMXgtyxLQhBC76zJaOrqMDtnr1O8F2q4=; b=bMesJ8mx39a+sUtbb7MqmJ+0LXv45UkuxD9EraFfziKmLAI+xEZ9gaYtaQ1Tn6Tz11 XM/0mrDwaVss+Ruqofn+7yKm57ib/JdUKzrTUi9H6M2Q4uo8RPbvaA0EP6Rq3ROPInQY zUxjqwCdXEijaOn6NZxGg6sG1Sm8YJYHzy5iHUi/fb+77iWHvK6b0qP5pnEK5qxQwmgf +P+i9nNi2fGels1hVrSQwZtd8EdmcMbuLto728JY+u+X7wVwGFUCwEbRdFNSkNRb46TB Lo/eh6ZiTVj0qen8xCaq16X7ZTSRX+57bo9xRLteUqQKvQbbOfBQj6q4v7zOFYCX+V71 hVXA== X-Gm-Message-State: AEkoous8CP8NERVV0i/LtPoSqENxLwld8yO0sPp1IQhpj7doDdHEr/HTyjeLHla/I34EtQ== X-Received: by 10.98.78.138 with SMTP id c132mr127755759pfb.67.1470335103201; Thu, 04 Aug 2016 11:25:03 -0700 (PDT) Received: from buildhost2.vyatta.com. ([144.49.132.22]) by smtp.gmail.com with ESMTPSA id e187sm22016867pfg.43.2016.08.04.11.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 11:25:02 -0700 (PDT) From: Eric Kinzie To: dev@dpdk.org Cc: Jan Blunck Date: Thu, 4 Aug 2016 11:24:42 -0700 Message-Id: <1470335083-6380-2-git-send-email-ehkinzie@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1470335083-6380-1-git-send-email-ehkinzie@gmail.com> References: <1470335083-6380-1-git-send-email-ehkinzie@gmail.com> Subject: [dpdk-dev] [PATCH 1/2] net/bonding: validate speed after link up X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2016 18:25:04 -0000 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 --- 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.7.10.4