patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v3 1/4] net/axgbe: fix scattered Rx
       [not found] <20220901124948.97063-1-bhagyada.modali@amd.com>
@ 2022-09-02  8:47 ` Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
                     ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Bhagyada Modali @ 2022-09-02  8:47 UTC (permalink / raw)
  To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali

Error check needs to be done only for last segment of Jumbo packet.
Freed first_seg and reset eop to 0 in error case

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

Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>

---
v2:
* removed the extra paranthesis
* initialised the variables
* updated the commit logs
---
 drivers/net/axgbe/axgbe_rxtx.c | 35 +++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index f38bb64fab..89ed6fd74a 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -343,8 +343,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 	uint64_t old_dirty = rxq->dirty;
 	struct rte_mbuf *first_seg = NULL;
 	struct rte_mbuf *mbuf, *tmbuf;
-	unsigned int err, etlt;
-	uint32_t error_status;
+	unsigned int err = 0, etlt;
+	uint32_t error_status = 0;
 	uint16_t idx, pidx, data_len = 0, pkt_len = 0;
 	uint64_t offloads;
 
@@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 		}
 
 		mbuf = rxq->sw_ring[idx];
-		/* Check for any errors and free mbuf*/
-		err = AXGMAC_GET_BITS_LE(desc->write.desc3,
-					 RX_NORMAL_DESC3, ES);
-		error_status = 0;
-		if (unlikely(err)) {
-			error_status = desc->write.desc3 & AXGBE_ERR_STATUS;
-			if ((error_status != AXGBE_L3_CSUM_ERR)
-					&& (error_status != AXGBE_L4_CSUM_ERR)) {
-				rxq->errors++;
-				rte_pktmbuf_free(mbuf);
-				goto err_set;
-			}
-		}
 		rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *));
 
 		if (!AXGMAC_GET_BITS_LE(desc->write.desc3,
@@ -406,6 +393,24 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 			pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3,
 					RX_NORMAL_DESC3, PL);
 			data_len = pkt_len - rxq->crc_len;
+			/* Check for any errors and free mbuf*/
+			err = AXGMAC_GET_BITS_LE(desc->write.desc3,
+					RX_NORMAL_DESC3, ES);
+			error_status = 0;
+			if (unlikely(err)) {
+				error_status = desc->write.desc3 &
+					AXGBE_ERR_STATUS;
+				if (error_status != AXGBE_L3_CSUM_ERR &&
+						error_status != AXGBE_L4_CSUM_ERR) {
+					rxq->errors++;
+					rte_pktmbuf_free(mbuf);
+					rte_pktmbuf_free(first_seg);
+					first_seg = NULL;
+					eop = 0;
+					goto err_set;
+				}
+			}
+
 		}
 
 		if (first_seg != NULL) {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 2/4] net/axgbe: fix mbuf lengths in scattered Rx
  2022-09-02  8:47 ` [PATCH v3 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
@ 2022-09-02  8:47   ` Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Bhagyada Modali @ 2022-09-02  8:47 UTC (permalink / raw)
  To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali

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

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

Signed-off-by: Bhagyada Modali <bhagyada.modali@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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 3/4] net/axgbe: fix length of each segment in scattered Rx
  2022-09-02  8:47 ` [PATCH v3 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
@ 2022-09-02  8:47   ` Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
  2022-09-05  5:00   ` [PATCH v3 1/4] net/axgbe: fix " Namburu, Chandu-babu
  3 siblings, 0 replies; 6+ messages in thread
From: Bhagyada Modali @ 2022-09-02  8:47 UTC (permalink / raw)
  To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali

Updating mbuf data_len, Pkt_len for each segment before chaining them

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

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

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 2c2554e900..7c07fd90ef 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -412,6 +412,10 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 			}
 
 		}
+		/* Mbuf populate */
+		mbuf->data_off = RTE_PKTMBUF_HEADROOM;
+		mbuf->data_len = data_len;
+		mbuf->pkt_len = data_len;
 
 		if (first_seg != NULL) {
 			if (rte_pktmbuf_chain(first_seg, mbuf) != 0)
@@ -443,9 +447,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 				mbuf->vlan_tci = 0;
 			}
 		}
