Skip to content

Commit

Permalink
net/af_xdp: fix error handling during Rx queue setup
Browse files Browse the repository at this point in the history
[ upstream commit 8312680 ]

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: d8a2107 ("net/af_xdp: support unaligned umem chunks")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
  • Loading branch information
cloftus authored and cpaelzer committed May 11, 2021
1 parent 540aba6 commit eed2d4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/af_xdp/rte_eth_af_xdp.c
Expand Up @@ -899,7 +899,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;
}
Expand Down

0 comments on commit eed2d4c

Please sign in to comment.