DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
@ 2020-07-28  6:11 Xueming Li
  2020-07-28  6:22 ` [dpdk-dev] [v1] vdpa/mlx5: use control " Xueming Li
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Xueming Li @ 2020-07-28  6:11 UTC (permalink / raw)
  Cc: dev, Asaf Penso

With latest rte api, vdpa example failed on vq setup, the api to get
event queue of specified core failed.

The api to get event queue needs core id as input, but after
commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
code of "vhost-event" thread to get current core returns -1, an invalid
core id.

As vhost thread created on same core of eal master core, this patch uses
master core ID as a workaround.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 13ad43611e..ff6db8e345 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
 
 	if (priv->eventc)
 		return 0;
-	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
+	lcore = (uint32_t)rte_get_master_lcore();
 	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
 		rte_errno = errno;
 		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
-- 
2.17.1


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

* [dpdk-dev] [v1] vdpa/mlx5: use control core Id for vhost thread
  2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
@ 2020-07-28  6:22 ` Xueming Li
  2020-07-28  7:08 ` [dpdk-dev] [PATCH] vdpa/mlx5: use master " David Marchand
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Xueming Li @ 2020-07-28  6:22 UTC (permalink / raw)
  Cc: dev, Asaf Penso

With latest rte api, vdpa example failed on vq setup, the api to get
event queue of specified core failed.

The api to get event queue needs core id as input, but after
commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
code of "vhost-event" thread to get current core returns -1, an invalid
core id.

As vhost thread created on same core of eal control core, this patch
uses control core ID as a workaround.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 13ad43611e..ff6db8e345 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
 
 	if (priv->eventc)
 		return 0;
-	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
+	lcore = (uint32_t)rte_get_master_lcore();
 	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
 		rte_errno = errno;
 		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
  2020-07-28  6:22 ` [dpdk-dev] [v1] vdpa/mlx5: use control " Xueming Li
@ 2020-07-28  7:08 ` David Marchand
  2020-07-28  7:19   ` Matan Azrad
  2020-07-28  8:24 ` Xueming(Steven) Li
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2020-07-28  7:08 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, Asaf Penso, Matan Azrad

On Tue, Jul 28, 2020 at 8:11 AM Xueming Li <xuemingl@mellanox.com> wrote:
>
> With latest rte api, vdpa example failed on vq setup, the api to get
> event queue of specified core failed.
>
> The api to get event queue needs core id as input, but after
> commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
> code of "vhost-event" thread to get current core returns -1, an invalid
> core id.
>
> As vhost thread created on same core of eal master core, this patch uses
> master core ID as a workaround.

rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
As explained in the commitlog of 67ae5936c4fc36, for a non-EAL thread
(which has no associated lcore by default) calling this function means
lcore_config[-1].core_id.

Did I miss something?
If not, this is not a workaround but a fix.


>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> index 13ad43611e..ff6db8e345 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> @@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
>
>         if (priv->eventc)
>                 return 0;
> -       lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
> +       lcore = (uint32_t)rte_get_master_lcore();
>         if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
>                 rte_errno = errno;
>                 DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
> --
> 2.17.1
>


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  7:08 ` [dpdk-dev] [PATCH] vdpa/mlx5: use master " David Marchand
@ 2020-07-28  7:19   ` Matan Azrad
  2020-07-28  7:25     ` David Marchand
  0 siblings, 1 reply; 17+ messages in thread
From: Matan Azrad @ 2020-07-28  7:19 UTC (permalink / raw)
  To: David Marchand, Xueming(Steven) Li; +Cc: dev, Asaf Penso



From: David Marchand
> On Tue, Jul 28, 2020 at 8:11 AM Xueming Li <xuemingl@mellanox.com>
> wrote:
> >
> > With latest rte api, vdpa example failed on vq setup, the api to get
> > event queue of specified core failed.
> >
> > The api to get event queue needs core id as input, but after commit
> > 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"), code
> > of "vhost-event" thread to get current core returns -1, an invalid
> > core id.
> >
> > As vhost thread created on same core of eal master core, this patch
> > uses master core ID as a workaround.
> 
> rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> As explained in the commitlog of 67ae5936c4fc36, for a non-EAL thread
> (which has no associated lcore by default) calling this function means
> lcore_config[-1].core_id.

