net/axgbe: save segment data in scattered Rx

Saving the current segments of the packet, when the next segment data is
not ready.

Fixes: 965b3127d4 ("net/axgbe: support scattered Rx")
Cc: stable@dpdk.org

Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
This commit is contained in:
Bhagyada Modali 2022-09-07 23:31:09 -04:00 committed by Ferruh Yigit
parent 30ff4d00d9
commit 91907ec247
2 changed files with 16 additions and 0 deletions

View File

@ -416,11 +416,17 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
mbuf->data_len = data_len;
mbuf->pkt_len = data_len;
if (rxq->saved_mbuf) {
first_seg = rxq->saved_mbuf;
rxq->saved_mbuf = NULL;
}
if (first_seg != NULL) {
if (rte_pktmbuf_chain(first_seg, mbuf) != 0) {
rte_pktmbuf_free(first_seg);
first_seg = NULL;
rte_pktmbuf_free(mbuf);
rxq->saved_mbuf = NULL;
rxq->errors++;
eop = 0;
break;
@ -499,6 +505,10 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
first_seg = NULL;
}
/* Check if we need to save state before leaving */
if (first_seg != NULL && eop == 0)
rxq->saved_mbuf = first_seg;
/* Save receive context.*/
rxq->pkts += nb_rx;

View File

@ -65,6 +65,12 @@ struct axgbe_rx_queue {
uint16_t crc_len;
/* address of s/w rx buffers */
struct rte_mbuf **sw_ring;
/* For segemented packets - save the current state
* of packet, if next descriptor is not ready yet
*/
struct rte_mbuf *saved_mbuf;
/* Port private data */
struct axgbe_port *pdata;
/* Number of Rx descriptors in queue */