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 04980A0471 for ; Fri, 16 Aug 2019 08:14:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96AA21BF0D; Fri, 16 Aug 2019 08:13:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id BB69B1BF05 for ; Fri, 16 Aug 2019 08:13:35 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7G6AAvK008470; Thu, 15 Aug 2019 23:13:35 -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=tuUyYzpIdylKJpGsjPtp7dnaL1HIOKtWwcwS/BkmO/0=; b=Jwz/5LT0+sn02c6XYf2fCePBzNNczO+EigJMOxio6pFWg2BWFK1Lnx7/Lc+9mXhStYVl jZrNC+D4iAIOTkbvZr98p7jqS/iHPfyi4Sa1PepzBzXPEQbuHFU1Fc3YRPNqhcpWHrcE w2yc1mrZ7V1WrDkjMQXfOI2OlfwgyvZ4WiLvbdW0RIPRXG5TzDxfie+w91sDAb5Shvjd 4+12H24xYAgEIPl/DZ7lg+E1cHMVlURSR5RoACc0m35L8MWXsopxw/+gz6wHqeSomU6e CHh1i/zfyySwtTRlrrXDp1V/sGberPn2PpoWXCJKG4ICTKwgbGvnk/ctgLy8cr4jZBFJ xA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2udefw1mea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 15 Aug 2019 23:13:35 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 15 Aug 2019 23:13:33 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 15 Aug 2019 23:13:33 -0700 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id E193F3F7041; Thu, 15 Aug 2019 23:13:29 -0700 (PDT) From: To: CC: , , , , , , , Vamsi Attunuru Date: Fri, 16 Aug 2019 11:42:52 +0530 Message-ID: <20190816061252.17214-6-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20190816061252.17214-1-vattunuru@marvell.com> References: <20190729121313.30639-2-vattunuru@marvell.com> <20190816061252.17214-1-vattunuru@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-16_03:2019-08-14,2019-08-16 signatures=0 Subject: [dpdk-dev] [PATCH v10 5/5] kni: modify IOVA mode checks to support VA 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 Patch addresses checks in KNI and eal that enforce IOVA=PA when IOVA=VA mode is enabled, since KNI kernel module supports VA mode for kernel versions >= 4.4.0. Updated KNI documentation with above details. Signed-off-by: Vamsi Attunuru Signed-off-by: Kiran Kumar K --- doc/guides/prog_guide/kernel_nic_interface.rst | 8 ++++++++ lib/librte_eal/linux/eal/eal.c | 4 +++- lib/librte_kni/rte_kni.c | 5 ----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst index 38369b3..fd2ce63 100644 --- a/doc/guides/prog_guide/kernel_nic_interface.rst +++ b/doc/guides/prog_guide/kernel_nic_interface.rst @@ -291,6 +291,14 @@ The sk_buff is then freed and the mbuf sent in the tx_q FIFO. The DPDK TX thread dequeues the mbuf and sends it to the PMD via ``rte_eth_tx_burst()``. It then puts the mbuf back in the cache. +IOVA = VA: Support +------------------ + +KNI can be operated in IOVA as VA scheme when following criteria are fullfilled + +- LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) +- eal param `--iova-mode va` is passed or bus IOVA scheme is set to RTE_IOVA_VA + Ethtool ------- diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index 946222c..73d64c8 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1114,12 +1114,14 @@ rte_eal_init(int argc, char **argv) /* Workaround for KNI which requires physical address to work */ if (iova_mode == RTE_IOVA_VA && rte_eal_check_module("rte_kni") == 1) { +#if KERNEL_VERSION(4, 4, 0) > LINUX_VERSION_CODE if (phys_addrs) { iova_mode = RTE_IOVA_PA; - RTE_LOG(WARNING, EAL, "Forcing IOVA as 'PA' because KNI module is loaded\n"); + RTE_LOG(WARNING, EAL, "Forcing IOVA as 'PA' because KNI module does not support VA\n"); } else { RTE_LOG(DEBUG, EAL, "KNI can not work since physical addresses are unavailable\n"); } +#endif } #endif rte_eal_get_configuration()->iova_mode = iova_mode; diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 15dda45..c77d76f 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -99,11 +99,6 @@ static volatile int kni_fd = -1; int rte_kni_init(unsigned int max_kni_ifaces __rte_unused) { - if (rte_eal_iova_mode() != RTE_IOVA_PA) { - RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n"); - return -1; - } - /* Check FD and open */ if (kni_fd < 0) { kni_fd = open("/dev/" KNI_DEVICE, O_RDWR); -- 2.8.4