-		/* Mbuf populate */
-		mbuf->data_off = RTE_PKTMBUF_HEADROOM;
-		mbuf->data_len = data_len;
 
 err_set:
 		rxq->cur++;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 4/4] net/axgbe: fix checksum and RSS in scattered Rx
  2022-09-02  8:47 ` [PATCH v3 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
  2022-09-02  8:47   ` [PATCH v3 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
@ 2022-09-02  8:47   ` Bhagyada Modali
  2022-09-05  5:00   ` [PATCH v3 1/4] net/axgbe: fix " Namburu, Chandu-babu
  3 siblings, 0 replies; 6+ messages in thread
From: Bhagyada Modali @ 2022-09-02  8:47 UTC (permalink / raw)
  To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali

Updated the RSS hash and CSUM checks with first_seg instead of mbufs.

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

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

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 7c07fd90ef..2bad638f79 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -427,24 +427,27 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 
 		/* Get the RSS hash */
 		if (AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, RSV))
-			mbuf->hash.rss = rte_le_to_cpu_32(desc->write.desc1);
+			first_seg->hash.rss =
+				rte_le_to_cpu_32(desc->write.desc1);
 		etlt = AXGMAC_GET_BITS_LE(desc->write.desc3,
 				RX_NORMAL_DESC3, ETLT);
 		offloads = rxq->pdata->eth_dev->data->dev_conf.rxmode.offloads;
 		if (!err || !etlt) {
 			if (etlt == RX_CVLAN_TAG_PRESENT) {
-				mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN;
-				mbuf->vlan_tci =
+				first_seg->ol_flags |= RTE_MBUF_F_RX_VLAN;
+				first_seg->vlan_tci =
 					AXGMAC_GET_BITS_LE(desc->write.desc0,
 							RX_NORMAL_DESC0, OVT);
 				if (offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)
-					mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED;
+					first_seg->ol_flags |=
+						RTE_MBUF_F_RX_VLAN_STRIPPED;
 				else
-					mbuf->ol_flags &= ~RTE_MBUF_F_RX_VLAN_STRIPPED;
+					first_seg->ol_flags &=
+						~RTE_MBUF_F_RX_VLAN_STRIPPED;
 			} else {
-				mbuf->ol_flags &=
+				first_seg->ol_flags &=
 					~(RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
-				mbuf->vlan_tci = 0;
+				first_seg->vlan_tci = 0;
 			}
 		}
 
@@ -468,18 +471,24 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 
 		first_seg->port = rxq->port_id;
 		if (rxq->pdata->rx_csum_enable) {
-			mbuf->ol_flags = 0;
-			mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
-			mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
+			first_seg->ol_flags = 0;
+			first_seg->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+			first_seg->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
 			if (unlikely(error_status == AXGBE_L3_CSUM_ERR)) {
-				mbuf->ol_flags &= ~RTE_MBUF_F_RX_IP_CKSUM_GOOD;
-				mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD;
-				mbuf->ol_flags &= ~RTE_MBUF_F_RX_L4_CKSUM_GOOD;
-				mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
+				first_seg->ol_flags &=
+					~RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+				first_seg->ol_flags |=
+					RTE_MBUF_F_RX_IP_CKSUM_BAD;
+				first_seg->ol_flags &=
+					~RTE_MBUF_F_RX_L4_CKSUM_GOOD;
+				first_seg->ol_flags |=
+					RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
 			} else if (unlikely(error_status
 						== AXGBE_L4_CSUM_ERR)) {
-				mbuf->ol_flags &= ~RTE_MBUF_F_RX_L4_CKSUM_GOOD;
-				mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
+				first_seg->ol_flags &=
+					~RTE_MBUF_F_RX_L4_CKSUM_GOOD;
+				first_seg->ol_flags |=
+					RTE_MBUF_F_RX_L4_CKSUM_BAD;
 			}
 		}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v3 1/4] net/axgbe: fix scattered Rx
  2022-09-02  8:47 ` [PATCH v3 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
                     ` (2 preceding siblings ...)
  2022-09-02  8:47   ` [PATCH v3 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
@ 2022-09-05  5:00   ` Namburu, Chandu-babu
  2022-09-05 16:48     ` Ferruh Yigit
  3 siblings, 1 reply; 6+ messages in thread
From: Namburu, Chandu-babu @ 2022-09-05  5:00 UTC (permalink / raw)
  To: Modali, Bhagyada, Yigit, Ferruh; +Cc: dev, stable

[Public]

Acked-by: Chandubabu Namburu <chandu@amd.com>

-----Original Message-----
From: Modali, Bhagyada <Bhagyada.Modali@amd.com> 
Sent: Friday, September 2, 2022 2:18 PM
To: Namburu, Chandu-babu <chandu@amd.com>; Yigit, Ferruh <Ferruh.Yigit@amd.com>
Cc: dev@dpdk.org; stable@dpdk.org; Modali, Bhagyada <Bhagyada.Modali@amd.com>
Subject: [PATCH v3 1/4] net/axgbe: fix scattered Rx

Error check needs to be done only for last segment of Jumbo packet.
Freed first_seg and reset eop to 0 in error case

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

Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>

---
v2:
* removed the extra paranthesis
* initialised the variables
* updated the commit logs
---
 drivers/net/axgbe/axgbe_rxtx.c | 35 +++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index f38bb64fab..89ed6fd74a 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -343,8 +343,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 	uint64_t old_dirty = rxq->dirty;
 	struct rte_mbuf *first_seg = NULL;
 	struct rte_mbuf *mbuf, *tmbuf;
-	unsigned int err, etlt;
-	uint32_t error_status;
+	unsigned int err = 0, etlt;
+	uint32_t error_status = 0;
 	uint16_t idx, pidx, data_len = 0, pkt_len = 0;
 	uint64_t offloads;
 
@@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 		}
 
 		mbuf = rxq->sw_ring[idx];
-		/* Check for any errors and free mbuf*/
-		err = AXGMAC_GET_BITS_LE(desc->write.desc3,
-					 RX_NORMAL_DESC3, ES);
-		error_status = 0;
-		if (unlikely(err)) {
-			error_status = desc->write.desc3 & AXGBE_ERR_STATUS;
-			if ((error_status != AXGBE_L3_CSUM_ERR)
-					&& (error_status != AXGBE_L4_CSUM_ERR)) {
-				rxq->errors++;
-				rte_pktmbuf_free(mbuf);
-				goto err_set;
-			}
-		}
 		rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *));
 
 		if (!AXGMAC_GET_BITS_LE(desc->write.desc3,
@@ -406,6 +393,24 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
 			pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3,
 					RX_NORMAL_DESC3, PL);
 			data_len = pkt_len - rxq->crc_len;
+			/* Check for any errors and free mbuf*/
+			err = AXGMAC_GET_BITS_LE(desc->write.desc3,
+					RX_NORMAL_DESC3, ES);
+			error_status = 0;
+			if (unlikely(err)) {
+				error_status = desc->write.desc3 &
+					AXGBE_ERR_STATUS;
+				if (error_status != AXGBE_L3_CSUM_ERR &&
+						error_status != AXGBE_L4_CSUM_ERR) {
+					rxq->errors++;
+					rte_pktmbuf_free(mbuf);
+					rte_pktmbuf_free(first_seg);
+					first_seg = NULL;
+					eop = 0;
+					goto err_set;
+				}
+			}
+
 		}
 
 		if (first_seg != NULL) {
--
2.25.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/4] net/axgbe: fix scattered Rx
  2022-09-05  5:00   ` [PATCH v3 1/4] net/axgbe: fix " Namburu, Chandu-babu
