From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by dpdk.org (Postfix) with ESMTP id D3CAA7FC9; Fri, 23 Mar 2018 18:05:38 +0100 (CET) Received: by mail-qt0-f196.google.com with SMTP id v11so13219975qtj.6; Fri, 23 Mar 2018 10:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lV9uKwRTp6fLzurmcHqzgOJFgDbCEX1ZGJocfxbs9bw=; b=ovupquBhHP7EWc8L8w4t9IH+Yh31BBiKFhm9gCRuWQAHOzwvUje3EtnqqEfqL7B2va QHxv3XvI9N9rOPsjV5zS8iVgEF5dm0mCqv0xqVj2I3dDU99733UU7YGJMtUo3PiNoKPB wdDuU/3DW+7S+1NBb8F5QGsNt0oUqSBltN18e3x0clpErjI3GlTAJmchhM2PibGfzaZu A08Vo+POlyORyEMmW/AlO0q+xYaqTz2oBe/7OdrSMkVeuiBXaRCu8xn58sOxP5pKbpO9 M4lmpOBwQ+PcYkcncazs1PJVBiF/Q3sQh0G6R5wx7H+poUstvLlzqDgZT7VWteKNdhMy FDFw== 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:in-reply-to :references; bh=lV9uKwRTp6fLzurmcHqzgOJFgDbCEX1ZGJocfxbs9bw=; b=K+3qWjQuqsQrkEsF2dGh1xhjls3ag0r36lSJPckJWRcJ3aY0/5luwT5O8JiVTz5xGA qF3q3RRMbxq/uz793gkBeIyRgI1qbsBU4ai+nwiGEZm13JkPF/PrSZfhlGc1NjCZGB1j KrZ8a94YvpYOTEeYDIDKks3pRiZqV7wxtRp2GehE6Kiwt/DGWKkKIoH779dkATk/MUbv eT0I/Nbxeh0j/7KtGt3TmpDFbeuc9O02zu0Ik84mxO4k8BkLlBXFAVmRYvuh3CjlcDy1 bHeaBr2Ct5ZUOAM2GiWs8UIpQFJDqfL9IAU0DtQzBa1kwZmWcubsfa53jtPGLDZ5UpFK ypZw== X-Gm-Message-State: AElRT7En80ym+z/ZBNpke7iGoNQ1LdsqKeCyD7t/3lHqxP8QeSeDhBC/ e6OjwmkzUkcSz962KPkwfq2NQA== X-Google-Smtp-Source: AIpwx4/3Vtny3FX8Qg+NK9EV52nwwoGsFDz6vQbQZnDAoHdZxPDuwyY4+7GrQgjmMVYyeaLOxooHug== X-Received: by 10.237.55.193 with SMTP id j59mr5812864qtb.110.1521824737950; Fri, 23 Mar 2018 10:05:37 -0700 (PDT) Received: from monolith.home (pool-173-79-224-159.washdc.fios.verizon.net. [173.79.224.159]) by smtp.gmail.com with ESMTPSA id m103sm6292888qkh.20.2018.03.23.10.05.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Mar 2018 10:05:37 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: declan.doherty@intel.com, "Charles (Chas) Williams" , stable@dpdk.org Date: Fri, 23 Mar 2018 13:05:32 -0400 Message-Id: <20180323170532.7448-1-3chas3@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180316163441.31898-1-3chas3@gmail.com> References: <20180316163441.31898-1-3chas3@gmail.com> Subject: [dpdk-dev] [PATCH v2] net/bonding: clear dev_started if start fails 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: Fri, 23 Mar 2018 17:05:39 -0000 From: "Charles (Chas) Williams" There are several error paths where the bonding device may not start. Clear dev_started before we return if we take one of these paths. Fixes: 2efb58cbab ("bond: new link bonding library") Cc: stable@dpdk.org Signed-off-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b59ba9f7c..1decd8bed 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2034,7 +2034,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) if (internals->slave_count == 0) { RTE_BOND_LOG(ERR, "Cannot start port since there are no slave devices"); - return -1; + goto out_err; } if (internals->user_defined_mac == 0) { @@ -2045,18 +2045,18 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) new_mac_addr = &internals->slaves[i].persisted_mac_addr; if (new_mac_addr == NULL) - return -1; + goto out_err; if (mac_address_set(eth_dev, new_mac_addr) != 0) { RTE_BOND_LOG(ERR, "bonded port (%d) failed to update MAC address", eth_dev->data->port_id); - return -1; + goto out_err; } } /* Update all slave devices MACs*/ if (mac_address_slaves_update(eth_dev) != 0) - return -1; + goto out_err; /* If bonded device is configure in promiscuous mode then re-apply config */ if (internals->promiscuous_en) @@ -2081,7 +2081,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) "bonded port (%d) failed to reconfigure slave device (%d)", eth_dev->data->port_id, internals->slaves[i].port_id); - return -1; + goto out_err; } /* We will need to poll for link status if any slave doesn't * support interrupts @@ -2089,6 +2089,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) if (internals->slaves[i].link_status_poll_enabled) internals->link_status_polling_enabled = 1; } + /* start polling if needed */ if (internals->link_status_polling_enabled) { rte_eal_alarm_set( @@ -2108,6 +2109,10 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) bond_tlb_enable(internals); return 0; + +out_err: + eth_dev->data->dev_started = 0; + return -1; } static void -- 2.13.6