Skip to contentSkip to conversation

net/af_xdp: change return value from Rx to unsigned

PATCH Applied Ciara Loftus 2 participants 3 messages Aug 7, 2020 – Sep 1, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/af_xdp: change return value from Rx to unsigned

The af_xdp rx function was returning a negative value on error, when an unsigned value is expected. Fix this.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
index 936d4a7d5f..7ce4ad04af 100644
@@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
 		AF_XDP_LOG(DEBUG,
 			"Failed to get enough buffers for fq.\n");
-		return -1;
+		return 0;
 	}
 
 	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Ciara Loftus

The af_xdp rx function was returning a negative value on error, when an unsigned value is expected. Fix this.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +0 -0
index 936d4a7d5f..7ce4ad04af 100644

drivers/net/af_xdp/rte_eth_af_xdp.c af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) · line 242

Quoted 8 lines
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
 		AF_XDP_LOG(DEBUG,
 			"Failed to get enough buffers for fq.\n");
-		return -1;
+		return 0;
 	}
 
 	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
Applied
#2 lore raw
Quoted 24 lines · Ferruh Yigit
Quoted 23 lines · Ciara Loftus

The af_xdp rx function was returning a negative value on error, when an unsigned value is expected. Fix this.

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
index 936d4a7d5f..7ce4ad04af 100644
@@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
 		AF_XDP_LOG(DEBUG,
 			"Failed to get enough buffers for fq.\n");
-		return -1;
+		return 0;
 	}
 
Quoted 5 lines

drivers/net/af_xdp/rte_eth_af_xdp.c af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) · line 242

Quoted 2 lines
drivers/net/af_xdp/rte_eth_af_xdp.c +0 -0
 	rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);

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