fm10k: fix switch manager high CPU usage
PATCH 1/1 fm10k: fix switch manager high CPU usage
fm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager, and cause high CPU usage.
This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
--- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
@@ -675,6 +675,9 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)FM10K_WRITE_REG (hw,FM10K_TDBAH (i), base_addr >> (CHAR_BIT *sizeof (uint32_t )));FM10K_WRITE_REG (hw,FM10K_TDLEN (i), size); + +/* assign default SGLORT for each TX queue */ +FM10K_WRITE_REG (hw,FM10K_TX_SGLORT (i), hw->mac.dglort_map); }/* set up vector or scalar TX function as appropriate */
Signature · 1 line
1.9.3
Hi,
Best Regards,
Mark
Quoted 11 lines
-----Original Message-----
From: He, Shaopeng
Sent: Thursday, January 28, 2016 1:47 PM
To: [email protected]
Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
Subject: [PATCH] fm10k: fix switch manager high CPU usagefm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager, and cause high CPU usage.
Above paragraph didn't describe the bug clearly. Can you add more Words on it?
Quoted 30 lines
This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
Signed-off-by Shaopeng He <[email protected]>--- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/fm10k/fm10k_ethdev.c +3
-0@@ -675,6 +675,9 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)FM10K_WRITE_REG (hw,FM10K_TDBAH (i), base_addr >> (CHAR_BIT *sizeof (uint32_t )));FM10K_WRITE_REG (hw,FM10K_TDLEN (i), size); + +/* assign default SGLORT for each TX queue */ +FM10K_WRITE_REG (hw,FM10K_TX_SGLORT (i), hw- >mac.dglort_map); }/* set up vector or scalar TX function as appropriate */
--
1.9.3
Hi Mark,
Quoted 21 lines
-----Original Message-----
From: Chen, Jing D
Sent: Wednesday, February 03, 2016 3:23 PM
To: He, Shaopeng; [email protected]
Cc: Wang, Xiao W
Subject: RE: [PATCH] fm10k: fix switch manager high CPU usageHi,
Best Regards,
MarkQuoted 7 lines
-----Original Message-----
From: He, Shaopeng
Sent: Thursday, January 28, 2016 1:47 PM
To: [email protected]
Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
Subject: [PATCH] fm10k: fix switch manager high CPU usage
Quoted 6 lines
Quoted 3 lines
fm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager, and cause high CPU usage.
Above paragraph didn't describe the bug clearly. Can you add more Words on it?
Thanks for the comments, I will send a v2.
Quoted 30 lines
Quoted 30 lines
This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g.
different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.Signed-off-by Shaopeng He <[email protected]>--- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/fm10k/fm10k_ethdev.c +3
-0@@ -675,6 +675,9 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)FM10K_WRITE_REG (hw,FM10K_TDBAH (i), base_addr >> (CHAR_BIT *sizeof (uint32_t )));FM10K_WRITE_REG (hw,FM10K_TDLEN (i), size); + +/* assign default SGLORT for each TX queue */ +FM10K_WRITE_REG (hw,FM10K_TX_SGLORT (i), hw- >mac.dglort_map); }/* set up vector or scalar TX function as appropriate */
--
1.9.3
PATCH v2 1/1 fm10k: fix switch manager high CPU usage
In reply to Shaopeng Hefm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager. Too much of this kind of exception interrupts cause switch manager side high CPU usage.
To reproduce this issue, one DPDK testpmd runs on a server with one fm10k NIC, mac forwards test traffic from one of fm10k ports to another port. The CPU usage for the switch manager will go up to about 20% for test traffic rate at 10G bps, comparing to near 0% for no test traffic. This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
--- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
@@ -675,6 +675,9 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)FM10K_WRITE_REG (hw,FM10K_TDBAH (i), base_addr >> (CHAR_BIT *sizeof (uint32_t )));FM10K_WRITE_REG (hw,FM10K_TDLEN (i), size); + +/* assign default SGLORT for each TX queue */ +FM10K_WRITE_REG (hw,FM10K_TX_SGLORT (i), hw->mac.dglort_map); }/* set up vector or scalar TX function as appropriate */
Signature · 1 line
1.9.3
PATCH v3 1/1 fm10k: fix switch manager high CPU usage
fm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager. Too much of this kind of exception interrupts cause switch manager side high CPU usage.
To reproduce this issue, one DPDK testpmd runs on a server with one fm10k NIC, mac forwards test traffic from one of fm10k ports to another port. The CPU usage for the switch manager will go up to about 20% for test traffic rate at 10G bps, comparing to near 0% for no test traffic. This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
---
v3: - add fixes line
v2: - reword the commit log message
--- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
@@ -675,6 +675,9 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)FM10K_WRITE_REG (hw,FM10K_TDBAH (i), base_addr >> (CHAR_BIT *sizeof (uint32_t )));FM10K_WRITE_REG (hw,FM10K_TDLEN (i), size); + +/* assign default SGLORT for each TX queue */ +FM10K_WRITE_REG (hw,FM10K_TX_SGLORT (i), hw->mac.dglort_map); }/* set up vector or scalar TX function as appropriate */
Signature · 1 line
1.9.3
Hi,
Best Regards,
Mark
Quoted 24 lines
-----Original Message-----
From: He, Shaopeng
Sent: Thursday, February 04, 2016 8:45 PM
To: [email protected]
Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
Subject: [PATCH v2] fm10k: fix switch manager high CPU usagefm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager. Too much of this kind of exception interrupts cause switch manager side high CPU usage.
To reproduce this issue, one DPDK testpmd runs on a server with one fm10k NIC, mac forwards test traffic from one of fm10k ports to another port. The CPU usage for the switch manager will go up to about 20% for test traffic rate at 10G bps, comparing to near 0% for no test traffic. This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
Quoted 1 line
Signed-off-by Shaopeng He <[email protected]>
Hi,
Best Regards,
Mark
Quoted 24 lines
-----Original Message-----
From: He, Shaopeng
Sent: Friday, February 05, 2016 10:46 AM
To: [email protected]
Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
Subject: [PATCH v3] fm10k: fix switch manager high CPU usagefm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager. Too much of this kind of exception interrupts cause switch manager side high CPU usage.
To reproduce this issue, one DPDK testpmd runs on a server with one fm10k NIC, mac forwards test traffic from one of fm10k ports to another port. The CPU usage for the switch manager will go up to about 20% for test traffic rate at 10G bps, comparing to near 0% for no test traffic. This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
Quoted 3 lines
Fixes 9ae6068c ("fm10k: add dev start/stop")Signed-off-by Shaopeng He <[email protected]>
Bruce Richardson
AppliedQuoted 30 lines · Jing D
Hi,
Best Regards,
MarkQuoted 24 lines
-----Original Message-----
From: He, Shaopeng
Sent: Friday, February 05, 2016 10:46 AM
To: [email protected]
Cc: Chen, Jing D; Wang, Xiao W; He, Shaopeng
Subject: [PATCH v3] fm10k: fix switch manager high CPU usagefm10k switch core uses source MAC + VID + SGLORT to do look up in MAC table. If no match, an exception interrupt will be sent to the switch manager. Too much of this kind of exception interrupts cause switch manager side high CPU usage.
To reproduce this issue, one DPDK testpmd runs on a server with one fm10k NIC, mac forwards test traffic from one of fm10k ports to another port. The CPU usage for the switch manager will go up to about 20% for test traffic rate at 10G bps, comparing to near 0% for no test traffic. This patch fixes this issue. A default SGLORT is assigned to each TX queue. This default value works for non-VMDq mode and current VMDq example. For advanced VMDq usage, e.g. different source MAC address for different TX queue, FTAG forwarding function could be used to change this default SGLORT value.
Quoted 4 lines
Quoted 3 lines
Fixes 9ae6068c ("fm10k: add dev start/stop")Signed-off-by Shaopeng He <[email protected]>Acked-by Jing Chen <[email protected]>
Applied to dpdk-next-net/rel_16_04
Thanks,
/Bruce