Skip to contentSkip to conversation

net/af_xdp: fix error handling during Rx queue setup

PATCH Applied Ciara Loftus 2 participants 2 messages Mar 1, 2021 – Mar 2, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/af_xdp: fix error handling during Rx queue setup

Prior to this commit, if rte_pktmbuf_alloc_bullk failed during rx queue setup the error was not returned to the user and they may incorrectly assume that the rx queue had been successfully set up. This commit ensures that the error is returned to the user.

Bugzilla ID: 643

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +2 -1
index b8d5ad0d91..3957227bf0 100644
@@ -1145,7 +1145,8 @@ xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq,
 	}
 
 #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
-	if (rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size)) {
+	ret = rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size);
+	if (ret) {
 		AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n");
 		goto err;
 	}
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 10 lines · Ciara Loftus

Prior to this commit, if rte_pktmbuf_alloc_bullk failed during rx queue setup the error was not returned to the user and they may incorrectly assume that the rx queue had been successfully set up. This commit ensures that the error is returned to the user.

Bugzilla ID: 643

Fixes d8a210774e1d ("net/af_xdp: support unaligned umem chunks")

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