Deosn't lcore mean core?
So, if the private thread run on a core that opened by EAL,
Shouldn't the API return the lcore of the private thread core?

> 
> Did I miss something?
> If not, this is not a workaround but a fix.

I'm not sure yet.

> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > Acked-by: Matan Azrad <matan@mellanox.com>
> > ---
> >  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > index 13ad43611e..ff6db8e345 100644
> > --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > @@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct
> > mlx5_vdpa_priv *priv)
> >
> >         if (priv->eventc)
> >                 return 0;
> > -       lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
> > +       lcore = (uint32_t)rte_get_master_lcore();
> >         if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
> >                 rte_errno = errno;
> >                 DRV_LOG(ERR, "Failed to query EQ number %d.",
> > rte_errno);
> > --
> > 2.17.1
> >
> 
> 
> --
> David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  7:19   ` Matan Azrad
@ 2020-07-28  7:25     ` David Marchand
  2020-07-28  7:30       ` Matan Azrad
  0 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2020-07-28  7:25 UTC (permalink / raw)
  To: Matan Azrad; +Cc: Xueming(Steven) Li, dev, Asaf Penso

On Tue, Jul 28, 2020 at 9:20 AM Matan Azrad <matan@mellanox.com> wrote:
>
>
>
> From: David Marchand
> > On Tue, Jul 28, 2020 at 8:11 AM Xueming Li <xuemingl@mellanox.com>
> > wrote:
> > >
> > > With latest rte api, vdpa example failed on vq setup, the api to get
> > > event queue of specified core failed.
> > >
> > > The api to get event queue needs core id as input, but after commit
> > > 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"), code
> > > of "vhost-event" thread to get current core returns -1, an invalid
> > > core id.
> > >
> > > As vhost thread created on same core of eal master core, this patch
> > > uses master core ID as a workaround.
> >
> > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL thread
> > (which has no associated lcore by default) calling this function means
> > lcore_config[-1].core_id.
>
> Deosn't lcore mean core?

No.


> So, if the private thread run on a core that opened by EAL,
> Shouldn't the API return the lcore of the private thread core?

vhost-events is a control thread.
Was it working just by chance and returning 0 before?


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  7:25     ` David Marchand
@ 2020-07-28  7:30       ` Matan Azrad
  2020-07-28  7:53         ` David Marchand
  0 siblings, 1 reply; 17+ messages in thread
From: Matan Azrad @ 2020-07-28  7:30 UTC (permalink / raw)
  To: David Marchand; +Cc: Xueming(Steven) Li, dev, Asaf Penso



From: David Marchand
> On Tue, Jul 28, 2020 at 9:20 AM Matan Azrad <matan@mellanox.com> wrote:
> >
> >
> >
> > From: David Marchand
> > > On Tue, Jul 28, 2020 at 8:11 AM Xueming Li <xuemingl@mellanox.com>
> > > wrote:
> > > >
> > > > With latest rte api, vdpa example failed on vq setup, the api to
> > > > get event queue of specified core failed.
> > > >
> > > > The api to get event queue needs core id as input, but after
> > > > commit
> > > > 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
> > > > code of "vhost-event" thread to get current core returns -1, an
> > > > invalid core id.
> > > >
> > > > As vhost thread created on same core of eal master core, this
> > > > patch uses master core ID as a workaround.
> > >
> > > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL
> > > thread (which has no associated lcore by default) calling this
> > > function means lcore_config[-1].core_id.
> >
> > Deosn't lcore mean core?
> 
> No.

So, it may be that we have more than one lcore working on a specific cpu_id?
Can you extend here?

> 
> > So, if the private thread run on a core that opened by EAL, Shouldn't
> > the API return the lcore of the private thread core?
> 
> vhost-events is a control thread.
> Was it working just by chance and returning 0 before?

Probably yes.
 
