From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by dpdk.org (Postfix) with ESMTP id 417A78E62; Fri, 18 May 2018 01:23:01 +0200 (CEST) Received: by mail-qt0-f193.google.com with SMTP id f13-v6so8064912qtp.10; Thu, 17 May 2018 16:23:01 -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=0UhwtJ3C9Ba+6dYKibpTlI3rikb2bv+QBZEk1zIfFEU=; b=vAVvL5aqolQ4dOhwoxuDxWU5XCDpvu6SKuPT5hfD9zU4hhhnRP/tmJPIyMVBK8upf2 Mmf0FabdsyamRI4w3Oi9TCc+GWNmdaXk6dSOguny45Nb224ag6RUzF1AaFRV/dbrsaJ/ MfHXPgjAOCQdl9y9EfeWIhZw/8YJi1F6bf2B9X8+6fpAZvkEtusa0ojKnOqxv+mDOEF0 ysp9Ip43VC5FsyG5Sa95YGFGoI9XjZHEW+X25xjrrrXy56hExg1oukT59q2Pji+dec/B RM0vkXPztO9/VWkzP907DMF70cZlL6IMC+bLuKXOplMAG8p0ckT97NPboXKbfEjuHY2G 6J/w== 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=0UhwtJ3C9Ba+6dYKibpTlI3rikb2bv+QBZEk1zIfFEU=; b=HgtwbGd7ufzLdR9kSzzT8EkttqXw/Bb7HnzVHObx+Kzlx8dHUrZZlDOeSJLtnyjm62 zaW84BryglN5lSZeaBvBqSlVVgPjCehazxL3BO+/S4fZ15lO7e2n8Si3AXkr26FkrdNO lQp//bG/XuZqtQBhk1m+bHiB3LU1k1H94veSf0Mzacdai+etuxh1qdcW2B1JGs//Y4LN 6mF65I4yrDzcPU/wDFGkIL28fhmD5AU7Kt/z59QPssQsXzyFHrJa94mAq9ZBFLOPWsZ4 J8ZfvMd7VhqUwQpLRjVrEyRKr7uaC5y1Ta3WNL0smFsPQfp+I2VEL0XKdtety4QdBWQz SipQ== X-Gm-Message-State: ALKqPwcJTNz0lCvtJyhC+78EnRlef2kKlPkVbIoF76Owg5H0g+lH/a9O 1ohT2vSiZrlNhzdDRlRgiP61wg== X-Google-Smtp-Source: AB8JxZp07ISArhod6wSv5KvkiP/Z0YjAYP1zft393E/pRn3fQxFb8vV2dPD++kL+Nb2uQzgUByC09Q== X-Received: by 2002:ac8:328b:: with SMTP id z11-v6mr7528132qta.287.1526599380553; Thu, 17 May 2018 16:23:00 -0700 (PDT) Received: from monolith.fios-router.home (pool-173-79-169-217.washdc.fios.verizon.net. [173.79.169.217]) by smtp.gmail.com with ESMTPSA id w51-v6sm4450693qtc.97.2018.05.17.16.22.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 16:23:00 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: declan.doherty@intel.com, Chas Williams , stable@dpdk.org Date: Thu, 17 May 2018 19:22:52 -0400 Message-Id: <20180517232252.19908-2-3chas3@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180517232252.19908-1-3chas3@gmail.com> References: <20180517232252.19908-1-3chas3@gmail.com> Subject: [dpdk-stable] [PATCH 2/2] net/bonding: always update bonding link status X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 23:23:01 -0000 From: Chas Williams When the first ETH_LINK_UP slave is added to a bonding device, it is immediately activated. If these are polling slaves, there will be a later link state event, when last_link_status doesn't match link_status. But because this slave is already activated, the bonding device's link status isn't updated. To fix this, we always attempt to update the bonding device's link status in the link state change callback. Fixes: 46fb43683679 ("bond: add mode 4") Cc: stable@dpdk.org Signed-off-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 02d94b1b1..f155ff779 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2664,10 +2664,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, rte_eth_link_get_nowait(port_id, &link); if (link.link_status) { - if (active_pos < internals->active_slave_count) { - rte_spinlock_unlock(&internals->lsc_lock); - return rc; - } + if (active_pos < internals->active_slave_count) + goto link_update; /* if no active slave ports then set this port to be primary port */ if (internals->active_slave_count < 1) { @@ -2686,10 +2684,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, internals->primary_port == port_id) bond_ethdev_primary_set(internals, port_id); } else { - if (active_pos == internals->active_slave_count) { - rte_spinlock_unlock(&internals->lsc_lock); - return rc; - } + if (active_pos == internals->active_slave_count) + goto link_update; /* Remove from active slave list */ deactivate_slave(bonded_eth_dev, port_id); @@ -2708,6 +2704,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, } } +link_update: /** * Update bonded device link properties after any change to active * slaves @@ -2745,7 +2742,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, rte_spinlock_unlock(&internals->lsc_lock); - return 0; + return rc; } static int -- 2.14.3