From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by dpdk.org (Postfix) with ESMTP id 34C078E60 for ; Thu, 28 Jun 2018 15:08:33 +0200 (CEST) Received: by mail-lf0-f67.google.com with SMTP id g21-v6so4169430lfb.4 for ; Thu, 28 Jun 2018 06:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xrNmj/mbCNmhAYG+R5eQzrhSPekMmiAL4snYficmu7o=; b=bSMRDTv+4rsD/RaHxch+GN1jyrqF/4t9s4hSrZTNObSIHjI9NzQtbsdHd8II8kDOQX nc3LzoDgxtfyjiRZxADghsd1ixkepVfnEFb6sICU6PcyqfkqeSfIn7bwzmbKN+TOhgNu Ihrhvy9kzq5rlqmIjShOIyPaatzpOADTS1sd9pwoMq/kBrp4RV0c3wWou6DtkO59iGQk hGS/7wTmvrdTOKE6i+ePlvupIF3wUasJl4qonkadLYX11LBG28L3oQOqfAYyE58XrIAI oIabhZdJu9Uf6VuOziRlCBJ8AsUlmfFAxM4HTbjlciYwK7yDa/xmGqSfAVhefAo+CLf4 ytnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xrNmj/mbCNmhAYG+R5eQzrhSPekMmiAL4snYficmu7o=; b=gybyZeRYLAqg6jKqjameqfGwtI9w7SdcPcqfLbzNsPGMHlKbvRvb/tmIxluY8fgvyV iP0omIJZJi/aZgsc6vwWjEeRomGROCD+u/2EFazGFTqVjKIRX+f0fn+7L+wykUWZMnK1 yUrdldG305pIyFxN/ijxMTC25UVVpDWFUVo7loK3GJmxMer36DNum9QgQha1BulEK1Fe CeAsFjxDvfSepgzxdjVid8NL8xZI89QGcsDh0BZ1KMi3xwrIEcMfJzbM6h6OpTBpI83T 9hgjDLZhFtOlkvAw5vfAD6QhXBTUKSXyBGUXtsBxRmaZR+JYFg0ZhFiZ5SkRAH1z/s0A epuw== X-Gm-Message-State: APt69E12b+hW+Keq9Q1ew1ID+h+LGWx75OZMSLCsOc/ChGG8GTRob54j oYMz5l3zn4ypiTSLuQo5/CQ+nsEno2NNlLCuOTejUA== X-Google-Smtp-Source: AAOMgpc27zym7qHM3sYfcieS8QZ9NAmSgZCLooLpy/qsrYNRv2zN39MduOvBbY3b6TzByVC41M2AyqcSznix5Gqx4og= X-Received: by 2002:a19:b24e:: with SMTP id b75-v6mr7345401lff.11.1530191312832; Thu, 28 Jun 2018 06:08:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:4a95:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 06:08:32 -0700 (PDT) In-Reply-To: References: <1523455637-31719-1-git-send-email-rk@semihalf.com> <1523455637-31719-2-git-send-email-rk@semihalf.com> From: =?UTF-8?B?UmFmYcWCIEtvemlr?= Date: Thu, 28 Jun 2018 15:08:32 +0200 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Marcin Wojtas , =?UTF-8?Q?Micha=C5=82_Krawczyk?= , "Tzalik, Guy" , "Schmeilin, Evgeny" , "Matushevsky, Alexander" , "Chauskin, Igor" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 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:08:33 -0000 2018-06-27 18:34 GMT+02:00 Ferruh Yigit : > On 4/11/2018 3:07 PM, Rafal Kozik wrote: >> Write combining (wc) increase NIC performance by making better >> utilization of PCI bus, but cannot be use by all PMD. >> >> Parameter wc_activate add possibility to enable it for >> those PMD that could support it. >> >> Signed-off-by: Rafal Kozik > > Hi Rafal, > > First, sorry for delayed comment. > >> --- >> 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 4cae4dd..42e3b3f 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; >> + } > > Why we need this update at all? > What is the relation between internal_address and write combined? > > As far as I can see we are not using internal_addr at all, what do you observe > in write combined usage without this modification? > 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] WC does not work without this modification. [1] https://www.kernel.org/doc/ols/2008/ols2008v2-pages-135-144.pdf section 5.3 and 5.4 >> info->mem[n].name = name; >> info->mem[n].addr = addr; >> info->mem[n].internal_addr = internal_addr; >> @@ -638,6 +643,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"); >> >