[dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread
Xueming(Steven) Li
xuemingl at mellanox.com
Tue Jul 28 10:24:07 CEST 2020
>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 at dpdk.org> On Behalf Of Xueming Li
> Sent: Tuesday, July 28, 2020 2:11 PM
> Cc: dev at dpdk.org; Asaf Penso <asafp at 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 at mellanox.com>
> Acked-by: Matan Azrad <matan at 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
More information about the dev
mailing list