* [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch
@ 2016-08-05 3:17 Xiao Wang
2016-08-05 5:52 ` Chen, Jing D
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Wang @ 2016-08-05 3:17 UTC (permalink / raw)
To: jing.d.chen, xueqin.lin; +Cc: dev, Xiao Wang
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 <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch
2016-08-05 3:17 [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch Xiao Wang
@ 2016-08-05 5:52 ` Chen, Jing D
2016-09-21 11:14 ` Bruce Richardson
0 siblings, 1 reply; 3+ messages in thread
From: Chen, Jing D @ 2016-08-05 5:52 UTC (permalink / raw)
To: Wang, Xiao W, Lin, Xueqin; +Cc: dev
Hi,
> -----Original Message-----
> From: Wang, Xiao W
> Sent: Friday, August 05, 2016 11:18 AM
> To: Chen, Jing D <jing.d.chen@intel.com>; Lin, Xueqin <xueqin.lin@intel.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
> Subject: [PATCH] net/fm10k: fix MAC address remnant in switch
>
> 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 <xueqin.lin@intel.com>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by : Jing Chen <jing.d.chen@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch
2016-08-05 5:52 ` Chen, Jing D
@ 2016-09-21 11:14 ` Bruce Richardson
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2016-09-21 11:14 UTC (permalink / raw)
To: Chen, Jing D; +Cc: Wang, Xiao W, Lin, Xueqin, dev
On Fri, Aug 05, 2016 at 05:52:51AM +0000, Chen, Jing D wrote:
> Hi,
>
> > -----Original Message-----
> > From: Wang, Xiao W
> > Sent: Friday, August 05, 2016 11:18 AM
> > To: Chen, Jing D <jing.d.chen@intel.com>; Lin, Xueqin <xueqin.lin@intel.com>
> > Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
> > Subject: [PATCH] net/fm10k: fix MAC address remnant in switch
> >
> > 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 <xueqin.lin@intel.com>
> > Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> Acked-by : Jing Chen <jing.d.chen@intel.com>
>
Applied to dpdk-next-net/rel_16_11
/Bruce
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-21 11:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 3:17 [dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch Xiao Wang
2016-08-05 5:52 ` Chen, Jing D
2016-09-21 11:14 ` Bruce Richardson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).