Skip to content

Commit fb3a9a1

Browse files
josh8551021kuba-moo
authored andcommitted
gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup
Commit ba0925c ("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: ba0925c ("gve: process XSK TX descriptors as part of RX NAPI") Cc: [email protected] Signed-off-by: Joshua Washington <[email protected]> Signed-off-by: Praveen Kaligineedi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b255ef4 commit fb3a9a1

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,27 +1714,20 @@ static int gve_xsk_pool_disable(struct net_device *dev,
17141714
static int gve_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
17151715
{
17161716
struct gve_priv *priv = netdev_priv(dev);
1717-
int tx_queue_id = gve_xdp_tx_queue_id(priv, queue_id);
1717+
struct napi_struct *napi;
17181718

17191719
if (!gve_get_napi_enabled(priv))
17201720
return -ENETDOWN;
17211721

17221722
if (queue_id >= priv->rx_cfg.num_queues || !priv->xdp_prog)
17231723
return -EINVAL;
17241724

1725-
if (flags & XDP_WAKEUP_TX) {
1726-
struct gve_tx_ring *tx = &priv->tx[tx_queue_id];
1727-
struct napi_struct *napi =
1728-
&priv->ntfy_blocks[tx->ntfy_id].napi;
1729-
1730-
if (!napi_if_scheduled_mark_missed(napi)) {
1731-
/* Call local_bh_enable to trigger SoftIRQ processing */
1732-
local_bh_disable();
1733-
napi_schedule(napi);
1734-
local_bh_enable();
1735-
}
1736-
1737-
tx->xdp_xsk_wakeup++;
1725+
napi = &priv->ntfy_blocks[gve_rx_idx_to_ntfy(priv, queue_id)].napi;
1726+
if (!napi_if_scheduled_mark_missed(napi)) {
1727+
/* Call local_bh_enable to trigger SoftIRQ processing */
1728+
local_bh_disable();
1729+
napi_schedule(napi);
1730+
local_bh_enable();
17381731
}
17391732

17401733
return 0;

0 commit comments

Comments
 (0)