From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9899E47D2 for ; Thu, 26 May 2016 18:39:29 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 26 May 2016 09:39:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,369,1459839600"; d="scan'208";a="989358424" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 26 May 2016 09:39:04 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u4QGd3vK013484; Thu, 26 May 2016 17:39:03 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u4QGd3vs026449; Thu, 26 May 2016 17:39:03 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u4QGd3Hq026445; Thu, 26 May 2016 17:39:03 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: declan.doherty@intel.com, konstantin.ananyev@intel.com, Bernard Iremonger Date: Thu, 26 May 2016 17:38:46 +0100 Message-Id: <1464280727-25752-6-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1464280727-25752-1-git-send-email-bernard.iremonger@intel.com> References: <1462461300-9962-1-git-send-email-bernard.iremonger@intel.com> <1464280727-25752-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v2 5/6] bonding: add spinlock to link update function 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, 26 May 2016 16:39:30 -0000 Signed-off-by: Bernard Iremonger --- drivers/net/bonding/rte_eth_bond_pmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 55b37a5..474bfcc 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1853,9 +1853,11 @@ bond_ethdev_link_update(struct rte_eth_dev *bonded_eth_dev, { struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + rte_spinlock_lock(&internals->lock); if (!bonded_eth_dev->data->dev_started || internals->active_slave_count == 0) { bonded_eth_dev->data->dev_link.link_status = ETH_LINK_DOWN; + rte_spinlock_unlock(&internals->lock); return 0; } else { struct rte_eth_dev *slave_eth_dev; @@ -1874,6 +1876,7 @@ bond_ethdev_link_update(struct rte_eth_dev *bonded_eth_dev, bonded_eth_dev->data->dev_link.link_status = link_up; } + rte_spinlock_unlock(&internals->lock); return 0; } -- 2.6.3