From: Xiaolong Ye Date: Wed, 17 Apr 2019 13:49:43 +0000 (+0800) Subject: net/af_xdp: enqueue buf ring when allocate Tx queue fails X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f57ea89c6967b9fa62fa156af97956798d24960c;p=dpdk.git net/af_xdp: enqueue buf ring when allocate Tx queue fails When it fails to allocate enough slots in Tx queue for transmitting packets, we need to return the dequeued addrs to buf ring. Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") Signed-off-by: Xiaolong Ye Reviewed-by: David Marchand --- diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 007a1c6b48..5cc643ce22 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -276,6 +276,7 @@ eth_af_xdp_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (xsk_ring_prod__reserve(&txq->tx, nb_pkts, &idx_tx) != nb_pkts) { kick_tx(txq); + rte_ring_enqueue_bulk(umem->buf_ring, addrs, nb_pkts, NULL); return 0; }