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 D944DA04C6; Fri, 15 Nov 2019 16:22:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D2CC52C15; Fri, 15 Nov 2019 16:22:48 +0100 (CET) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id E97312C12 for ; Fri, 15 Nov 2019 16:22:46 +0100 (CET) Received: by mail-io1-f65.google.com with SMTP id i11so10767691iol.13 for ; Fri, 15 Nov 2019 07:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ApokOpDvXDlbkEwSYtP/nzN0ckGq8d9QrvnBWiPVS8s=; b=I2dO+/bM0QtpVREPwZRcMeGy8TS6yzszzXdYzLI0OjaqMIMHLGCOTm5Mlc5emcuyRs eTfMQ+6T/QCLjksNGy65iG4WpqhCq2/g5S/OlHz9u9bn1L4wzhRM76ocRjjQhIdECfAk qxLSEPB2QN4QHedIyrwqN3S+4wf6lNh996Qexb0UAcE+byLBPfL+63VjmYWVAVRmsIwU Y3w3qv4k/QW4hN5d3nvfMyUNWKNRkeGG+P03uuRQXwxgwdV291Vo95rG4oArm4uXxx+9 +cyzoXRQNnihWjHMCU58m3xyYxyx3MLyMQuUF6WvhAjiOq1XHyOKheUsrypfzua8G+nR 0W8A== 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=ApokOpDvXDlbkEwSYtP/nzN0ckGq8d9QrvnBWiPVS8s=; b=gj0D/2issmj7BBoziJjt5pkdua9hB64dVWk8aH8GyzPDGskfqc7i/zw4GcZRs4BdNQ /xZxXWkR186Zo0eSmxeDj9ylThni90klonCov+17JLcOxEd0yWKLXsprBFF5ChxbFgnh Yqn26iy6jyiMaBUZek/Hd1HQdsx1KOZA8GnBT+MgkCqEUIm1Jt/a4reVd1fkRYi54G3k fHNsAHwjxefJEkC9B+mKQl7IErdrEpVqfTGwKlfRhVtp8plCGH7hvIoYssEeILPUp433 +wSFXXLJyDBntJX6q9x1Ibtdx93HSAS/ESg2TR9Nc5r0FZu4Kx+mn8YNn5JUvQfSXvfF C4dg== X-Gm-Message-State: APjAAAXsoo5KXWspyaBwu5GD94D2NQaEk8mFvXXbhKmdqcR97S52sB6R bP3C1RqaaXV/sqC3NVUJRU1kFyh8YoxsR197Rz0= X-Google-Smtp-Source: APXvYqy00M8gdsjpuBX7hkU+qgMcfOoYkOZRS4vwh49FnZE2owPSDDTPNXT1EDQZO1+b5XIcPRjuvAmJYgtPZNjCNtU= X-Received: by 2002:a6b:e403:: with SMTP id u3mr1283397iog.130.1573831365925; Fri, 15 Nov 2019 07:22:45 -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: Jerin Jacob Date: Fri, 15 Nov 2019 20:52:29 +0530 Message-ID: To: David Marchand Cc: Vamsi Attunuru , "Yigit, Ferruh" , dev , Thomas Monjalon , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Olivier Matz , "Burakov, Anatoly" , Andrew Rybchenko , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" 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" On Fri, Nov 15, 2019 at 8:27 PM David Marchand wrote: > > On Fri, Nov 15, 2019 at 2:40 PM Jerin Jacob wrote: > > On Fri, Nov 15, 2019 at 6:29 PM David Marchand > > wrote: > > > So far, KNI could not work with IOVA as VA. > > > Your patchset adds support for IOVA as VA if kernel is >= 4.6. > > > > We need achive the following. > > > > IOVA as PA has performance implication on KNI case. So we need to > > make IOVA as PA when KNI module is loaded. > > - The current behaviour is: > * buses announce PA, nothing to do wrt KNI, > * buses announce VA or DC (whatever the considerations on iommu), if > physical addresses are available, then PA is used and KNI works, > > - Now, with this new feature (on kernels >= 4.6), we can have KNI work > with VA, the previous workaround can be skipped. > There is another consideration wrt performance, as a consequence, for > kernels 4.6, if physical addresses are available, we can select PA for > KNI. > > _But_ I did not see people complaining about the current behavior. > I see no reason to change this if the VA support can't be used (kernels < 4.6). > > So how about (I inverted the #if LINUX_VERSION_CODE >= > KERNEL_VERSION(4, 6, 0), it was causing me headaches): That works too David. Thanks for the review. > > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c > index 9e2d50cfb..33f3c674c 100644 > --- a/lib/librte_eal/linux/eal/eal.c > +++ b/lib/librte_eal/linux/eal/eal.c > @@ -1073,6 +1073,11 @@ rte_eal_init(int argc, char **argv) > */ > iova_mode = RTE_IOVA_VA; > RTE_LOG(DEBUG, EAL, "Physical > addresses are unavailable, selecting IOVA as VA mode.\n"); > +#if defined(RTE_LIBRTE_KNI) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) > + } else if (rte_eal_check_module("rte_kni") == 1) { > + iova_mode = RTE_IOVA_PA; > + RTE_LOG(DEBUG, EAL, "Forcing IOVA as > 'PA' for better perfomance with KNI\n"); > +#endif > } else if (is_iommu_enabled()) { > /* we have an IOMMU, pick IOVA as VA mode */ > iova_mode = RTE_IOVA_VA; > @@ -1085,7 +1090,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 > - /* Workaround for KNI which requires physical address to work */ > +#if defined(RTE_LIBRTE_KNI) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) > + /* Workaround for KNI which requires physical address > to work with kernels < 4.6 */ > if (iova_mode == RTE_IOVA_VA && > rte_eal_check_module("rte_kni") == 1) { > > > -- > David Marchand >