Skip to content

Commit

Permalink
net/axgbe: clear buffer on scattered Rx chaining failure
Browse files Browse the repository at this point in the history
[ upstream commit 30ff4d0 ]

Clearing mbuf, first_seg when chaining mbufs fail.
Increment the error count for the same.

Fixes: 965b312 ("net/axgbe: support scattered Rx")

Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
  • Loading branch information
BhagyadaM authored and kevintraynor committed Oct 11, 2022
1 parent 18895ee commit 9683271
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/axgbe/axgbe_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,

if (first_seg != NULL) {
if (rte_pktmbuf_chain(first_seg, mbuf) != 0) {
rte_mempool_put(rxq->mb_pool,
first_seg);
rte_pktmbuf_free(first_seg);
first_seg = NULL;
rte_pktmbuf_free(mbuf);
rxq->errors++;
eop = 0;
break;
}
Expand Down

0 comments on commit 9683271

Please sign in to comment.