From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 021DFC432C3 for ; Fri, 15 Nov 2019 13:40:19 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 86B3F20728 for ; Fri, 15 Nov 2019 13:40:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L+bVJScA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86B3F20728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75A072C15; Fri, 15 Nov 2019 14:40:17 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id B49402C08 for ; Fri, 15 Nov 2019 14:40:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573825214; 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=BR1GkK+05+kiQb8Wr87Ls67zsP9JrjMMHTkk7dlUNS0=; b=L+bVJScAWIVV7SM8vmW+DL7xamt6vCfhzGqpLmlb5e+UR8jRHhBbmxh8iI+kzX5KWH3QPe I0JaNwbZJ8ixG45jMVC9i5t1J14WTuvvm0Ek9FzFu9FFmH3YYRe3uzSs5tzyQZEpdMDume pWqGitEy5+yyvkmMflNoN19ZsUrc5P8= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-dqsKQ57YN-W9UmwYNHveww-1; Fri, 15 Nov 2019 08:40:13 -0500 Received: by mail-vs1-f70.google.com with SMTP id z1so1376707vsq.17 for ; Fri, 15 Nov 2019 05:40:13 -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=DawKT1Ft8v4avirC/Lgi1beIEL/OeE6ioTm6HST2+l0=; b=jpu9kzqLF0LKH4nsVcuZsEOSHm1SnGYZjclGVvPhKO3v26aJOb6En2fBYMRQ8kmKmb pxm/bFsWwGmZbsIGIz2rKXr7GTLeIv4122p3J/nFahhtMFtAuqrdPgz1tyEPs7o4UwgJ PytfJX1vBao05wkiuCNn/orwlr7UjSi/x7Hi5x6RvB922NTDL7wD6/xdMbuJXbQtGKwv 3fIN6xrWpD/lDBEkSmLqXupB6WPwqD1B5CpkvSrx5/VJK48Y596vkMzpq8zhj5QhIFJj 4wQXjPWP3oFM9jhScHLoJtAHn/ECrSo1y4FiFkTfnOMBEQLzX13vKjW0mby9/4OlcpNN mRPg== X-Gm-Message-State: APjAAAWVlo+kmcv5BnqctzoeIrKpHkn8Fi1BwREQhKEFzrRUSaoLdNOq 98BaP42t4rm82B3UcgYnlLRsfaxmhEWd5zTfnGpDVoIRyj7RApizGyuw7Foo76jIRbN1R1oBCDG 9EpAIAmvbwq7PnsWS+uk= X-Received: by 2002:ac5:c14a:: with SMTP id e10mr6723521vkk.12.1573825213188; Fri, 15 Nov 2019 05:40:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyhIb8+OjS2oQ3lKCtNCPzEnN6T+dbvcgwuNjufKsCgWIoUvEBWsDg/jKLSvoXLRQraTq2eDdzRRA8hJDvVo68= X-Received: by 2002:ac5:c14a:: with SMTP id e10mr6723504vkk.12.1573825212792; Fri, 15 Nov 2019 05:40:12 -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: From: David Marchand Date: Fri, 15 Nov 2019 14:40:01 +0100 Message-ID: To: Vamsi Krishna Attunuru Cc: "Yigit, Ferruh" , dev , Thomas Monjalon , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Olivier Matz , "Burakov, Anatoly" , Andrew Rybchenko , Stephen Hemminger X-MC-Unique: dqsKQ57YN-W9UmwYNHveww-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [EXT] Re: [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" On Fri, Nov 15, 2019 at 2:36 PM Vamsi Krishna Attunuru wrote: > > > > -----Original Message----- > > From: David Marchand > > Sent: Friday, November 15, 2019 6:29 PM > > To: Vamsi Krishna Attunuru ; Yigit, Ferruh > > > > Cc: dev ; Thomas Monjalon ; Jerin > > Jacob Kollanukkaran ; Kiran Kumar Kokkilagadda > > ; Olivier Matz ; > > Burakov, Anatoly ; Andrew Rybchenko > > ; Stephen Hemminger > > > > Subject: [EXT] Re: [dpdk-dev] [PATCH v13 2/2] kni: support IOVA mode > > > > External Email > > > > ---------------------------------------------------------------------- > > 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/eal.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 a= s 'PA' because KNI > > module is loaded\n"); > > > - } else { > > > - RTE_LOG(DEBUG, EAL, "KNI can not work= since physical > > addresses are unavailable\n"); > > > + RTE_LOG(WARNING, EAL, "Forcing IOVA a= s 'PA' because " > > > + "Kernel version suppo= rts 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 > > > + IOVA 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= enough. > > > > > > 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: > > To keep the existing behavior intact when bus iommu returns IOVA_DC, had = to handle those case also here. No. If you want to change something, do it in a separate patch with full explanation. --=20 David Marchand