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 A8E80378E for ; Wed, 28 Jun 2017 12:16:43 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2017 03:16:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,274,1496127600"; d="scan'208";a="104574601" Received: from dwdohert-dpdk.ir.intel.com ([163.33.210.152]) by orsmga002.jf.intel.com with ESMTP; 28 Jun 2017 03:16:41 -0700 From: Declan Doherty To: dev@dpdk.org Cc: Declan Doherty Date: Wed, 28 Jun 2017 11:15:50 +0100 Message-Id: <20170628101550.24643-1-declan.doherty@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170626151347.16680-1-declan.doherty@intel.com> References: <20170626151347.16680-1-declan.doherty@intel.com> Subject: [dpdk-dev] [PATCH v2] net/bond: change link status check to no-wait 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: Wed, 28 Jun 2017 10:16:44 -0000 In 2 modes (802.3ad and TLB) of the link bonding driver, monitoring of link status is used to determine the active slaves to use. These functions are currently using the rte_link_link_get which could block for up to 9 seconds, depending on the slave device. In the 802.3ad periodic callback and in the TLB slave callback the link status of slaves are checked using rte_eth_link_get function. This patch changes to the no-wait version of the link get function to avoid the possible issues which could be introduced if this call was to block for an extended period of time. Fixes: 46fb4368 ("bond:add mode 4") Fixes: 7c76a747 ("bond:add mode 5") Signed-off-by: Declan Doherty --- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index d2b7592..3a97336 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -758,7 +758,7 @@ bond_mode_8023ad_periodic_cb(void *arg) uint16_t key; slave_id = internals->active_slaves[i]; - rte_eth_link_get(slave_id, &link_info); + rte_eth_link_get_nowait(slave_id, &link_info); rte_eth_macaddr_get(slave_id, &slave_addr); if (link_info.link_status != 0) { diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index a8d9780..eff2a66 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -654,7 +654,7 @@ bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, { struct rte_eth_link link_status; - rte_eth_link_get(port_id, &link_status); + rte_eth_link_get_nowait(port_id, &link_status); uint64_t link_bwg = link_status.link_speed * 1000000ULL / 8; if (link_bwg == 0) return; -- 2.9.4