Skip to content

Commit

Permalink
net/axgbe: reset end of packet in scattered Rx
Browse files Browse the repository at this point in the history
[ upstream commit 2a761ae ]

Reset the EOP in the failure scenario and also after the last segment.
Remove updating the packet length explicitly as it is done in chaining.

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
Bhagyada Modali authored and kevintraynor committed Oct 11, 2022
1 parent 1747e29 commit 18895ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/axgbe/axgbe_rxtx.c
Expand Up @@ -347,10 +347,11 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
uint32_t error_status = 0;
uint16_t idx, pidx, data_len = 0, pkt_len = 0;
uint64_t offloads;
bool eop = 0;

idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur);

while (nb_rx < nb_pkts) {
bool eop = 0;
next_desc:
idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur);

Expand Down Expand Up @@ -417,9 +418,12 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
mbuf->pkt_len = data_len;

if (first_seg != NULL) {
if (rte_pktmbuf_chain(first_seg, mbuf) != 0)
if (rte_pktmbuf_chain(first_seg, mbuf) != 0) {
rte_mempool_put(rxq->mb_pool,
first_seg);
eop = 0;
break;
}
} else {
first_seg = mbuf;
}
Expand Down Expand Up @@ -461,8 +465,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,

if (!eop)
goto next_desc;
eop = 0;

first_seg->pkt_len = pkt_len;
rxq->bytes += pkt_len;

first_seg->port = rxq->port_id;
Expand Down

0 comments on commit 18895ee

Please sign in to comment.