Updated pkt_len and data_len in the last segment of the packet.

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

Signed-off-by: Bhagyada Modali <bhagyada.mod...@amd.com>
---
 drivers/net/axgbe/axgbe_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 89ed6fd74a..2c2554e900 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -391,8 +391,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
                } else {
                        eop = 1;
                        pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3,
-                                       RX_NORMAL_DESC3, PL);
-                       data_len = pkt_len - rxq->crc_len;
+                                       RX_NORMAL_DESC3, PL) - rxq->crc_len;
+                       data_len = pkt_len % rxq->buf_size;
                        /* Check for any errors and free mbuf*/
                        err = AXGMAC_GET_BITS_LE(desc->write.desc3,
                                        RX_NORMAL_DESC3, ES);
-- 
2.25.1

Reply via email to