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 94080A04C2; Fri, 15 Nov 2019 13:59:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A1F52C12; Fri, 15 Nov 2019 13:59:25 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id DECAB2C08 for ; Fri, 15 Nov 2019 13:59:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573822762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ggF+eER+k0ttAcDxAbBj5h/ERzFSFqTyUqS+ka4PzLQ=; b=iDnDeWQ9YTRsQLRmbv+yhmhqFwU5kjPCdGad5/HyrHOXY8r2YXsVNoypa7Fa3U9rtveoDK ut4RJDKjuP8OVbdlZmTp5MUb2HoPRbS4QreGM+AzQyWyC4Id1MMk/rdO7szti8gPzE8hBy 7TKLqjC0soXrsCBjAcl8UalA69K9YKY= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-eM429kr0PSGYO4X5FjymMQ-1; Fri, 15 Nov 2019 07:59:21 -0500 Received: by mail-ua1-f70.google.com with SMTP id o17so1803201uar.8 for ; Fri, 15 Nov 2019 04:59:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TisyJSaj1uD8LMrnejvYr6foezM4ECv3F+3NTXUJI9Y=; b=qpCsisyvOQEjFE2Mpy2PUojEEO8q9X3djvB4IzQdKem+PZX6maKlE8ee0DBHAHdBmK Sxuaz7zSOJuAgJq9mr9B9urO6s/+zZurOHNrE5nEKSLZU7f4gZd2SdKIjSy6TRdyK53G n6RLd5J/4T5rALgivK+mLMmME+J9Q+zY6I8Ar3j6JGIcM9YHhbHawjBtZgWNnBl/xJn5 QdsYY7k9tNA4XhZ7XwFq6X81sw37iwjHGspJV/M65oLXk+rszcVQ8g5HnDN+wWdHQmJe mqoKwNuOFK3p/2ILOrwsK+LXaeY5qJnJOrjFReDeDz5WRFa1nPYnP6aDUqKPOBSD2KF2 5ufw== X-Gm-Message-State: APjAAAUIi0gGbJ9PlAxeMG4eeReZ4y4Gp/x1+10GnTwcL8jUSgL33c8w ewvA2gxJuEhspFz8yw8ATFm+vszawxQ863Oh9DMPNF+lqatOBgEj7Lli6DZDo6w7ZHr/P0Xfggn bAP+ngqJexibRlDNHpc4= X-Received: by 2002:a67:7d95:: with SMTP id y143mr9402168vsc.39.1573822760742; Fri, 15 Nov 2019 04:59:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxgMxLnP35BnjBTPiuvD1B2uMW0j8chbwnqin/xW7vO28Qd/wNkPDd0ULpyuW/8bNOMYr9rqjL0nFO43rAHEbo= X-Received: by 2002:a67:7d95:: with SMTP id y143mr9402151vsc.39.1573822760413; Fri, 15 Nov 2019 04:59:20 -0800 (PST) MIME-Version: 1.0 References: <20191105110416.8955-1-vattunuru@marvell.com> <20191115111807.20935-1-vattunuru@marvell.com> <20191115111807.20935-3-vattunuru@marvell.com> In-Reply-To: <20191115111807.20935-3-vattunuru@marvell.com> From: David Marchand Date: Fri, 15 Nov 2019 13:59:09 +0100 Message-ID: To: Vamsi Attunuru , "Yigit, Ferruh" Cc: dev , Thomas Monjalon , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Olivier Matz , "Burakov, Anatoly" , Andrew Rybchenko , Stephen Hemminger X-MC-Unique: eM429kr0PSGYO4X5FjymMQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v13 2/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" I can't see an interest in splitting this patch from the kmod update. Ferruh, what do you think? On Fri, Nov 15, 2019 at 12:19 PM wrote: > > From: Vamsi Attunuru > > Current KNI implementation only operates in IOVA_PA mode > patch adds required functionality to enable KNI in > IOVA_VA mode. > > KNI loopback mode tests will have performance impact in > this mode due to IOVA to KVA address translations. > However, In KNI real world use cases, the performace performance > impact will be based on Linux kernel stack and scheduler > latencies. Performance varies based on the KNI use case. > If bus iommu scheme is IOVA_DC and KNI module is loaded, > DPDK chooses IOVA as PA as existing behaviour. > > During KNI creation, app's iova_mode details are passed to > the KNI kernel module, accordingly kernel module translates > PA/IOVA addresses to KVA and vice-versa. > > Signed-off-by: Vamsi Attunuru > Signed-off-by: Kiran Kumar K > Suggested-by: Ferruh Yigit > --- > doc/guides/prog_guide/kernel_nic_interface.rst | 15 +++++++++++++++ > doc/guides/rel_notes/release_19_11.rst | 15 ++++++++++++++- > lib/librte_eal/linux/eal/eal.c | 23 ++++++++++++++++----= --- > lib/librte_kni/rte_kni.c | 6 ++++++ > 4 files changed, 51 insertions(+), 8 deletions(-) > [snip] > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/ea= l.c > index 9e2d50c..53ca84b 100644 > --- a/lib/librte_eal/linux/eal/eal.c > +++ b/lib/librte_eal/linux/eal/eal.c > @@ -1086,14 +1086,23 @@ rte_eal_init(int argc, char **argv) > } > } > #ifdef RTE_LIBRTE_KNI > - /* Workaround for KNI which requires physical address to = work */ > - if (iova_mode =3D=3D RTE_IOVA_VA && > - rte_eal_check_module("rte_kni") =3D=3D 1)= { > - if (phys_addrs) { > + if (rte_eal_check_module("rte_kni") =3D=3D 1) { > +#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE > + if (iova_mode =3D=3D RTE_IOVA_VA) { > iova_mode =3D RTE_IOVA_PA; > - RTE_LOG(WARNING, EAL, "Forcing IOVA as 'P= A' because KNI module is loaded\n"); > - } else { > - RTE_LOG(DEBUG, EAL, "KNI can not work sin= ce physical addresses are unavailable\n"); > + RTE_LOG(WARNING, EAL, "Forcing IOVA as 'P= A' because " > + "Kernel version supports = only 'PA' mode for KNI module\n"); > + } > +#endif > + if (rte_bus_get_iommu_class() =3D=3D RTE_IOVA_DC) > + iova_mode =3D RTE_IOVA_PA; If physical addresses are unavailable, this code forces PA anyway. > + > + if (iova_mode =3D=3D RTE_IOVA_PA) { > + if (phys_addrs && is_iommu_enabled()) > + RTE_LOG(WARNING, EAL, "Forced IOV= A as 'PA' because KNI module is loaded\n"); > + > + if (!phys_addrs) > + RTE_LOG(DEBUG, EAL, "KNI can not = work since physical addresses are unavailable\n"); > } Checking physical addresses availability after, and having a log is not eno= ugh. So far, KNI could not work with IOVA as VA. Your patchset adds support for IOVA as VA if kernel is >=3D 4.6. Repeating my proposal (as far as eal.c is concerned) of just changing: @@ -1085,7 +1085,7 @@ rte_eal_init(int argc, char **argv) RTE_LOG(DEBUG, EAL, "IOMMU is not available, selecting IOVA as PA mode.\n"); } } -#ifdef RTE_LIBRTE_KNI +#if defined(RTE_LIBRTE_KNI) && KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_COD= E /* Workaround for KNI which requires physical address to wo= rk */ if (iova_mode =3D=3D RTE_IOVA_VA && -- David Marchand