From: Xiao Wang Date: Fri, 5 Aug 2016 03:17:43 +0000 (+0800) Subject: net/fm10k: fix MAC address removal from switch X-Git-Tag: spdx-start~5837 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b961fe9344ddfb7909b80376e29add4728381f85;p=dpdk.git net/fm10k: fix MAC address removal from switch When testpmd quits with two ports, the second port's MAC address remains in the MAC table of switch manager. There needs to be some time for HW to quiesce when closing a port, otherwise a subsequent port close won't be handled correctly. This patch adds a delay after turning off a logic port, just as the kernel driver does. Fixes: 8b5c9ec20b7b ("fm10k: support VMDQ in MAC/VLAN filter") Reported-by: Xueqin Lin Signed-off-by: Xiao Wang Acked-by: Jing Chen --- diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index ed666c102b..372564bc0a 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);