@ 2022-09-05 16:48     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2022-09-05 16:48 UTC (permalink / raw)
  To: Namburu, Chandu-babu, Modali, Bhagyada, Yigit, Ferruh; +Cc: dev, stable

On 9/5/2022 6:00 AM, Namburu, Chandu-babu wrote:


> -----Original Message-----
> From: Modali, Bhagyada <Bhagyada.Modali@amd.com>
> Sent: Friday, September 2, 2022 2:18 PM
> To: Namburu, Chandu-babu <chandu@amd.com>; Yigit, Ferruh <Ferruh.Yigit@amd.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Modali, Bhagyada <Bhagyada.Modali@amd.com>
> Subject: [PATCH v3 1/4] net/axgbe: fix scattered Rx
> 
> Error check needs to be done only for last segment of Jumbo packet.
> Freed first_seg and reset eop to 0 in error case
> 
> Fixes: 965b3127d425 ("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>
> 
Series applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-05 16:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220901124948.97063-1-bhagyada.modali@amd.com>
2022-09-02  8:47 ` [PATCH v3 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
2022-09-02  8:47   ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
2022-09-02  8:47   ` [PATCH v3 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
2022-09-02  8:47   ` [PATCH v3 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
2022-09-05  5:00   ` [PATCH v3 1/4] net/axgbe: fix " Namburu, Chandu-babu
2022-09-05 16:48     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).