net/iavf: fix high CPU usage on frequent command
authorQiming Chen <chenqiming_huawei@163.com>
Sat, 11 Sep 2021 04:02:21 +0000 (12:02 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 24 Sep 2021 05:44:37 +0000 (07:44 +0200)
commitde5bef335eeac3a0b1e29eb2c5fabbcadb9549eb
tree6ffe9452aad092ea0422f6b13b3e9085bfba08dd
parentdb48aaa2340047e6fbadbe0db9a76ff712e86ec4
net/iavf: fix high CPU usage on frequent command

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")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_vchnl.c