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 ECDD1A00BE; Wed, 30 Oct 2019 07:57:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BC31C1BED1; Wed, 30 Oct 2019 07:57:57 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3DFEB271 for ; Wed, 30 Oct 2019 07:57:56 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2019 23:57:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,246,1569308400"; d="scan'208";a="374800262" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by orsmga005.jf.intel.com with ESMTP; 29 Oct 2019 23:57:54 -0700 Date: Wed, 30 Oct 2019 14:58:45 +0800 From: Tiwei Bie To: Marvin Liu Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, amorenoz@redhat.com, dev@dpdk.org Message-ID: <20191030065844.GA14969@___> References: <20191025162042.71687-1-yong.liu@intel.com> <20191030110723.20195-1-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191030110723.20195-1-yong.liu@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] vhost: fix vhost user virtqueue not accessible 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 Wed, Oct 30, 2019 at 07:07:23PM +0800, Marvin Liu wrote: > Log feature is disabled in vhost user, so that log address was invalid > when checking. Check whether log address is valid can workaround it. > Also log address should be translated in packed ring virtqueue. > > Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa") > > Signed-off-by: Marvin Liu > --- > lib/librte_vhost/vhost_user.c | 30 +++++++++++++----------------- > 1 file changed, 13 insertions(+), 17 deletions(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 61ef699ac..759cc795c 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -641,11 +641,23 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) > struct vhost_vring_addr *addr = &vq->ring_addrs; > uint64_t len, expected_len; > > + dev = numa_realloc(dev, vq_index); > + vq = dev->virtqueue[vq_index]; > + if (addr->log_guest_addr) { Please use VHOST_VRING_F_LOG to check whether log address is valid or not. Thanks, Tiwei