From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 9DB8B691A for ; Wed, 14 Sep 2016 10:35:55 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id l68so4558081wml.1 for ; Wed, 14 Sep 2016 01:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Uq1QOFRahjB8beaKTjcdFQFmaOJMYko4kiuqIJPqj0=; b=e03xF2Bp0UpkfaMXC86thfvwWc5Y0KuMCppOA3Otbg32T7XZWPIL5Z9v3zgCUrkqkX CinEX4jI6ym/adOt+fbW3Kpkqjt0TLn/1CrnUsmfPvo5FzG2b2aSdSOiocgb7FCVlTN8 0bPHGn/aM/36kvRYJhIIBWuCsxh1qmMccST3/PbY04R2ywE0jkNtMwEriWaEA7ETtyS5 z2DjaGz6lHnSZWCnKnhv5Ks2EBf439Z1/ZimVOohCzLKOzPyprTJAytJ4LpKEpWykbBU AJdPzxbKouG1FnHCXBH25TdlS0N9MKsURpht1SDqiojY/f6dzlnPlcysY6nOXbaAlhpn H9BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=6Uq1QOFRahjB8beaKTjcdFQFmaOJMYko4kiuqIJPqj0=; b=V1ufG4r4F++s/oGn8Etxkjjx2tJrIb5UxREtEdxYGw9hsCkJPdSjZlkcF2gFKdmgYS hjrz0hf8a43STZox8RKlzINWLbvGLtG+RD1Xnnuefyt6WSFHPS+xs0QPyUbmZypBIbcj 8w69C7tzdk50cnTVAyV6b8yYrNbXflhuqTGip4IW7+TRfRM0pwl8gD8jmc+UVpUhSYVX dF5b+Eo2ca+FhtZApFtsSBNKKo6tAA8aszzvuXq8eclqGIY5rvOR6fl/qU3QcfYDeOSA wBLQnlN19UhMGuf3eeQQ5LTjuOB/UpR/E/e0OCub9JGR+FnhufcyIICQHBwS8JjHFJIV emqQ== X-Gm-Message-State: AE9vXwNbIl0rGVsSft2XDkTrh1vPaxm8aWGw0m0HcCaogCaPdN5Zxyr8m1IQ3rQSTEz/ZeCU X-Received: by 10.28.131.208 with SMTP id f199mr1748886wmd.116.1473842155431; Wed, 14 Sep 2016 01:35:55 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id bc5sm2932823wjb.37.2016.09.14.01.35.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 01:35:54 -0700 (PDT) From: Thomas Monjalon To: Yuanhan Liu Cc: Ciara Loftus , dev@dpdk.org Date: Wed, 14 Sep 2016 10:35:53 +0200 Message-ID: <2149205.E6pxXR7o4C@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20160914072118.GA23158@yliu-dev.sh.intel.com> References: <1473774463-26966-1-git-send-email-ciara.loftus@intel.com> <1934917.EiaaJTRqAq@xps13> <20160914072118.GA23158@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] net/vhost: Add function to retreive the 'vid' for a given port id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 08:35:55 -0000 2016-09-14 15:21, Yuanhan Liu: > On Wed, Sep 14, 2016 at 09:10:48AM +0200, Thomas Monjalon wrote: > > 2016-09-14 12:43, Yuanhan Liu: > > > On Tue, Sep 13, 2016 at 05:10:09PM +0200, Thomas Monjalon wrote: > > > > 2016-09-13 14:47, Ciara Loftus: > > > > > In some cases when using the vHost PMD, certain vHost library functions > > > > > may still need to be accessed. One such example is the > > > > > rte_vhost_get_queue_num function which returns the number of virtqueues > > > > > reported by the guest - information which is not exposed by the PMD. > > > > > > > > > > This commit introduces a new rte_eth_vhost function that returns the > > > > > 'vid' associated with a given port id. This allows the PMD user to call > > > > > vHost library functions which require the 'vid' value. > > > > > > > > I think we should not add any API to the PMDs. > > > > > > In general, I agree with you. > > > > > > > Maybe you are looking for a generic API in ethdev. > > > > > > But maybe it's a bit hard to define a "right" generic API here. For this > > > case, the generic API I can think of could be: > > > > > > - an API to get queue num, like rte_eth_get_queue_enabled_num > > > I barely know NIC pmd drivers, but I doubt it's useful/meaningful for them. > > > > > > - an API to get a PMD driver private (or specific) data. > > > For vhost-pmd, it's vid. Again, I don't know what it could be for other nic > > > drivers. > > > > > > This one may be a better option here, because it expose a key field to > > > the application, vid, with which the application can invoke more vhost > > > APIs. And apparently, it's not feasible to try to define a generic API > > > for some (if not each) vhost APIs. > > > > There could be a similar need in other PMD. > > If we can get an opaque identifier of the device which is not the port id, > > we could call some specific functions of the driver not implemented in > > the generic ethdev API. > > That means you have to add/export the PMD API first. Isn't it against what > you are proposing -- "I think we should not add any API to the PMDs" ;) Yes you are totally right :) Except that in vhost case, we would not have any API in the PMD. But it would allow to have some specific API in other PMDs for the features which do not fit in a generic API. Just a thought, not sure yet.