DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] event/cnxk: fix incorrect mbuf offset calculation
@ 2022-10-25 15:46 pbhagavatula
  2022-10-25 16:11 ` [PATCH v2] " pbhagavatula
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2022-10-25 15:46 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Fix incorrect mbuf offset calculation when HEADROOM exceeds 128B
while processing event vectors.

Fixes: 7fbbc981d54f("event/cnxk: support vectorized Rx event fast path")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Change-Id: I1c33c8a5cce29c3ea7eb0411f4e1bedf42053167
---
 drivers/net/cnxk/cn10k_rx.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 4e22ceda02..721127dddd 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -1203,9 +1203,11 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
 			mbuf23 = vqsubq_u64(mbuf23, data_off);
 		} else {
 			mbuf01 =
-				vsubq_u64(vld1q_u64((uint64_t *)cq0), data_off);
-			mbuf23 = vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
-					   data_off);
+				vsubq_u64(vld1q_u64((uint64_t *)cq0),
+					  vdupq_n_u64(sizeof(struct rte_mbuf)));
+			mbuf23 =
+				vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
+					  vdupq_n_u64(sizeof(struct rte_mbuf)));
 		}
 
 		/* Move mbufs to scalar registers for future use */
-- 
2.38.0


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

* [PATCH v2] event/cnxk: fix incorrect mbuf offset calculation
  2022-10-25 15:46 [PATCH] event/cnxk: fix incorrect mbuf offset calculation pbhagavatula
@ 2022-10-25 16:11 ` pbhagavatula
  2022-11-07 12:00   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2022-10-25 16:11 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Fix incorrect mbuf offset calculation when HEADROOM exceeds 128B
while processing event vectors.

Fixes: 7fbbc981d54f("event/cnxk: support vectorized Rx event fast path")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 v2 Changes:
 - Remove internal Change-Id.

 drivers/net/cnxk/cn10k_rx.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 46488d442e..f562a75245 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -1201,9 +1201,11 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
 			mbuf23 = vqsubq_u64(mbuf23, data_off);
 		} else {
 			mbuf01 =
-				vsubq_u64(vld1q_u64((uint64_t *)cq0), data_off);
-			mbuf23 = vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
-					   data_off);
+				vsubq_u64(vld1q_u64((uint64_t *)cq0),
+					  vdupq_n_u64(sizeof(struct rte_mbuf)));
+			mbuf23 =
+				vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
+					  vdupq_n_u64(sizeof(struct rte_mbuf)));
 		}

 		/* Move mbufs to scalar registers for future use */
--
2.25.1


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

* Re: [PATCH v2] event/cnxk: fix incorrect mbuf offset calculation
  2022-10-25 16:11 ` [PATCH v2] " pbhagavatula
@ 2022-11-07 12:00   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2022-11-07 12:00 UTC (permalink / raw)
  To: pbhagavatula
  Cc: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, dev

On Tue, Oct 25, 2022 at 9:41 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Fix incorrect mbuf offset calculation when HEADROOM exceeds 128B
> while processing event vectors.
>
> Fixes: 7fbbc981d54f("event/cnxk: support vectorized Rx event fast path")
Cc: stable@dpdk.org


Applied to dpdk-next-net-eventdev/for-main. Thanks

>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  v2 Changes:
>  - Remove internal Change-Id.
>
>  drivers/net/cnxk/cn10k_rx.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
> index 46488d442e..f562a75245 100644
> --- a/drivers/net/cnxk/cn10k_rx.h
> +++ b/drivers/net/cnxk/cn10k_rx.h
> @@ -1201,9 +1201,11 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
>                         mbuf23 = vqsubq_u64(mbuf23, data_off);
>                 } else {
>                         mbuf01 =
> -                               vsubq_u64(vld1q_u64((uint64_t *)cq0), data_off);
> -                       mbuf23 = vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
> -                                          data_off);
> +                               vsubq_u64(vld1q_u64((uint64_t *)cq0),
> +                                         vdupq_n_u64(sizeof(struct rte_mbuf)));
> +                       mbuf23 =
> +                               vsubq_u64(vld1q_u64((uint64_t *)(cq0 + 16)),
> +                                         vdupq_n_u64(sizeof(struct rte_mbuf)));
>                 }
>
>                 /* Move mbufs to scalar registers for future use */
> --
> 2.25.1
>

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

end of thread, other threads:[~2022-11-07 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 15:46 [PATCH] event/cnxk: fix incorrect mbuf offset calculation pbhagavatula
2022-10-25 16:11 ` [PATCH v2] " pbhagavatula
2022-11-07 12:00   ` Jerin Jacob

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).