From: Simon Horman <horms@kernel.org>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com
Subject: Re: [net PATCH 4/6] fbnic: Actually flush_tx instead of stalling out
Date: Fri, 2 May 2025 11:54:20 +0100 [thread overview]
Message-ID: <20250502105420.GK3339421@horms.kernel.org> (raw)
In-Reply-To: <174614221649.126317.7015369906157925744.stgit@ahduyck-xeon-server.home.arpa>
On Thu, May 01, 2025 at 04:30:16PM -0700, Alexander Duyck wrote:
> From: Alexander Duyck <alexanderduyck@fb.com>
>
> 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")
nit: No blank line here
>
> Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
The nit above aside, this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-05-02 10:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 23:29 [net PATCH 0/6] fbnic: FW IPC Mailbox fixes Alexander Duyck
2025-05-01 23:29 ` [net PATCH 1/6] fbnic: Fix initialization of mailbox descriptor rings Alexander Duyck
2025-05-02 10:49 ` Simon Horman
2025-05-01 23:30 ` [net PATCH 2/6] fbnic: Gate AXI read/write enabling on FW mailbox Alexander Duyck
2025-05-02 10:50 ` Simon Horman
2025-05-01 23:30 ` [net PATCH 3/6] fbnic: Add additional handling of IRQs Alexander Duyck
2025-05-02 13:51 ` Simon Horman
2025-05-01 23:30 ` [net PATCH 4/6] fbnic: Actually flush_tx instead of stalling out Alexander Duyck
2025-05-02 10:54 ` Simon Horman [this message]
2025-05-01 23:30 ` [net PATCH 5/6] fbnic: Cleanup handling of completions Alexander Duyck
2025-05-02 10:45 ` Simon Horman
2025-05-04 14:37 ` Alexander Duyck
2025-05-01 23:30 ` [net PATCH 6/6] fbnic: Pull fbnic_fw_xmit_cap_msg use out of interrupt context Alexander Duyck
2025-05-02 16:54 ` Simon Horman
2025-05-04 14:53 ` Alexander Duyck
2025-05-06 15:50 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250502105420.GK3339421@horms.kernel.org \
--to=horms@kernel.org \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.