diff options
author | Alexander Duyck <alexanderduyck@fb.com> | 2025-05-06 08:59:59 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-05-08 11:33:30 +0200 |
commit | 0f9a959a0addd9bbc47e5d16c36b3a7f97981915 (patch) | |
tree | fb14789d1e24dfae90e3073ba0c8698cfe8fdaa7 /scripts/generate_rust_analyzer.py | |
parent | 682a61281d1036962b68d651994cc407371daef5 (diff) | |
download | linux-0f9a959a0addd9bbc47e5d16c36b3a7f97981915.tar.gz linux-0f9a959a0addd9bbc47e5d16c36b3a7f97981915.tar.bz2 linux-0f9a959a0addd9bbc47e5d16c36b3a7f97981915.zip |
fbnic: Actually flush_tx instead of stalling out
The fbnic_mbx_flush_tx function had a number of issues.
First, we were waiting 200ms for the firmware to process the packets. We
can drop this to 20ms and in almost all cases this should be more than
enough time. So by changing this we can significantly reduce shutdown time.
Second, we were not making sure that the Tx path was actually shut off. As
such we could still have packets added while we were flushing the mailbox.
To prevent that we can now clear the ready flag for the Tx side and it
should stay down since the interrupt is disabled.
Third, we kept re-reading the tail due to the second issue. The tail should
not move after we have started the flush so we can just read it once while
we are holding the mailbox Tx lock. By doing that we are guaranteed that
the value should be consistent.
Fourth, we were keeping a count of descriptors cleaned due to the second
and third issues called out. That count is not a valid reason to be exiting
the cleanup, and with the tail only being read once we shouldn't see any
cases where the tail moves after the disable so the tracking of count can
be dropped.
Fifth, we were using attempts * sleep time to determine how long we would
wait in our polling loop to flush out the Tx. This can be very imprecise.
In order to tighten up the timing we are shifting over to using a jiffies
value of jiffies + 10 * HZ + 1 to determine the jiffies value we should
stop polling at as this should be accurate within once sleep cycle for the
total amount of time spent polling.
Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654719929.499179.16406653096197423749.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions