[v1] event/cnxk: fix setting event attributes in empty get work

Message ID 9e4d4654e6a1d7f6c5fb69ad01421117b8599f41.1682576830.git.sthotton@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1] event/cnxk: fix setting event attributes in empty get work |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Shijith Thotton April 27, 2023, 6:28 a.m. UTC
  Even when no events are dequeued, it is important to update event
attributes as they provide valuable information for checking the work
slot state and other attributes.

Fixes: c0a9774f030d ("event/cnxk: move post-processing to separate function")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 drivers/event/cnxk/cn10k_worker.h | 3 +++
 drivers/event/cnxk/cn9k_worker.h  | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
  

Comments

Pavan Nikhilesh Bhagavatula April 27, 2023, 6:54 a.m. UTC | #1
> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Thursday, April 27, 2023 11:58 AM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org; Pavan
> Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; stable@dpdk.org
> Subject: [PATCH v1] event/cnxk: fix setting event attributes in empty get
> work
> 
> Even when no events are dequeued, it is important to update event
> attributes as they provide valuable information for checking the work
> slot state and other attributes.
> 
> Fixes: c0a9774f030d ("event/cnxk: move post-processing to separate
> function")
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

> ---
>  drivers/event/cnxk/cn10k_worker.h | 3 +++
>  drivers/event/cnxk/cn9k_worker.h  | 6 ++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/event/cnxk/cn10k_worker.h
> b/drivers/event/cnxk/cn10k_worker.h
> index 06c71c6092..beae2be903 100644
> --- a/drivers/event/cnxk/cn10k_worker.h
> +++ b/drivers/event/cnxk/cn10k_worker.h
> @@ -282,6 +282,9 @@ cn10k_sso_hws_get_work_empty(struct
> cn10k_sso_hws *ws, struct rte_event *ev,
>  	ws->gw_rdata = gw.u64[0];
>  	if (gw.u64[1])
>  		cn10k_sso_hws_post_process(ws, gw.u64, flags);
> +	else
> +		gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
> +			    (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] &
> 0xffffffff);
> 
>  	ev->event = gw.u64[0];
>  	ev->u64 = gw.u64[1];
> diff --git a/drivers/event/cnxk/cn9k_worker.h
> b/drivers/event/cnxk/cn9k_worker.h
> index 1ce4b044e8..47eea70b5f 100644
> --- a/drivers/event/cnxk/cn9k_worker.h
> +++ b/drivers/event/cnxk/cn9k_worker.h
> @@ -353,8 +353,10 @@ cn9k_sso_hws_get_work_empty(uint64_t base,
> struct rte_event *ev,
>  #endif
> 
>  	if (gw.u64[1])
> -		cn9k_sso_hws_post_process(gw.u64, mbuf, flags,
> lookup_mem,
> -					  tstamp);
> +		cn9k_sso_hws_post_process(gw.u64, mbuf, flags,
> lookup_mem, tstamp);
> +	else
> +		gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
> +			    (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] &
> 0xffffffff);
> 
>  	ev->event = gw.u64[0];
>  	ev->u64 = gw.u64[1];
> --
> 2.25.1
  
Jerin Jacob May 17, 2023, 1:15 p.m. UTC | #2
On Thu, Apr 27, 2023 at 12:24 PM Pavan Nikhilesh Bhagavatula
<pbhagavatula@marvell.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Shijith Thotton <sthotton@marvell.com>
> > Sent: Thursday, April 27, 2023 11:58 AM
> > To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org; Pavan
> > Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; stable@dpdk.org
> > Subject: [PATCH v1] event/cnxk: fix setting event attributes in empty get
> > work
> >
> > Even when no events are dequeued, it is important to update event
> > attributes as they provide valuable information for checking the work
> > slot state and other attributes.
> >
> > Fixes: c0a9774f030d ("event/cnxk: move post-processing to separate
> > function")
> >
> > Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

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


>
> > ---
> >  drivers/event/cnxk/cn10k_worker.h | 3 +++
> >  drivers/event/cnxk/cn9k_worker.h  | 6 ++++--
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/event/cnxk/cn10k_worker.h
> > b/drivers/event/cnxk/cn10k_worker.h
> > index 06c71c6092..beae2be903 100644
> > --- a/drivers/event/cnxk/cn10k_worker.h
> > +++ b/drivers/event/cnxk/cn10k_worker.h
> > @@ -282,6 +282,9 @@ cn10k_sso_hws_get_work_empty(struct
> > cn10k_sso_hws *ws, struct rte_event *ev,
> >       ws->gw_rdata = gw.u64[0];
> >       if (gw.u64[1])
> >               cn10k_sso_hws_post_process(ws, gw.u64, flags);
> > +     else
> > +             gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
> > +                         (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] &
> > 0xffffffff);
> >
> >       ev->event = gw.u64[0];
> >       ev->u64 = gw.u64[1];
> > diff --git a/drivers/event/cnxk/cn9k_worker.h
> > b/drivers/event/cnxk/cn9k_worker.h
> > index 1ce4b044e8..47eea70b5f 100644
> > --- a/drivers/event/cnxk/cn9k_worker.h
> > +++ b/drivers/event/cnxk/cn9k_worker.h
> > @@ -353,8 +353,10 @@ cn9k_sso_hws_get_work_empty(uint64_t base,
> > struct rte_event *ev,
> >  #endif
> >
> >       if (gw.u64[1])
> > -             cn9k_sso_hws_post_process(gw.u64, mbuf, flags,
> > lookup_mem,
> > -                                       tstamp);
> > +             cn9k_sso_hws_post_process(gw.u64, mbuf, flags,
> > lookup_mem, tstamp);
> > +     else
> > +             gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
> > +                         (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] &
> > 0xffffffff);
> >
> >       ev->event = gw.u64[0];
> >       ev->u64 = gw.u64[1];
> > --
> > 2.25.1
>
  

Patch

diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 06c71c6092..beae2be903 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -282,6 +282,9 @@  cn10k_sso_hws_get_work_empty(struct cn10k_sso_hws *ws, struct rte_event *ev,
 	ws->gw_rdata = gw.u64[0];
 	if (gw.u64[1])
 		cn10k_sso_hws_post_process(ws, gw.u64, flags);
+	else
+		gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
+			    (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] & 0xffffffff);
 
 	ev->event = gw.u64[0];
 	ev->u64 = gw.u64[1];
diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index 1ce4b044e8..47eea70b5f 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -353,8 +353,10 @@  cn9k_sso_hws_get_work_empty(uint64_t base, struct rte_event *ev,
 #endif
 
 	if (gw.u64[1])
-		cn9k_sso_hws_post_process(gw.u64, mbuf, flags, lookup_mem,
-					  tstamp);
+		cn9k_sso_hws_post_process(gw.u64, mbuf, flags, lookup_mem, tstamp);
+	else
+		gw.u64[0] = (gw.u64[0] & (0x3ull << 32)) << 6 |
+			    (gw.u64[0] & (0x3FFull << 36)) << 4 | (gw.u64[0] & 0xffffffff);
 
 	ev->event = gw.u64[0];
 	ev->u64 = gw.u64[1];