From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B43C62BD1 for ; Fri, 5 Aug 2016 05:18:09 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 04 Aug 2016 20:18:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,472,1464678000"; d="scan'208";a="744443587" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 04 Aug 2016 20:17:48 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u753Hk7f009747; Fri, 5 Aug 2016 11:17:46 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u753Hi7B014069; Fri, 5 Aug 2016 11:17:46 +0800 Received: (from xiaowan1@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u753Hi2Y014065; Fri, 5 Aug 2016 11:17:44 +0800 From: Xiao Wang To: jing.d.chen@intel.com, xueqin.lin@intel.com Cc: dev@dpdk.org, Xiao Wang Date: Fri, 5 Aug 2016 11:17:43 +0800 Message-Id: <1470367063-14035-1-git-send-email-xiao.w.wang@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch 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: Fri, 05 Aug 2016 03:18:10 -0000 When testpmd quits with two ports, the second port's MAC address remains in the MAC table of switch manager. There should be some time for HW to quiesce when closing a port, otherwise the subsequent port close won't be handled correctly. This patch adds some delay after turning off a logic port, just as what the kernel driver does. Fixes: 8b5c9ec20b7b ("support VMDQ in MAC/VLAN filter") Reported-by: Xueqin Lin Signed-off-by: Xiao Wang --- drivers/net/fm10k/fm10k_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 01f4a72..89d99d4 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -52,6 +52,8 @@ #define MAX_QUERY_SWITCH_STATE_TIMES 10 /* Wait interval to get switch status */ #define WAIT_SWITCH_MSG_US 100000 +/* A period of quiescence for switch */ +#define FM10K_SWITCH_QUIESCE_US 10000 /* Number of chars per uint32 type */ #define CHARS_PER_UINT32 (sizeof(uint32_t)) #define BIT_MASK_PER_UINT32 ((1 << CHARS_PER_UINT32) - 1) @@ -1233,6 +1235,9 @@ fm10k_dev_close(struct rte_eth_dev *dev) MAX_LPORT_NUM, false); fm10k_mbx_unlock(hw); + /* allow 10ms for device to quiesce */ + rte_delay_us(FM10K_SWITCH_QUIESCE_US); + /* Stop mailbox service first */ fm10k_close_mbx_service(hw); fm10k_dev_stop(dev); -- 1.9.3