> --
> David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  7:30       ` Matan Azrad
@ 2020-07-28  7:53         ` David Marchand
  2020-07-28  8:06           ` Xueming(Steven) Li
  0 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2020-07-28  7:53 UTC (permalink / raw)
  To: Matan Azrad; +Cc: Xueming(Steven) Li, dev, Asaf Penso

On Tue, Jul 28, 2020 at 9:30 AM Matan Azrad <matan@mellanox.com> wrote:
> > > > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > > > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL
> > > > thread (which has no associated lcore by default) calling this
> > > > function means lcore_config[-1].core_id.
> > >
> > > Deosn't lcore mean core?
> >
> > No.
>
> So, it may be that we have more than one lcore working on a specific cpu_id?
> Can you extend here?

A control thread is a non-EAL thread.
A non-EAL thread has no lcore associated (unless you call the newly
added rte_thread_register API).

Not sure why you need the physical core identifier in the driver.

It is possible that non-EAL threads run on one physical core if you
start your application with the right cpuset.
But without checking, you can't make such an assumption.


>
> >
> > > So, if the private thread run on a core that opened by EAL, Shouldn't
> > > the API return the lcore of the private thread core?
> >
> > vhost-events is a control thread.
> > Was it working just by chance and returning 0 before?
>
> Probably yes.

(gdb) info symbol &lcore_config[-1].core_id
vfio_cfgs + 444820 in section .bss of
/home/dmarchan/git/pub/dpdk.org/build/app/../lib/librte_eal.so.20.0

Please, update the commitlog.
Thanks.


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  7:53         ` David Marchand
@ 2020-07-28  8:06           ` Xueming(Steven) Li
  2020-07-28  8:27             ` Matan Azrad
  0 siblings, 1 reply; 17+ messages in thread
From: Xueming(Steven) Li @ 2020-07-28  8:06 UTC (permalink / raw)
  To: David Marchand, Matan Azrad; +Cc: dev, Asaf Penso



> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, July 28, 2020 3:53 PM
> To: Matan Azrad <matan@mellanox.com>
> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>; dev <dev@dpdk.org>; Asaf
> Penso <asafp@mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost
> thread
> 
> On Tue, Jul 28, 2020 at 9:30 AM Matan Azrad <matan@mellanox.com> wrote:
> > > > > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > > > > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL
> > > > > thread (which has no associated lcore by default) calling this
> > > > > function means lcore_config[-1].core_id.
> > > >
> > > > Deosn't lcore mean core?
> > >
> > > No.
> >
> > So, it may be that we have more than one lcore working on a specific cpu_id?
> > Can you extend here?
> 
> A control thread is a non-EAL thread.

Is the default thread a control thread? After eal init, rte_lcore_to_cpu_id(-1) returns 0.

In function rte_ctrl_thread_create(), the new thread is set cpu affinity with control cpu set,
bind it same core of default control thread.

> A non-EAL thread has no lcore associated (unless you call the newly added
> rte_thread_register API).
> 
> Not sure why you need the physical core identifier in the driver.
> 
> It is possible that non-EAL threads run on one physical core if you start your
> application with the right cpuset.
> But without checking, you can't make such an assumption.
> 
> 
> >
> > >
> > > > So, if the private thread run on a core that opened by EAL,
> > > > Shouldn't the API return the lcore of the private thread core?
> > >
> > > vhost-events is a control thread.
> > > Was it working just by chance and returning 0 before?
> >
> > Probably yes.
> 
> (gdb) info symbol &lcore_config[-1].core_id vfio_cfgs + 444820 in section .bss
> of
> /home/dmarchan/git/pub/dpdk.org/build/app/../lib/librte_eal.so.20.0
> 
> Please, update the commitlog.
> Thanks.
> 
> 
> --
> David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
  2020-07-28  6:22 ` [dpdk-dev] [v1] vdpa/mlx5: use control " Xueming Li
  2020-07-28  7:08 ` [dpdk-dev] [PATCH] vdpa/mlx5: use master " David Marchand
