From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id C84A51B055 for ; Thu, 28 Jun 2018 15:16:11 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id k20-v6so4475288ljk.9 for ; Thu, 28 Jun 2018 06:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+fL6fuPc8F52ludMma2sKMyIvFsnG1EOxbLEAP6gj/k=; b=z2Hei0Q3vP8fdgIScfAnuEHJZLyi3QCcdenRzN3cmjgRbE8VTQAqdE9SwxPz5XZVV4 6KU5mj2soo8pHFEoZxXCX+YStiRzaVNsbjQQRt2DpCp2lwEcab+/xISK00WpiyWbkUqv ETZ7xn96attqGMhWJFnXBWIyNnUFrMXsN3B6YFX/GHkFQ8IsGFQ+g8eNK/sSOU/Uf5C9 jGSB+4kxzvVwgz0fOzazbGwfp7ZiVIjlfDXHvxWIqMUVrZzwvvMs9sqfuY9gC66u3Xp+ ooAamCIf7MW9+2GCbogl3ETL4rmS+4/Z7+/ZpT+Wyo5RXohlhi1NHyivLXA26UotGweq Ab5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+fL6fuPc8F52ludMma2sKMyIvFsnG1EOxbLEAP6gj/k=; b=W3o+eigvhygJHh4CltwI1oaBPFX64xD10ZD7PvQIQ+K1BHgsS93NCzQRw/gaBThMEd hbuRWctR8/VsbREbwr9aqAp6hf1Btf8lTaIrYVp0s1XKMubzo9CPILniffBemgTTir/Q r192ggw/w5QSzf6BDBDGB1KExigruqGoeDiJGKXp45Vz54EgCAkFF+M1nhlOJbUAkGsm ++5t6nFKKvGfTYyoe2p/gr7vAIaoW1RjQzqhp71pHK3psTJzVw4bAoCydICwgzufKlK4 ZyWQQ1JeNJaA/jn9AEiEWzPNFJoy+fSM5Y7j/o3lLrHK67oUs972F4ETlp53wRZ2emEL 6ioQ== X-Gm-Message-State: APt69E3eAu8bVfd3FmtfDldTOSmKw9pBwdMOgSm1/G/DNuRKYtx2mlHS WMydjvi7OpdI7cAnr8F1rOmNg2gvpoklKg== X-Google-Smtp-Source: AAOMgpenmwhPwc+IoD8JGccgt/II8KuLVAqVlHkVikToh3yxPcrEBbu0FIRxV3BSGNtn7Ea+BW5H9A== X-Received: by 2002:a2e:8051:: with SMTP id p17-v6mr7086897ljg.22.1530191771122; Thu, 28 Jun 2018 06:16:11 -0700 (PDT) Received: from rafalkozik.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id o196-v6sm1303246lfe.95.2018.06.28.06.16.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jun 2018 06:16:10 -0700 (PDT) From: Rafal Kozik To: dev@dpdk.org Cc: mw@semihalf.com, mk@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, matua@amazon.com, igorch@amazon.com, thomas@monjalon.net, ferruh.yigit@intel.com, Rafal Kozik Date: Thu, 28 Jun 2018 15:15:50 +0200 Message-Id: <1530191753-18689-2-git-send-email-rk@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530191753-18689-1-git-send-email-rk@semihalf.com> References: <1530191753-18689-1-git-send-email-rk@semihalf.com> Subject: [dpdk-dev] [PATCH v2 1/4] igb_uio: add wc option 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: , X-List-Received-Date: Thu, 28 Jun 2018 13:16:12 -0000 Write combining (WC) increases NIC performance by making better utilization of PCI bus, but cannot be use by all PMDs. To get internal_addr memory need to be mapped. But as memory could not be mapped twice: with and without WC, it should be skipped for WC. [1] To do not spoil other drivers that potentially could use internal_addr, parameter wc_activate adds possibility to skip it for those PMDs, that do not use it. [1] https://www.kernel.org/doc/ols/2008/ols2008v2-pages-135-144.pdf section 5.3 and 5.4 Signed-off-by: Rafal Kozik Acked-by: Bruce Richardson --- kernel/linux/igb_uio/igb_uio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c index b3233f1..3382fb1 100644 --- a/kernel/linux/igb_uio/igb_uio.c +++ b/kernel/linux/igb_uio/igb_uio.c @@ -30,6 +30,7 @@ struct rte_uio_pci_dev { int refcnt; }; +static int wc_activate; static char *intr_mode; static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX; /* sriov sysfs */ @@ -375,9 +376,13 @@ igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info *info, len = pci_resource_len(dev, pci_bar); if (addr == 0 || len == 0) return -1; - internal_addr = ioremap(addr, len); - if (internal_addr == NULL) - return -1; + if (wc_activate == 0) { + internal_addr = ioremap(addr, len); + if (internal_addr == NULL) + return -1; + } else { + internal_addr = NULL; + } info->mem[n].name = name; info->mem[n].addr = addr; info->mem[n].internal_addr = internal_addr; @@ -650,6 +655,12 @@ MODULE_PARM_DESC(intr_mode, " " RTE_INTR_MODE_LEGACY_NAME " Use Legacy interrupt\n" "\n"); +module_param(wc_activate, int, 0); +MODULE_PARM_DESC(wc_activate, +"Activate support for write combining (WC) (default=0)\n" +" 0 - disable\n" +" other - enable\n"); + MODULE_DESCRIPTION("UIO driver for Intel IGB PCI cards"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Intel Corporation"); -- 2.7.4