[dpdk-stable] patch 'net/iavf: fix high CPU usage on frequent command' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:36 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/1900a185181403d1c08a72ef25cd80ea97df139c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1900a185181403d1c08a72ef25cd80ea97df139c Mon Sep 17 00:00:00 2001
From: Qiming Chen <chenqiming_huawei at 163.com>
Date: Sat, 11 Sep 2021 12:02:21 +0800
Subject: [PATCH] net/iavf: fix high CPU usage on frequent command
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb ]

There is currently a scenario test, which will continuously obtain port
statistics, causing the CPU usage to soar, which does not meet the
demand. After positioning analysis, it is found that the VF and PF
command interaction is completed through the iavf_execute_vf_cmd
function.
After the message is sent, it needs to wait for the interrupt thread to
obtain the response from the PF. For the data, the rte_delay_ms
interface is used here to wait, but the CPU will not be released during
the waiting period of this interface, which will cause the statistics to
keep occupying the CPU. This is also the root cause of the soaring CPU.

The command interaction should belong to the control plane, and there
will not be too high requirements for performance. It is recommended to
wait for the interface iavf_msec_delay to complete without taking up the
CPU time.

Fixes: 22b123a36d07 ("net/avf: initialize PMD")

Signed-off-by: Qiming Chen <chenqiming_huawei at 163.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 1021108ff5..00f868b3c7 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -180,7 +180,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 						   args->out_buffer);
 			if (result == IAVF_MSG_CMD)
 				break;
-			rte_delay_ms(ASQ_DELAY_MS);
+			iavf_msec_delay(ASQ_DELAY_MS);
 		} while (i++ < MAX_TRY_TIMES);
 		if (i >= MAX_TRY_TIMES ||
 		    vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
@@ -206,7 +206,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 				err = -1;
 				break;
 			}
-			rte_delay_ms(ASQ_DELAY_MS);
+			iavf_msec_delay(ASQ_DELAY_MS);
 			/* If don't read msg or read sys event, continue */
 		} while (i++ < MAX_TRY_TIMES);
 		if (i >= MAX_TRY_TIMES ||
@@ -224,7 +224,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 		do {
 			if (vf->pend_cmd == VIRTCHNL_OP_UNKNOWN)
 				break;
-			rte_delay_ms(ASQ_DELAY_MS);
+			iavf_msec_delay(ASQ_DELAY_MS);
 			/* If don't read msg or read sys event, continue */
 		} while (i++ < MAX_TRY_TIMES);
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:06.117468053 +0800
+++ 0092-net-iavf-fix-high-CPU-usage-on-frequent-command.patch	2021-11-10 14:17:01.850746254 +0800
@@ -1 +1 @@
-From de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb Mon Sep 17 00:00:00 2001
+From 1900a185181403d1c08a72ef25cd80ea97df139c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb ]
@@ -23 +25,0 @@
-Cc: stable at dpdk.org
@@ -32 +34 @@
-index 050e5f7232..3275687927 100644
+index 1021108ff5..00f868b3c7 100644
@@ -35 +37 @@
-@@ -182,7 +182,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
+@@ -180,7 +180,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
@@ -44 +46 @@
-@@ -208,7 +208,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
+@@ -206,7 +206,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
@@ -53 +55 @@
-@@ -226,7 +226,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
+@@ -224,7 +224,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)


More information about the stable mailing list