@ 2020-07-28  8:24 ` Xueming(Steven) Li
  2020-07-28  9:22 ` [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query Xueming Li
  2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
  4 siblings, 0 replies; 17+ messages in thread
From: Xueming(Steven) Li @ 2020-07-28  8:24 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: dev, Asaf Penso

From internal discussion, we found a misuse of the vector parameter in devx_query_eqn
Function, no cpu id is required, I'll come up with another version.

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xueming Li
> Sent: Tuesday, July 28, 2020 2:11 PM
> Cc: dev@dpdk.org; Asaf Penso <asafp@mellanox.com>
> Subject: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
> 
> With latest rte api, vdpa example failed on vq setup, the api to get event queue
> of specified core failed.
> 
> The api to get event queue needs core id as input, but after commit
> 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"), code of "vhost-
> event" thread to get current core returns -1, an invalid core id.
> 
> As vhost thread created on same core of eal master core, this patch uses
> master core ID as a workaround.
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> index 13ad43611e..ff6db8e345 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> @@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct
> mlx5_vdpa_priv *priv)
> 
>  	if (priv->eventc)
>  		return 0;
> -	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
> +	lcore = (uint32_t)rte_get_master_lcore();
>  	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
>  		rte_errno = errno;
>  		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  8:06           ` Xueming(Steven) Li
@ 2020-07-28  8:27             ` Matan Azrad
  2020-07-28  8:30               ` David Marchand
  0 siblings, 1 reply; 17+ messages in thread
From: Matan Azrad @ 2020-07-28  8:27 UTC (permalink / raw)
  To: Xueming(Steven) Li, David Marchand; +Cc: dev, Asaf Penso

Hi David

We found that our kernel driver  doesn't really need it and we didn't understand
the internal API correctly.

We will create v2 as fix to the vdpa code. 

Thank you for the review!

Matan

From: Xueming(Steven) Li:
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Tuesday, July 28, 2020 3:53 PM
> > To: Matan Azrad <matan@mellanox.com>
> > Cc: Xueming(Steven) Li <xuemingl@mellanox.com>; dev <dev@dpdk.org>;
> > Asaf Penso <asafp@mellanox.com>
> > Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for
> > vhost thread
> >
> > On Tue, Jul 28, 2020 at 9:30 AM Matan Azrad <matan@mellanox.com>
> wrote:
> > > > > > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > > > > > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL
> > > > > > thread (which has no associated lcore by default) calling this
> > > > > > function means lcore_config[-1].core_id.
> > > > >
> > > > > Deosn't lcore mean core?
> > > >
> > > > No.
> > >
> > > So, it may be that we have more than one lcore working on a specific
> cpu_id?
> > > Can you extend here?
> >
> > A control thread is a non-EAL thread.
> 
> Is the default thread a control thread? After eal init, rte_lcore_to_cpu_id(-1)
> returns 0.
> 
> In function rte_ctrl_thread_create(), the new thread is set cpu affinity with
> control cpu set, bind it same core of default control thread.
> 
> > A non-EAL thread has no lcore associated (unless you call the newly
> > added rte_thread_register API).
> >
> > Not sure why you need the physical core identifier in the driver.
> >
> > It is possible that non-EAL threads run on one physical core if you
> > start your application with the right cpuset.
> > But without checking, you can't make such an assumption.
> >
> >
> > >
> > > >
> > > > > So, if the private thread run on a core that opened by EAL,
> > > > > Shouldn't the API return the lcore of the private thread core?
> > > >
> > > > vhost-events is a control thread.
> > > > Was it working just by chance and returning 0 before?
> > >
> > > Probably yes.
> >
> > (gdb) info symbol &lcore_config[-1].core_id vfio_cfgs + 444820 in
> > section .bss of
> > /home/dmarchan/git/pub/dpdk.org/build/app/../lib/librte_eal.so.20.0
> >
> > Please, update the commitlog.
> > Thanks.
> >
> >
> > --
> > David Marchand


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
  2020-07-28  8:27             ` Matan Azrad
