Skip to contentSkip to conversation

fm10k: fix switch manager high CPU usage

PATCH Superseded Shaopeng He 3 participants 8 messages Jan 28, 2016 – Feb 25, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

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
index e4aed94..f6eb05d 100644
@@ -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
#1 lore raw

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 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.

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.

---
 drivers/net/fm10k/fm10k_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
index e4aed94..f6eb05d 100644
@@ -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

#2 lore raw

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 usage

Hi,

Best Regards,
Mark

Quoted 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.

---
 drivers/net/fm10k/fm10k_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
index e4aed94..f6eb05d 100644
@@ -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

#3 lore raw

PATCH v2 1/1 fm10k: fix switch manager high CPU usage

In reply to Shaopeng He

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.

---
 drivers/net/fm10k/fm10k_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/fm10k/fm10k_ethdev.c +3 -0
index e4aed94..f6eb05d 100644
@@ -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
#4 lore raw

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.

Fixes 9ae6068c ("fm10k: add dev start/stop")

---
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
index e4aed94..f6eb05d 100644
@@ -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
Acked-by on v2 1/1
#7 lore raw
In reply to Shaopeng He

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 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.

Quoted 1 line
Acked-by on v3 1/1
#5 lore raw
In reply to Shaopeng He

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 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.

Quoted 3 lines
Fixes 9ae6068c ("fm10k: add dev start/stop")
#6 lore raw
Quoted 30 lines · Jing D

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 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.

Quoted 4 lines
Quoted 3 lines
Fixes 9ae6068c ("fm10k: add dev start/stop")

Applied to dpdk-next-net/rel_16_04

Thanks,
/Bruce