* [PATCH 1/3] net/axgbe: reset the end of packet in scattered rx
@ 2022-09-07 17:33 Bhagyada Modali
2022-09-07 17:33 ` [PATCH 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-07 17:33 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Reset the eop in the failure scenario and also after the last segment.
Removed the packet length updation explicitly as it is done in Chaining.
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 | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 8b43e8160b..e1488483bc 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -346,10 +346,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);
@@ -416,9 +417,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;
}
@@ -462,8 +466,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
rte_pktmbuf_free(mbuf);
goto next_desc;
}
+ eop = 0;
- first_seg->pkt_len = pkt_len;
rxq->bytes += pkt_len;
mbuf->next = NULL;
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] net/axgbe: clear buffers in failure scenario in scattered rx
2022-09-07 17:33 [PATCH 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
@ 2022-09-07 17:33 ` Bhagyada Modali
2022-09-07 17:33 ` [PATCH 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2 siblings, 0 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-07 17:33 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Clearing mbuf, first_seg when chaining mbufs fail.
Increment the error count for the same.
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 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index e1488483bc..c1f51ed6d6 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -418,8 +418,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;
}
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] net/axgbe: save segment data in scattered Rx
2022-09-07 17:33 [PATCH 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-07 17:33 ` [PATCH 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
@ 2022-09-07 17:33 ` Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2 siblings, 0 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-07 17:33 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Save the segments of the packet, when the next descriptor data is not ready.
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 | 11 +++++++++++
drivers/net/axgbe/axgbe_rxtx.h | 6 ++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index c1f51ed6d6..65bda2a0d3 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -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;
@@ -502,6 +508,11 @@ 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;
diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h
index 2a330339cd..2da3095547 100644
--- a/drivers/net/axgbe/axgbe_rxtx.h
+++ b/drivers/net/axgbe/axgbe_rxtx.h
@@ -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 */
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx
2022-09-07 17:33 [PATCH 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-07 17:33 ` [PATCH 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
2022-09-07 17:33 ` [PATCH 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
@ 2022-09-08 3:31 ` Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
` (2 more replies)
2 siblings, 3 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-08 3:31 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Reset the eop in the failure scenario and also after the last segment.
Removed the packet length updation explicitly as it is done in Chaining.
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 | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 8b43e8160b..e1488483bc 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -346,10 +346,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);
@@ -416,9 +417,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;
}
@@ -462,8 +466,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
rte_pktmbuf_free(mbuf);
goto next_desc;
}
+ eop = 0;
- first_seg->pkt_len = pkt_len;
rxq->bytes += pkt_len;
mbuf->next = NULL;
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] net/axgbe: clear buffers in failure scenario in scattered rx
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
@ 2022-09-08 3:31 ` Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
2022-09-08 13:56 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Namburu, Chandu-babu
2 siblings, 0 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-08 3:31 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Clearing mbuf, first_seg when chaining mbufs fail.
Increment the error count for the same.
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 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index e1488483bc..c1f51ed6d6 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -418,8 +418,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;
}
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] net/axgbe: save segment data in scattered Rx
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
@ 2022-09-08 3:31 ` Bhagyada Modali
2022-09-08 13:56 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Namburu, Chandu-babu
2 siblings, 0 replies; 8+ messages in thread
From: Bhagyada Modali @ 2022-09-08 3:31 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Saving the current segments of the packet,
when the next segment data is not ready.
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 | 11 +++++++++++
drivers/net/axgbe/axgbe_rxtx.h | 6 ++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index c1f51ed6d6..65bda2a0d3 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -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;
@@ -502,6 +508,11 @@ 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;
diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h
index 2a330339cd..2da3095547 100644
--- a/drivers/net/axgbe/axgbe_rxtx.h
+++ b/drivers/net/axgbe/axgbe_rxtx.h
@@ -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 */
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
@ 2022-09-08 13:56 ` Namburu, Chandu-babu
2022-09-21 14:39 ` Ferruh Yigit
2 siblings, 1 reply; 8+ messages in thread
From: Namburu, Chandu-babu @ 2022-09-08 13:56 UTC (permalink / raw)
To: Modali, Bhagyada, Yigit, Ferruh; +Cc: dev, stable
[Public]
For the series,
Acked-by: Chandubabu Namburu <chandu@amd.com>
-----Original Message-----
From: Modali, Bhagyada <Bhagyada.Modali@amd.com>
Sent: Thursday, September 8, 2022 9:01 AM
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 v2 1/3] net/axgbe: reset the end of packet in scattered rx
Reset the eop in the failure scenario and also after the last segment.
Removed the packet length updation explicitly as it is done in Chaining.
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 | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 8b43e8160b..e1488483bc 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -346,10 +346,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);
@@ -416,9 +417,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;
}
@@ -462,8 +466,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
rte_pktmbuf_free(mbuf);
goto next_desc;
}
+ eop = 0;
- first_seg->pkt_len = pkt_len;
rxq->bytes += pkt_len;
mbuf->next = NULL;
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx
2022-09-08 13:56 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Namburu, Chandu-babu
@ 2022-09-21 14:39 ` Ferruh Yigit
0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2022-09-21 14:39 UTC (permalink / raw)
To: Namburu, Chandu-babu, Modali, Bhagyada; +Cc: dev, stable
On 9/8/2022 2:56 PM, Namburu, Chandu-babu wrote:
> From: Modali, Bhagyada <Bhagyada.Modali@amd.com>
> Sent: Thursday, September 8, 2022 9:01 AM
> 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 v2 1/3] net/axgbe: reset the end of packet in scattered rx
>
> Reset the eop in the failure scenario and also after the last segment.
> Removed the packet length updation explicitly as it is done in Chaining.
>
> 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] 8+ messages in thread
end of thread, other threads:[~2022-09-21 14:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 17:33 [PATCH 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-07 17:33 ` [PATCH 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
2022-09-07 17:33 ` [PATCH 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 2/3] net/axgbe: clear buffers in failure scenario " Bhagyada Modali
2022-09-08 3:31 ` [PATCH v2 3/3] net/axgbe: save segment data in scattered Rx Bhagyada Modali
2022-09-08 13:56 ` [PATCH v2 1/3] net/axgbe: reset the end of packet in scattered rx Namburu, Chandu-babu
2022-09-21 14:39 ` 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).