@ 2020-07-28  8:30               ` David Marchand
  0 siblings, 0 replies; 17+ messages in thread
From: David Marchand @ 2020-07-28  8:30 UTC (permalink / raw)
  To: Matan Azrad; +Cc: Xueming(Steven) Li, dev, Asaf Penso

On Tue, Jul 28, 2020 at 10:27 AM Matan Azrad <matan@mellanox.com> wrote:
> We found that our kernel driver  doesn't really need it and we didn't understand
> the internal API correctly.
>
> We will create v2 as fix to the vdpa code.

Ok cool.

>
> Thank you for the review!

No problem, I was scared of a regression in EAL :-).


-- 
David Marchand


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

* [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query
  2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
                   ` (2 preceding siblings ...)
  2020-07-28  8:24 ` Xueming(Steven) Li
@ 2020-07-28  9:22 ` Xueming Li
  2020-07-28 12:05   ` David Marchand
  2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
  4 siblings, 1 reply; 17+ messages in thread
From: Xueming Li @ 2020-07-28  9:22 UTC (permalink / raw)
  Cc: dev, Asaf, Penso <asafp

With latest rte api, vdpa example failed on vq setup, the api to get
event queue of specified core failed.

After
commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
code of "vhost-event" thread to get current cpu id returns -1.

On the other hand, internal api devx_query_eqn expects index of event
queue vectors, no need to use cpu id. As the doorbell handling thread is
per device, it's sufficient to use default event queue.

This patch uses the default id(0) as event queue index.

Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 13ad43611e..159831920f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -51,12 +51,9 @@ mlx5_vdpa_event_qp_global_release(struct mlx5_vdpa_priv *priv)
 static int
 mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
 {
-	uint32_t lcore;
-
 	if (priv->eventc)
 		return 0;
-	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
-	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
+	if (mlx5_glue->devx_query_eqn(priv->ctx, 0, &priv->eqn)) {
 		rte_errno = errno;
 		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
 		return -1;
-- 
2.17.1


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

* Re: [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query
  2020-07-28  9:22 ` [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query Xueming Li
@ 2020-07-28 12:05   ` David Marchand
  2020-07-28 12:26     ` Xueming(Steven) Li
  0 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2020-07-28 12:05 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, Asaf, Maxime Coquelin

On Tue, Jul 28, 2020 at 11:23 AM Xueming Li <xuemingl@mellanox.com> wrote:
>
> With latest rte api, vdpa example failed on vq setup, the api to get
> event queue of specified core failed.
>
> After
> commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
> code of "vhost-event" thread to get current cpu id returns -1.
>

This is how you figured this problem, but the first part of the
commitlog gives the impression there is a regression in the EAL.
I would prefer it is removed (maybe simply when applying?).


> On the other hand, internal api devx_query_eqn expects index of event
> queue vectors, no need to use cpu id. As the doorbell handling thread is
> per device, it's sufficient to use default event queue.
>
> This patch uses the default id(0) as event queue index.
>
> Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>


Thanks.

-- 
David Marchand


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

* Re: [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query
  2020-07-28 12:05   ` David Marchand
@ 2020-07-28 12:26     ` Xueming(Steven) Li
  0 siblings, 0 replies; 17+ messages in thread
From: Xueming(Steven) Li @ 2020-07-28 12:26 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Asaf, Maxime Coquelin



> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, July 28, 2020 8:05 PM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>
> Cc: dev <dev@dpdk.org>; Asaf@dpdk.org; Maxime Coquelin
> <maxime.coquelin@redhat.com>
> Subject: Re: [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query
> 
> On Tue, Jul 28, 2020 at 11:23 AM Xueming Li <xuemingl@mellanox.com> wrote:
> >
> > With latest rte api, vdpa example failed on vq setup, the api to get
> > event queue of specified core failed.
> >
> > After
> > commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL
> > threads"), code of "vhost-event" thread to get current cpu id returns -1.
> >
> 
> This is how you figured this problem, but the first part of the commitlog gives
> the impression there is a regression in the EAL.
> I would prefer it is removed (maybe simply when applying?).

NP, sorry for the confusing.

> 
> 
> > On the other hand, internal api devx_query_eqn expects index of event
> > queue vectors, no need to use cpu id. As the doorbell handling thread
> > is per device, it's sufficient to use default event queue.
> >
> > This patch uses the default id(0) as event queue index.
> >
> > Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > Acked-by: Matan Azrad <matan@mellanox.com>
> 
> 
> Thanks.
> 
> --
> David Marchand


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

* [dpdk-dev] [v3] vdpa/mlx5: fix event queue number query
  2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
                   ` (3 preceding siblings ...)
  2020-07-28  9:22 ` [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query Xueming Li
@ 2020-07-28 12:32 ` Xueming Li
  2020-07-28 14:04   ` Maxime Coquelin
  2020-07-28 15:55   ` Maxime Coquelin
  4 siblings, 2 replies; 17+ messages in thread
From: Xueming Li @ 2020-07-28 12:32 UTC (permalink / raw)
  Cc: dev, Asaf, Penso <asafp

Vdpa example failed on vq setup, the api to get event queue of specified
core failed.

Internal api devx_query_eqn expects index of event queue vectors, no
need to use cpu id. As the doorbell handling thread is per device, it's
sufficient to use default event queue.

This patch uses the default id(0) as event queue index.

Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 13ad43611e..159831920f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -51,12 +51,9 @@ mlx5_vdpa_event_qp_global_release(struct mlx5_vdpa_priv *priv)
 static int
 mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
 {
-	uint32_t lcore;
-
 	if (priv->eventc)
 		return 0;
-	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
-	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
+	if (mlx5_glue->devx_query_eqn(priv->ctx, 0, &priv->eqn)) {
 		rte_errno = errno;
 		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
 		return -1;
-- 
2.17.1


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

* Re: [dpdk-dev] [v3] vdpa/mlx5: fix event queue number query
  2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
@ 2020-07-28 14:04   ` Maxime Coquelin
  2020-07-28 15:55   ` Maxime Coquelin
  1 sibling, 0 replies; 17+ messages in thread
From: Maxime Coquelin @ 2020-07-28 14:04 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, Asaf, Penso <asafp



On 7/28/20 2:32 PM, Xueming Li wrote:
> Vdpa example failed on vq setup, the api to get event queue of specified
> core failed.
> 
> Internal api devx_query_eqn expects index of event queue vectors, no
> need to use cpu id. As the doorbell handling thread is per device, it's
> sufficient to use default event queue.
> 
> This patch uses the default id(0) as event queue index.
> 
> Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [dpdk-dev] [v3] vdpa/mlx5: fix event queue number query
  2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
  2020-07-28 14:04   ` Maxime Coquelin
@ 2020-07-28 15:55   ` Maxime Coquelin
  1 sibling, 0 replies; 17+ messages in thread
From: Maxime Coquelin @ 2020-07-28 15:55 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, Asaf, Penso <asafp



On 7/28/20 2:32 PM, Xueming Li wrote:
> Vdpa example failed on vq setup, the api to get event queue of specified
> core failed.
> 
> Internal api devx_query_eqn expects index of event queue vectors, no
> need to use cpu id. As the doorbell handling thread is per device, it's
> sufficient to use default event queue.
> 
> This patch uses the default id(0) as event queue index.
> 
> Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied to dpdk-next-virtio/master

Thanks,
Maxime


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

end of thread, other threads:[~2020-07-28 15:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
2020-07-28  6:22 ` [dpdk-dev] [v1] vdpa/mlx5: use control " Xueming Li
2020-07-28  7:08 ` [dpdk-dev] [PATCH] vdpa/mlx5: use master " David Marchand
2020-07-28  7:19   ` Matan Azrad
2020-07-28  7:25     ` David Marchand
2020-07-28  7:30       ` Matan Azrad
2020-07-28  7:53         ` David Marchand
2020-07-28  8:06           ` Xueming(Steven) Li
2020-07-28  8:27             ` Matan Azrad
2020-07-28  8:30               ` David Marchand
2020-07-28  8:24 ` Xueming(Steven) Li
2020-07-28  9:22 ` [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query Xueming Li
2020-07-28 12:05   ` David Marchand
2020-07-28 12:26     ` Xueming(Steven) Li
2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
2020-07-28 14:04   ` Maxime Coquelin
2020-07-28 15:55   ` Maxime Coquelin

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