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 11D0CA0487 for ; Mon, 29 Jul 2019 14:15:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C2711BF6E; Mon, 29 Jul 2019 14:13:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 611D71BF51 for ; Mon, 29 Jul 2019 14:13:49 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6TCAOPx027447; Mon, 29 Jul 2019 05:13:47 -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=gpbLxqJAkOvx79mmhbKBWdL78pgaTGoUMwxzEdCMjXo=; b=K8ixG2j4/On8LAZFz003fjlx2UxUYxolVoUEZRJvsb6kRiNRxofTA5O+NuDtivXasNJv AZ3DSGTMAt5vzK/J8swQB27Xm7RzAWGEG/LCNAdW8kNUFZx2ucinF7ZR6mOjAoV0kk0C Ct+YlzWTyBwIBrhEyvSUwmPBk+NtsY6btqBgNRNUrjClR5QEeAGbgiSH/Us6cZjvVrPG w+M3qhWJmbwN8AddmCrgDsMlTluB1svDoPQCrfHAJgALfHIJvIm4R0egSFBTdfFYnhhK 61dzOhM3vDEh7tQlGG3NIcPuPdHJDBZGm/JuVAK5CaQb2cT0iD+3Dtzlk7peAs+d4i1a pw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2u0kyq0183-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 29 Jul 2019 05:13:47 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 29 Jul 2019 05:13:46 -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; Mon, 29 Jul 2019 05:13:46 -0700 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id 81B0B3F703F; Mon, 29 Jul 2019 05:13:43 -0700 (PDT) From: To: CC: , , , , , , , Vamsi Attunuru Date: Mon, 29 Jul 2019 17:43:13 +0530 Message-ID: <20190729121313.30639-6-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20190729121313.30639-1-vattunuru@marvell.com> References: <20190723053821.30227-1-vattunuru@marvell.com> <20190729121313.30639-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-07-29_06:2019-07-29,2019-07-29 signatures=0 Subject: [dpdk-dev] [PATCH v9 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 34db787..428425d 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1068,12 +1068,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