* [PATCH net] gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup
@ 2024-12-21 3:28 Praveen Kaligineedi
2024-12-31 1:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Praveen Kaligineedi @ 2024-12-21 3:28 UTC (permalink / raw)
To: netdev
Cc: jeroendb, shailend, willemb, andrew+netdev, davem, edumazet, kuba,
pabeni, ast, daniel, hawk, john.fastabend, hramamurthy, joshwash,
ziweixiao, linux-kernel, bpf, stable, Praveen Kaligineedi
From: Joshua Washington <joshwash@google.com>
Commit ba0925c34e0f ("gve: process XSK TX descriptors as part of RX NAPI")
moved XSK TX processing to be part of the RX NAPI. However, that commit
did not include triggering the RX NAPI in gve_xsk_wakeup. This is
necessary because the TX NAPI only processes TX completions, meaning
that a TX wakeup would not actually trigger XSK descriptor processing.
Also, the branch on XDP_WAKEUP_TX was supposed to have been removed, as
the NAPI should be scheduled whether the wakeup is for RX or TX.
Fixes: ba0925c34e0f ("gve: process XSK TX descriptors as part of RX NAPI")
Cc: stable@vger.kernel.org
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Praveen Kaligineedi <pkaligineedi@google.com>
---
drivers/net/ethernet/google/gve/gve_main.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 09fb7f16f73e..8a8f6ab12a98 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -1714,7 +1714,7 @@ static int gve_xsk_pool_disable(struct net_device *dev,
static int gve_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
{
struct gve_priv *priv = netdev_priv(dev);
- int tx_queue_id = gve_xdp_tx_queue_id(priv, queue_id);
+ struct napi_struct *napi;
if (!gve_get_napi_enabled(priv))
return -ENETDOWN;
@@ -1722,19 +1722,12 @@ static int gve_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
if (queue_id >= priv->rx_cfg.num_queues || !priv->xdp_prog)
return -EINVAL;
- if (flags & XDP_WAKEUP_TX) {
- struct gve_tx_ring *tx = &priv->tx[tx_queue_id];
- struct napi_struct *napi =
- &priv->ntfy_blocks[tx->ntfy_id].napi;
-
- if (!napi_if_scheduled_mark_missed(napi)) {
- /* Call local_bh_enable to trigger SoftIRQ processing */
- local_bh_disable();
- napi_schedule(napi);
- local_bh_enable();
- }
-
- tx->xdp_xsk_wakeup++;
+ napi = &priv->ntfy_blocks[gve_rx_idx_to_ntfy(priv, queue_id)].napi;
+ if (!napi_if_scheduled_mark_missed(napi)) {
+ /* Call local_bh_enable to trigger SoftIRQ processing */
+ local_bh_disable();
+ napi_schedule(napi);
+ local_bh_enable();
}
return 0;
--
2.47.1.613.gc27f4b7a9f-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup
2024-12-21 3:28 [PATCH net] gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup Praveen Kaligineedi
@ 2024-12-31 1:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-31 1:50 UTC (permalink / raw)
To: Praveen Kaligineedi
Cc: netdev, jeroendb, shailend, willemb, andrew+netdev, davem,
edumazet, kuba, pabeni, ast, daniel, hawk, john.fastabend,
hramamurthy, joshwash, ziweixiao, linux-kernel, bpf, stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 20 Dec 2024 19:28:06 -0800 you wrote:
> From: Joshua Washington <joshwash@google.com>
>
> Commit ba0925c34e0f ("gve: process XSK TX descriptors as part of RX NAPI")
> moved XSK TX processing to be part of the RX NAPI. However, that commit
> did not include triggering the RX NAPI in gve_xsk_wakeup. This is
> necessary because the TX NAPI only processes TX completions, meaning
> that a TX wakeup would not actually trigger XSK descriptor processing.
> Also, the branch on XDP_WAKEUP_TX was supposed to have been removed, as
> the NAPI should be scheduled whether the wakeup is for RX or TX.
>
> [...]
Here is the summary with links:
- [net] gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup
https://git.kernel.org/netdev/net/c/fb3a9a1165ce
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-31 1:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-21 3:28 [PATCH net] gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup Praveen Kaligineedi
2024-12-31 1:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).