Skip to content

Commit a817ead

Browse files
mfijalkoborkmann
authored andcommitted
stmmac, xsk: Diversify return values from xsk_wakeup call paths
Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIOs in stmmac's ndo_xsk_wakeup() implementation to EINVALs, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 7b7f2f2 commit a817ead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6565,7 +6565,7 @@ int stmmac_xsk_wakeup(struct net_device *dev, u32 queue, u32 flags)
65656565
return -ENETDOWN;
65666566

65676567
if (!stmmac_xdp_is_enabled(priv))
6568-
return -ENXIO;
6568+
return -EINVAL;
65696569

65706570
if (queue >= priv->plat->rx_queues_to_use ||
65716571
queue >= priv->plat->tx_queues_to_use)
@@ -6576,7 +6576,7 @@ int stmmac_xsk_wakeup(struct net_device *dev, u32 queue, u32 flags)
65766576
ch = &priv->channel[queue];
65776577

65786578
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
6579-
return -ENXIO;
6579+
return -EINVAL;
65806580

65816581
if (!napi_if_scheduled_mark_missed(&ch->rxtx_napi)) {
65826582
/* EQoS does not have per-DMA channel SW interrupt,

0 commit comments

Comments
 (0)