diff options
| author | Michal Schmidt <[email protected]> | 2024-09-30 20:13:04 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-10-04 16:25:14 +0000 |
| commit | b8db67d4df0022e3595263b542953c251f4ccf06 (patch) | |
| tree | 83348ac4af067d53c04400a59ba571dbd3b8cb64 /drivers/net/ethernet/qlogic/qed/qed_debug.c | |
| parent | Merge branch 'net-mv643xx-devm-fixes' (diff) | |
| download | kernel-b8db67d4df0022e3595263b542953c251f4ccf06.tar.gz kernel-b8db67d4df0022e3595263b542953c251f4ccf06.zip | |
qed: make 'ethtool -d' 10 times faster
As a side effect of commit 5401c3e09928 ("qed: allow sleep in
qed_mcp_trace_dump()"), 'ethtool -d' became much slower.
Almost all the time is spent collecting the "mcp_trace".
It is caused by sleeping too long in _qed_mcp_cmd_and_union.
When called with sleeping not allowed, the function delays for 10 µs
between firmware polls. But if sleeping is allowed, it sleeps for 10 ms
instead.
The sleeps in _qed_mcp_cmd_and_union are unnecessarily long.
Replace msleep with usleep_range, which allows to achieve a similar
polling interval like in the no-sleeping mode (10 - 20 µs).
The only caller, qed_mcp_cmd_and_union, can stop doing the
multiplication/division of the usecs/max_retries. The polling interval
and the number of retries do not need to be parameters at all.
On my test system, 'ethtool -d' now takes 4 seconds instead of 44.
Signed-off-by: Michal Schmidt <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_debug.c')
0 files changed, 0 insertions, 0 deletions
