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 47742A2EFC for ; Tue, 17 Sep 2019 11:25:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 156421C00F; Tue, 17 Sep 2019 11:25:56 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6B1E61C00E for ; Tue, 17 Sep 2019 11:25:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 02:25:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,515,1559545200"; d="scan'208";a="216507578" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 17 Sep 2019 02:25:53 -0700 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Sep 2019 02:25:53 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Sep 2019 02:25:52 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.23]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.32]) with mapi id 14.03.0439.000; Tue, 17 Sep 2019 17:25:51 +0800 From: "Pei, Andy" To: Aaron Conole CC: "dev@dpdk.org" , "Xu, Rosen" , "Ye, Xiaolong" , "Bie, Tiwei" , "Wang, Xiao W" Thread-Topic: [dpdk-dev] [PATCH 1/4] vhost: introduce new API to get the active vring number Thread-Index: AQHVZLafv5ZhBT6FIkyoePnh/2SlWKcvqeRQ Date: Tue, 17 Sep 2019 09:25:50 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB01072F9D@SHSMSX105.ccr.corp.intel.com> References: <1567740051-367172-1-git-send-email-andy.pei@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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" Hi Aaron, I try to solve this by avoiding exposing this new API. Hope this works. BRs, -----Original Message----- From: Aaron Conole [mailto:aconole@redhat.com]=20 Sent: Friday, September 6, 2019 9:26 PM To: Pei, Andy Cc: dev@dpdk.org; Xu, Rosen ; Ye, Xiaolong ; Bie, Tiwei ; Wang, Xiao W Subject: Re: [dpdk-dev] [PATCH 1/4] vhost: introduce new API to get the act= ive vring number Andy Pei writes: > It's useful for hardware vhost backend (like vDPA devices) to set=20 > 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_activ= e_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=20 > 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=20 > *path, uint16_t rte_vhost_get_vring_num(int vid); > =20 > /** > + * 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=20 > +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=20 > 981837b..c714818 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -674,6 +674,25 @@ > return dev->nr_vring; > } > =20 > +uint16_t > +rte_vhost_get_active_vring_num(int vid) { > + struct virtio_net *dev =3D get_device(vid); > + struct vhost_virtqueue *vq; > + uint16_t qid; > + > + if (dev =3D=3D NULL) > + return 0; > + > + for (qid =3D 0; qid < dev->nr_vring; qid++) { > + vq =3D dev->virtqueue[qid]; > + if (!vq->enabled) > + break; > + } > + > + return qid; > +} > + > int > rte_vhost_get_ifname(int vid, char *buf, size_t len) {