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 2414D1B4CC for ; Fri, 29 Jun 2018 12:24:40 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id l12-v6so6915383lja.1 for ; Fri, 29 Jun 2018 03:24:39 -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=foO+W7icu6cAZG0Y6VkWYEkSA3SEQfgMMXgIcPuWYZzYWNw1jRP+ZWvF0N8kJ1IuO5 6dR/4kXkPOn8uOLeLENsq+0PwtzN6l+l2s/SJ8/VejgJUILNo5GRT9QVw8ZEuLcuiD/o eOfcIDtFVgWM6JKSlkJwx9W3M4YmTwNeE8njEdVfmb4+nP74a/jlwcG6ApkfGdMqScC6 Yh4bbn5hb65k/3Nv9KzFXas8+14pYD0R5WVWD2CeloS206NzqQvMCqdPtS0g/quSCQMF o9L2AeRdyD1YcnSYVkVguhCEoXM9a68HFAn2jVkhKG4/aQ8DJhg/Z/IptbUtk/ousTk9 8z/g== 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=NOsbvVLKEvH0i+m5rZ96cCLmKTQkKng7CdBh6lwSQWkFZ4JeTn2OBF2e/YtiPLaXf2 ihSXO0eFVt/E8/NE0Knd3oMjzJdvxvNPaBe3W+VDLdCdchF6U6CgFEuamzpu3aZpuSw+ Vl6Osdog+sXgONd9HBj+g7Pb2bNbBbi9H0shhAHoFECgTp1SwbOfYa5t4skkWXBaM94g 0h9LtUM0f7xTYuXacAhXBN5HLnG613IJ66z8N/3y0tnuBHcQvvUK9FjD6bYBbIkV/k6F Z35lTtnwdUalUQUJN3N+l2MHB3MZF9cAqz1vupPy2wFtfOHWsUFsMY4n67CrfOpZdnEv KN/w== X-Gm-Message-State: APt69E3MN85nLgQVv0R60AxVzc9GO1x04YxclYNJW5wMJW4j22X1YnvW ue0G6E6JCaq8iaScMJ0OrIHJAvoerCIWag== X-Google-Smtp-Source: AAOMgpd+C5jkRdEJugE/FyZ1cJlWVJttCdyPrKctS4Fgz5s/rcSmf2ou21DMyDu5+9bpOMqKwZWtyw== X-Received: by 2002:a2e:259:: with SMTP id 86-v6mr849014ljc.107.1530267879370; Fri, 29 Jun 2018 03:24:39 -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 d79-v6sm745514ljd.50.2018.06.29.03.24.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jun 2018 03:24:38 -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: Fri, 29 Jun 2018 12:24:30 +0200 Message-Id: <1530267873-7236-2-git-send-email-rk@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530267873-7236-1-git-send-email-rk@semihalf.com> References: <1530191753-18689-2-git-send-email-rk@semihalf.com> <1530267873-7236-1-git-send-email-rk@semihalf.com> Subject: [dpdk-dev] [PATCH v3 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: Fri, 29 Jun 2018 10:24:40 -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