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 54DD3A046B for ; Wed, 26 Jun 2019 16:58:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 15AEC28EE; Wed, 26 Jun 2019 16:58:52 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 6B5B71E25 for ; Wed, 26 Jun 2019 16:58:50 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id w10so1344987pgj.7 for ; Wed, 26 Jun 2019 07:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XdVj+QndLATSc0MLuzaFE6ayY2oREBqt5m1r2usrc5I=; b=JdWHPw83MBDI8/x/0A7hBGY7BQsBrl2L1jQJtZZqzW1/m5NWnXy9YTFOn3KWFMvlPf PuF+YGUo5auQhbMA/2VBeqDDonKnBmb4YVx136lxd2FRatcZ6tFOkIidzALEZPYHXpaL oN0oOTkslPO2x1dGHRzPD/IzV1PmJyscMikvy85J5Iz9fA0LSFj5bz8Xe6b4OKcVYHWt 14/IIkeP2a3ANGyq4uXa4JIZmPREIsAYs3JoZsp4SHtf3wlw/HLKpFk/Sno+Sw9XRnjv 5KhESZOX3BqBsrn2Qh5qzsFl63enRFFGm19lOky1MRqOYWyark9RRN6Ru3dGTQ8Ve3Wx GkhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XdVj+QndLATSc0MLuzaFE6ayY2oREBqt5m1r2usrc5I=; b=qiHUVzReUvyz98Si56IWXpOn36uLjbrRqaRcz1Y/i1JCIyVLhWE1Jqv1S7EQFFgzQS gafFolAh8z4o7yiUeSlKd0e1S9Y1KyMX+z+PkwG6Nb9S2b+o1ZtdS7QjOLct+AMVY+s2 KNeEiNZxm3gXite3eGL6zSRWBANnGYTpuBgOHpn9O5xFxRQ5u0px8EilJG65t5HMJGb6 XxrSiGMpjcWVihJFfgT0s56XENpbQvn3kyNLC/eH3y9p+pn0QBwFu5pCYwM8oQWQpIpf cqoxCLrtR4q6cPLKqwQUHK/fQD9qXDZGGsr+4WO4yQTHMoRq1YGQQFYWR1PPX+smotZI U+6Q== X-Gm-Message-State: APjAAAXerbWkoCJrxwNQZqu1zDYwEqLW49AWPVUdNn0oGfsBXSIAOoYb A9gBKg8sIU5b6rQ39rbBLB+BTw== X-Google-Smtp-Source: APXvYqyGenDdHG91S7gMkgs96nxU3cT4UOuR08BJdJdFem8MizB55itPnbzC4EAvEkFuIgMOrdYREw== X-Received: by 2002:a17:90a:d997:: with SMTP id d23mr5017949pjv.84.1561561129463; Wed, 26 Jun 2019 07:58:49 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l23sm16751568pgh.68.2019.06.26.07.58.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 07:58:49 -0700 (PDT) Date: Wed, 26 Jun 2019 07:58:42 -0700 From: Stephen Hemminger To: Vamsi Krishna Attunuru Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" , "olivier.matz@6wind.com" , "arybchenko@solarflare.com" Message-ID: <20190626075842.169982f1@hermes.lan> In-Reply-To: References: <20190422061533.17538-1-kirankumark@marvell.com> <20190625035700.2953-1-vattunuru@marvell.com> <20190625035700.2953-3-vattunuru@marvell.com> <20190625104130.7e0c681e@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v6 2/4] lib/kni: add PCI related information 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, 26 Jun 2019 03:48:12 +0000 Vamsi Krishna Attunuru wrote: > ________________________________ > From: Stephen Hemminger > Sent: Tuesday, June 25, 2019 11:11 PM > To: Vamsi Krishna Attunuru > Cc: dev@dpdk.org; ferruh.yigit@intel.com; olivier.matz@6wind.com; arybchenko@solarflare.com > Subject: [EXT] Re: [dpdk-dev] [PATCH v6 2/4] lib/kni: add PCI related information > > External Email > > ---------------------------------------------------------------------- > On Tue, 25 Jun 2019 09:26:58 +0530 > wrote: > > > From: Vamsi Attunuru > > > > PCI related information is needed in KNI kernel module, > > since it requires iommu domain info for address > > translations(using iommu_iova_to_phys() call) when > > KNI runs in IOVA = VA mode. > > > > Signed-off-by: Vamsi Attunuru > > --- > > lib/librte_eal/linux/eal/include/rte_kni_common.h | 7 +++++++ > > lib/librte_kni/rte_kni.c | 5 +++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h b/lib/librte_eal/linux/eal/include/rte_kni_common.h > > index 91a1c14..5db5a13 100644 > > --- a/lib/librte_eal/linux/eal/include/rte_kni_common.h > > +++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h > > @@ -111,6 +111,13 @@ struct rte_kni_device_info { > > void * mbuf_va; > > phys_addr_t mbuf_phys; > > > > + /* PCI info */ > > + uint16_t vendor_id; /**< Vendor ID or PCI_ANY_ID. */ > > + uint16_t device_id; /**< Device ID or PCI_ANY_ID. */ > > + uint8_t bus; /**< Device bus */ > > + uint8_t devid; /**< Device ID */ > > + uint8_t function; /**< Device function. */ > > + > > uint16_t group_id; /**< Group ID */ > > uint32_t core_id; /**< core ID to bind for kernel thread */ > > > > diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c > > index e29d0cc..99c4bf5 100644 > > --- a/lib/librte_kni/rte_kni.c > > +++ b/lib/librte_kni/rte_kni.c > > @@ -242,6 +242,11 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool, > > kni->ops.port_id = UINT16_MAX; > > > > memset(&dev_info, 0, sizeof(dev_info)); > > + dev_info.bus = conf->addr.bus; > > + dev_info.devid = conf->addr.devid; > > + dev_info.function = conf->addr.function; > > + dev_info.vendor_id = conf->id.vendor_id; > > + dev_info.device_id = conf->id.device_id; > > dev_info.core_id = conf->core_id; > > dev_info.force_bind = conf->force_bind; > > dev_info.group_id = conf->group_id; > > > NAK > > Why is PCI info part of KNI. KNI can be used with non-PCI devices now > > Kernel KNI module needs device info(PCI in this case) to figure out iommu domain details to work with IOVA=VA mode and the struct rte_kni_device_info only carries KNI device info to the kernel module, if not here, where do you suggest me to put this info. The kernel KNI driver works as is with netvsc PMD (which is vmbus). Your code may break that. If needs to work for both.