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 910E7A2EDB for ; Fri, 6 Sep 2019 15:25:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1868B91; Fri, 6 Sep 2019 15:25:50 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 059E01F3EE for ; Fri, 6 Sep 2019 15:25:48 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6272D189DACE; Fri, 6 Sep 2019 13:25:47 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4DDE600CC; Fri, 6 Sep 2019 13:25:46 +0000 (UTC) From: Aaron Conole To: Andy Pei Cc: dev@dpdk.org, rosen.xu@intel.com, xiaolong.ye@intel.com, tiwei.bie@intel.com, xiao.w.wang@intel.com References: <1567740051-367172-1-git-send-email-andy.pei@intel.com> Date: Fri, 06 Sep 2019 09:25:45 -0400 In-Reply-To: <1567740051-367172-1-git-send-email-andy.pei@intel.com> (Andy Pei's message of "Fri, 6 Sep 2019 11:20:48 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 06 Sep 2019 13:25:47 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/4] vhost: introduce new API to get the active vring number 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" Andy Pei writes: > It's useful for hardware vhost backend (like vDPA devices) to set > multiqueue configuration accordingly. > > Signed-off-by: Xiaolong Ye > Signed-off-by: Andy Pei > --- I think there's something wrong with this patch - I see the following error after all the patches are applied: drivers/a715181@@tmp_rte_pmd_ifc@sta/net_ifc_ifcvf_vdpa.c.o: In function `ifcvf_set_vring_state': ifcvf_vdpa.c:(.text+0x1157): undefined reference to `rte_vhost_get_active_vring_num' Looking at the linker line, I see that librte_vhost is being included. Is it possible that you need to make an export for this? Travis build: https://travis-ci.com/ovsrobot/dpdk/jobs/231687745 Possibly, this is because the robot needs to call the right script to apply to a -next tree. I'd be a little surprised, though. > lib/librte_vhost/rte_vhost.h | 12 ++++++++++++ > lib/librte_vhost/vhost.c | 19 +++++++++++++++++++ > 2 files changed, 31 insertions(+) > > diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h > index 7fb1729..28811b0 100644 > --- a/lib/librte_vhost/rte_vhost.h > +++ b/lib/librte_vhost/rte_vhost.h > @@ -525,6 +525,18 @@ int rte_vhost_driver_callback_register(const char *path, > uint16_t rte_vhost_get_vring_num(int vid); > > /** > + * Get the number of active vrings of the device. > + * > + * @param vid > + * vhost device ID > + * > + * @return > + * The number of active vrings, 0 on failure > + */ > +uint16_t > +rte_vhost_get_active_vring_num(int vid); > + > +/** > * Get the virtio net device's ifname, which is the vhost-user socket > * file path. > * > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c > index 981837b..c714818 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -674,6 +674,25 @@ > return dev->nr_vring; > } > > +uint16_t > +rte_vhost_get_active_vring_num(int vid) > +{ > + struct virtio_net *dev = get_device(vid); > + struct vhost_virtqueue *vq; > + uint16_t qid; > + > + if (dev == NULL) > + return 0; > + > + for (qid = 0; qid < dev->nr_vring; qid++) { > + vq = dev->virtqueue[qid]; > + if (!vq->enabled) > + break; > + } > + > + return qid; > +} > + > int > rte_vhost_get_ifname(int vid, char *buf, size_t len) > {