From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80080A0521; Tue, 28 Jul 2020 09:08:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABBD51C113; Tue, 28 Jul 2020 09:08:21 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 52D291C10F for ; Tue, 28 Jul 2020 09:08:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595920099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=l2UzVD/yxDeNq80SDICy4e+bjRWOd5VYgC6yUZv7Zzw=; b=jNzvDJpHQA63+dmL7T7v7dsZEXUNE3sTxmzztHUF+Ra+BODpGmIaps0JhznwlcSocShFDM qY5xaNWOFJh200xKiM0JbmrF8c+kEz0JkyztPM0CO7RWPuYYyLzK6WG0D3071zEIQ9OiDv t92jFzOGT//NprfqLuUsiHTI4cNFlMM= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-_H9EVHa9PGa6HVwmbs-HBA-1; Tue, 28 Jul 2020 03:08:17 -0400 X-MC-Unique: _H9EVHa9PGa6HVwmbs-HBA-1 Received: by mail-vk1-f200.google.com with SMTP id x192so6216961vkx.19 for ; Tue, 28 Jul 2020 00:08:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l2UzVD/yxDeNq80SDICy4e+bjRWOd5VYgC6yUZv7Zzw=; b=fGNiSXYroj9cmssQAaOfcnK0J3s6SguhG5XczNZJ42ktL/cWXPX+37yCgT7S6lpkkd Iyedk8pLrkBJALjH5axWMnMA2uYJBgs1ysoz7/iyeZzou5WXsJElnuHenlsOGX83Pe5z bwERz2h6ogdvvoJ11FIXv2uwM5atpmX0veWV3y+zrH6S/Lah7JvrIbr1YMkpBmTbBc40 Aluat75EbbC65JL6I9nvSr1JPFZS63k0J8SuYJV2P0Ngo8J+sPWl4Ej2XQ/QN9I3g6Xr 3dQsAeZFTyEOt8bDSenb6fdg2vy+anyfqf/+IIm9w7cMCMvSgtNqJjFYQX5Dvw49BBgs FmFg== X-Gm-Message-State: AOAM531bT7tKQ9XOgux93SJrjbef3Lc+P3/Rd5aaDfb+RORpwecIPF8z 1O13b7mtUTEuSPY2AdGQhXaSZvW28bWBk0LwMgnVEll7m3eLYvbowLjj4fmy0c5QiYwJaTHPirP ZvP204SOk+4Z5+U44C9o= X-Received: by 2002:a67:2d4f:: with SMTP id t76mr19643741vst.105.1595920097293; Tue, 28 Jul 2020 00:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7ooMcPs8SaRuA4Mri/UNVmQ9ngtY1GaSpULHUNBLZ1xLcVj5tdRxpG3bp+aLJWN7blhRxlNJNhOkTb6RUMD8= X-Received: by 2002:a67:2d4f:: with SMTP id t76mr19643730vst.105.1595920096987; Tue, 28 Jul 2020 00:08:16 -0700 (PDT) MIME-Version: 1.0 References: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com> In-Reply-To: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com> From: David Marchand Date: Tue, 28 Jul 2020 09:08:05 +0200 Message-ID: To: Xueming Li Cc: dev , Asaf Penso , Matan Azrad X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jul 28, 2020 at 8:11 AM Xueming Li 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 > Acked-by: Matan Azrad > --- > 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