From patchwork Fri Nov 15 11:18:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vamsi Attunuru X-Patchwork-Id: 63036 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CC73A04CA; Fri, 15 Nov 2019 12:18:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0FB42C08; Fri, 15 Nov 2019 12:18:40 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 8A5BF2BA8 for ; Fri, 15 Nov 2019 12:18:38 +0100 (CET) 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 xAFBFD7X013242; Fri, 15 Nov 2019 03:18:37 -0800 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=qwaIbH4BmXRSQPnolYQSuM6ckMM49UyIzypgyR3LZJk=; b=f4c4XhRR69rhAUMmXAraMLIVU0Itezo1HH/LA2RKTiohN4vu2lkh+48hqgDv/nbOr19h Pa7yWhZBGugNne+k6mnFcXFnLratv3tHRYk4dyxFWwfSu2jne19K+3svdFZpmUt6vrBI 5lpbdBOk0zbd4RJENpAFLTTxhcBwBNeU9XkKF6wHl0vnYy//Uw/ZtznJek/1Cfe+rz7C kX7NwmVWLVpgPyb1i945JfNh543KTKySeVhSkj+kIAXYNBhEM6OFx5iyQ9t8CCcYXSyl RIpci7hgkwxmAYqTR461C6QtVyFVISFWjRAtaUYj/aqCXx65vJqqH0eXsK1ypCWMjAjY yg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2w8whqygre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 15 Nov 2019 03:18:37 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 15 Nov 2019 03:18:35 -0800 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; Fri, 15 Nov 2019 03:18:34 -0800 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id 9FC863F703F; Fri, 15 Nov 2019 03:18:30 -0800 (PST) From: To: CC: , , , , , , , , , Vamsi Attunuru Date: Fri, 15 Nov 2019 16:48:05 +0530 Message-ID: <20191115111807.20935-1-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20191105110416.8955-1-vattunuru@marvell.com> References: <20191105110416.8955-1-vattunuru@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-15_03:2019-11-15,2019-11-15 signatures=0 Subject: [dpdk-dev] [PATCH v13 0/2] kni: support IOVA mode 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 --- V13 Changes: * For KNI case, to restore the existing behaviour, forcing IOVA as PA if bus iommu returns IOVA_DC. * Restored phys_addr and kni_lib defination checks. * Simplified patch titles. * Updated documentation about patch set's impact on performance and kernel version requirement. V12 Changes: * Removed previously added `--legacy-kni` eal option. * Removed previously added kni specific mempool create routines and mempool populate routines. V11 Changes: * Added iova to kva address translation routines in kernel module to make it work in iova=va mode which enables DPDK to create kni devices on any kind of backed device/memory. * Added ``--legacy-kni`` eal option to make existing KNI applications work with DPDK 19.11 and later versions. * Removed previously added pci device info from kni device info struct. V10 Changes: * Fixed function return code on failure when min_chunk_size > pg_sz. * Marked new mempool populate routine as EXPERIMENTAL. V9 Changes: * Used rte_mempool_ops_calc_mem_size() instead of default handler in the new mempool populate routine. * Check min_chunk_size and return values. * Removed ethdev_info memset to '0' and moved pci dev_info populate into kni_dev_pci_addr_get() routine. * Addressed misc. review comments. V8 Changes: * Remove default mempool populate() routine changes. * Add kni app specific mempool create & free routines. * Add new mempool populate routine to allocate page-aligned memzones with page size to make sure all mempool objects reside on a page. * Update release notes and map files. V7 Changes: * Removed previously proposed mempool flag and made those page boundary checks default in mempool populate() except for the objects size bigger than the size of page. * Removed KNI example application related changes since pool related requirement is taken care in mempool lib. * All PCI dev related info is moved under rte_eal_iova_mode() == VA check. * Added wrapper functions in KNI module to hide IOVA checks and make address translation routines more readable. * Updated IOVA mode checks that enforcing IOVA=PA mode when IOVA=VA mode is enabled. V6 Changes: * Added new mempool flag to ensure mbuf memory is not scattered across page boundaries. * Added KNI kernel module required PCI device information. * Modified KNI example application to create mempool with new mempool flag. V5 changes: * Fixed build issue with 32b build V4 changes: * Fixed build issues with older kernel versions * This approach will only work with kernel above 4.4.0 Vamsi Attunuru (2): kni: support IOVA mode in kernel module kni: support IOVA mode doc/guides/prog_guide/kernel_nic_interface.rst | 14 +++++ doc/guides/rel_notes/release_19_11.rst | 12 ++++- kernel/linux/kni/compat.h | 14 +++++ kernel/linux/kni/kni_dev.h | 42 +++++++++++++++ kernel/linux/kni/kni_misc.c | 39 ++++++++++---- kernel/linux/kni/kni_net.c | 62 ++++++++++++++++++----- lib/librte_eal/linux/eal/eal.c | 19 ++++--- lib/librte_eal/linux/eal/include/rte_kni_common.h | 1 + lib/librte_kni/rte_kni.c | 6 +++ 9 files changed, 180 insertions(+), 29 deletions(-)