From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0CC19A046B for ; Tue, 25 Jun 2019 05:57:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F07F91BC15; Tue, 25 Jun 2019 05:57:20 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0E17B1BC0C for ; Tue, 25 Jun 2019 05:57:18 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5P3uvve030204; Mon, 24 Jun 2019 20:57:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=1JfbAjLpY1CRLRZF5IeSTP7ohMoWP0e2Wumm/M39mMs=; b=d/DoFIrCV+PEtBM6ROr6Bi8NXLD4h8n//hNoemcJnpjQyadGz4Tp1JbM25NCYu1DKHkV F9LOE6zBPnePGXrA2B44TFME79dxt0/KaumraK5z81djnxbBPM49KpO5FOKHUXCjBM7z l5GbpsTS7uvfY7nouHCM5hLypk98Pm8fn5WLCYx1SyxN8mFrIhx80Yu1VinN/QNkxr3u XAhhcJfWymcyVJbeHWLQ//0D6lSgU/GwObXhfcoUmRktiDNYqDqSw9AH0T4K5XvWP5GB 97D386Fbzw4wQcYsUK22zfrZjjl9uoHXbDAtuuAOswPM85Ehiqc9sZQJBYXJQ8Kk1wzb qQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2tb9wx8e5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Jun 2019 20:57:17 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 24 Jun 2019 20:57:15 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 24 Jun 2019 20:57:15 -0700 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id 75ACA3F7040; Mon, 24 Jun 2019 20:57:13 -0700 (PDT) From: To: CC: , , , Vamsi Attunuru Date: Tue, 25 Jun 2019 09:26:58 +0530 Message-ID: <20190625035700.2953-3-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20190625035700.2953-1-vattunuru@marvell.com> References: <20190422061533.17538-1-kirankumark@marvell.com> <20190625035700.2953-1-vattunuru@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-25_02:, , signatures=0 Subject: [dpdk-dev] [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" 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; -- 2.8.4