* [PATCH] net/axgbe: optimise scattered rx
@ 2022-09-05 10:20 Bhagyada Modali
2022-09-06 11:59 ` [PATCH v2] " Bhagyada Modali
0 siblings, 1 reply; 4+ messages in thread
From: Bhagyada Modali @ 2022-09-05 10:20 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Updated the logic to remove the extra increments of the variables.
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 | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 2bad638f79..8b43e8160b 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -340,7 +340,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
struct axgbe_rx_queue *rxq = rx_queue;
volatile union axgbe_rx_desc *desc;
- uint64_t old_dirty = rxq->dirty;
struct rte_mbuf *first_seg = NULL;
struct rte_mbuf *mbuf, *tmbuf;
unsigned int err = 0, etlt;
@@ -352,8 +351,7 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
while (nb_rx < nb_pkts) {
bool eop = 0;
next_desc:
- if (unlikely(idx == rxq->nb_desc))
- idx = 0;
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur);
desc = &rxq->desc[idx];
@@ -446,19 +444,19 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
~RTE_MBUF_F_RX_VLAN_STRIPPED;
} else {
first_seg->ol_flags &=
- ~(RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
+ ~(RTE_MBUF_F_RX_VLAN |
+ RTE_MBUF_F_RX_VLAN_STRIPPED);
first_seg->vlan_tci = 0;
}
}
err_set:
rxq->cur++;
- rxq->sw_ring[idx++] = tmbuf;
+ rxq->sw_ring[idx] = tmbuf;
desc->read.baddr =
rte_cpu_to_le_64(rte_mbuf_data_iova_default(tmbuf));
memset((void *)(&desc->read.desc2), 0, 8);
AXGMAC_SET_BITS_LE(desc->read.desc3, RX_NORMAL_DESC3, OWN, 1);
- rxq->dirty++;
if (!eop) {
rte_pktmbuf_free(mbuf);
@@ -501,12 +499,13 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
/* Save receive context.*/
rxq->pkts += nb_rx;
- if (rxq->dirty != old_dirty) {
+ if (rxq->dirty != rxq->cur) {
rte_wmb();
- idx = AXGBE_GET_DESC_IDX(rxq, rxq->dirty - 1);
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur - 1);
AXGMAC_DMA_IOWRITE(rxq, DMA_CH_RDTR_LO,
low32_value(rxq->ring_phys_addr +
(idx * sizeof(union axgbe_rx_desc))));
+ rxq->dirty = rxq->cur;
}
return nb_rx;
}
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] net/axgbe: optimise scattered rx
2022-09-05 10:20 [PATCH] net/axgbe: optimise scattered rx Bhagyada Modali
@ 2022-09-06 11:59 ` Bhagyada Modali
2022-09-07 8:55 ` Namburu, Chandu-babu
0 siblings, 1 reply; 4+ messages in thread
From: Bhagyada Modali @ 2022-09-06 11:59 UTC (permalink / raw)
To: chandu, ferruh.yigit; +Cc: dev, stable, Bhagyada Modali
Updated the logic to remove the extra increments of the variables.
Fixes: 965b3127d425 ("net/axgbe: support scattered Rx")
Cc: stable@dpdk.org
Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
---
v2:
* rebased to the latest changes and submitting the patch again
---
---
drivers/net/axgbe/axgbe_rxtx.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 2bad638f79..8b43e8160b 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -340,7 +340,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
struct axgbe_rx_queue *rxq = rx_queue;
volatile union axgbe_rx_desc *desc;
- uint64_t old_dirty = rxq->dirty;
struct rte_mbuf *first_seg = NULL;
struct rte_mbuf *mbuf, *tmbuf;
unsigned int err = 0, etlt;
@@ -352,8 +351,7 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
while (nb_rx < nb_pkts) {
bool eop = 0;
next_desc:
- if (unlikely(idx == rxq->nb_desc))
- idx = 0;
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur);
desc = &rxq->desc[idx];
@@ -446,19 +444,19 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
~RTE_MBUF_F_RX_VLAN_STRIPPED;
} else {
first_seg->ol_flags &=
- ~(RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
+ ~(RTE_MBUF_F_RX_VLAN |
+ RTE_MBUF_F_RX_VLAN_STRIPPED);
first_seg->vlan_tci = 0;
}
}
err_set:
rxq->cur++;
- rxq->sw_ring[idx++] = tmbuf;
+ rxq->sw_ring[idx] = tmbuf;
desc->read.baddr =
rte_cpu_to_le_64(rte_mbuf_data_iova_default(tmbuf));
memset((void *)(&desc->read.desc2), 0, 8);
AXGMAC_SET_BITS_LE(desc->read.desc3, RX_NORMAL_DESC3, OWN, 1);
- rxq->dirty++;
if (!eop) {
rte_pktmbuf_free(mbuf);
@@ -501,12 +499,13 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
/* Save receive context.*/
rxq->pkts += nb_rx;
- if (rxq->dirty != old_dirty) {
+ if (rxq->dirty != rxq->cur) {
rte_wmb();
- idx = AXGBE_GET_DESC_IDX(rxq, rxq->dirty - 1);
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur - 1);
AXGMAC_DMA_IOWRITE(rxq, DMA_CH_RDTR_LO,
low32_value(rxq->ring_phys_addr +
(idx * sizeof(union axgbe_rx_desc))));
+ rxq->dirty = rxq->cur;
}
return nb_rx;
}
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v2] net/axgbe: optimise scattered rx
2022-09-06 11:59 ` [PATCH v2] " Bhagyada Modali
@ 2022-09-07 8:55 ` Namburu, Chandu-babu
2022-09-07 13:55 ` Ferruh Yigit
0 siblings, 1 reply; 4+ messages in thread
From: Namburu, Chandu-babu @ 2022-09-07 8:55 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: Tuesday, September 6, 2022 5:29 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 v2] net/axgbe: optimise scattered rx
Updated the logic to remove the extra increments of the variables.
Fixes: 965b3127d425 ("net/axgbe: support scattered Rx")
Cc: stable@dpdk.org
Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
---
v2:
* rebased to the latest changes and submitting the patch again
---
---
drivers/net/axgbe/axgbe_rxtx.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 2bad638f79..8b43e8160b 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -340,7 +340,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
struct axgbe_rx_queue *rxq = rx_queue;
volatile union axgbe_rx_desc *desc;
- uint64_t old_dirty = rxq->dirty;
struct rte_mbuf *first_seg = NULL;
struct rte_mbuf *mbuf, *tmbuf;
unsigned int err = 0, etlt;
@@ -352,8 +351,7 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
while (nb_rx < nb_pkts) {
bool eop = 0;
next_desc:
- if (unlikely(idx == rxq->nb_desc))
- idx = 0;
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur);
desc = &rxq->desc[idx];
@@ -446,19 +444,19 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
~RTE_MBUF_F_RX_VLAN_STRIPPED;
} else {
first_seg->ol_flags &=
- ~(RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
+ ~(RTE_MBUF_F_RX_VLAN |
+ RTE_MBUF_F_RX_VLAN_STRIPPED);
first_seg->vlan_tci = 0;
}
}
err_set:
rxq->cur++;
- rxq->sw_ring[idx++] = tmbuf;
+ rxq->sw_ring[idx] = tmbuf;
desc->read.baddr =
rte_cpu_to_le_64(rte_mbuf_data_iova_default(tmbuf));
memset((void *)(&desc->read.desc2), 0, 8);
AXGMAC_SET_BITS_LE(desc->read.desc3, RX_NORMAL_DESC3, OWN, 1);
- rxq->dirty++;
if (!eop) {
rte_pktmbuf_free(mbuf);
@@ -501,12 +499,13 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
/* Save receive context.*/
rxq->pkts += nb_rx;
- if (rxq->dirty != old_dirty) {
+ if (rxq->dirty != rxq->cur) {
rte_wmb();
- idx = AXGBE_GET_DESC_IDX(rxq, rxq->dirty - 1);
+ idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur - 1);
AXGMAC_DMA_IOWRITE(rxq, DMA_CH_RDTR_LO,
low32_value(rxq->ring_phys_addr +
(idx * sizeof(union axgbe_rx_desc))));
+ rxq->dirty = rxq->cur;
}
return nb_rx;
}
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net/axgbe: optimise scattered rx
2022-09-07 8:55 ` Namburu, Chandu-babu
@ 2022-09-07 13:55 ` Ferruh Yigit
0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-09-07 13:55 UTC (permalink / raw)
To: Namburu, Chandu-babu, Modali, Bhagyada, Yigit, Ferruh; +Cc: dev, stable
On 9/7/2022 9:55 AM, Namburu, Chandu-babu wrote:
> -----Original Message-----
> From: Modali, Bhagyada <Bhagyada.Modali@amd.com>
> Sent: Tuesday, September 6, 2022 5:29 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 v2] net/axgbe: optimise scattered rx
>
> Updated the logic to remove the extra increments of the variables.
>
> 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>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-07 13:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 10:20 [PATCH] net/axgbe: optimise scattered rx Bhagyada Modali
2022-09-06 11:59 ` [PATCH v2] " Bhagyada Modali
2022-09-07 8:55 ` Namburu, Chandu-babu
2022-09-07 13:55 ` 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).