Skip to contentSkip to conversation

net/af_xdp: fix redundant check for NEED WAKEUP

PATCH Applied Xiao Wang 3 participants 3 messages Jan 6, 2020 – Jan 10, 2020 Network drivers

lore
Share & tools
lore

Xiao Wang

author
#0 lore raw

PATCH 1/1 net/af_xdp: fix redundant check for NEED WAKEUP

Function kick_tx() has built-in detection on NEED_WAKEUP flag, so just call it directly, like elsewhere in the driver.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -4
index 2b1245ee4..d903e6c28 100644
@@ -480,10 +480,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		tx_bytes += mbuf->pkt_len;
 	}
 
-#if defined(XDP_USE_NEED_WAKEUP)
-	if (xsk_ring_prod__needs_wakeup(&txq->tx))
-#endif
-		kick_tx(txq);
+	kick_tx(txq);
 
 out:
 	xsk_ring_prod__submit(&txq->tx, count);
Signature · 1 line
2.15.1
Tested-by on v1 1/1
#1 lore raw
Quoted 29 lines

Function kick_tx() has built-in detection on NEED_WAKEUP flag, so just call it directly, like elsewhere in the driver.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -4
index 2b1245ee4..d903e6c28 100644
@@ -480,10 +480,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs,
 uint16_t nb_pkts)
 		tx_bytes += mbuf->pkt_len;
 	}
 
-#if defined(XDP_USE_NEED_WAKEUP)
-	if (xsk_ring_prod__needs_wakeup(&txq->tx))
-#endif
-		kick_tx(txq);
+	kick_tx(txq);
 
 out:
Quoted 3 lines

xsk_ring_prod__submit(&txq->tx, count);
--
2.15.1

Thanks for the patch.

Applied
#2 lore raw
Quoted 36 lines · Ciara
Quoted 29 lines

Function kick_tx() has built-in detection on NEED_WAKEUP flag, so just call it directly, like elsewhere in the driver.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -4
index 2b1245ee4..d903e6c28 100644
@@ -480,10 +480,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs,
 uint16_t nb_pkts)
 		tx_bytes += mbuf->pkt_len;
 	}
 
-#if defined(XDP_USE_NEED_WAKEUP)
-	if (xsk_ring_prod__needs_wakeup(&txq->tx))
-#endif
-		kick_tx(txq);
+	kick_tx(txq);
 
 out:
Quoted 3 lines

xsk_ring_prod__submit(&txq->tx, count);
--
2.15.1

Thanks for the patch.

Quoted 2 lines

Applied to dpdk-next-net/master, thanks.