From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A296E4CA1 for ; Thu, 1 Mar 2018 14:59:46 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 05:59:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,408,1515484800"; d="scan'208";a="208084576" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.252.9.8]) ([10.252.9.8]) by fmsmga006.fm.intel.com with ESMTP; 01 Mar 2018 05:59:44 -0800 To: Yuanhan Liu , dev@dpdk.org Cc: Adrien Mazarguil , Nelio Laranjeiro , Yongseok Koh References: <1516613406-21257-1-git-send-email-yliu@fridaylinux.org> From: Ferruh Yigit Message-ID: Date: Thu, 1 Mar 2018 13:59:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1516613406-21257-1-git-send-email-yliu@fridaylinux.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/mlx5: use PCI BDF as the port name 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, 01 Mar 2018 13:59:47 -0000 On 1/22/2018 9:30 AM, Yuanhan Liu wrote: > It is suggested to use PCI BDF to identify a port for port addition > in OVS-DPDK. While mlx5 has its own naming style: name it by ib dev > name. This breaks the typical OVS DPDK use case and brings more puzzle > to the end users. > > To fix it, this patch changes it to use PCI BDF as the name, too. > Also, a postfix " port %u" is added, just in case their might be more > than 1 port assoicated with a PCI device. > > Signed-off-by: Yuanhan Liu <...> > @@ -633,14 +635,15 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) > .inline_max_packet_sz = MLX5_ARG_UNSET, > }; > > + len = snprintf(name, sizeof(name), PCI_PRI_FMT, > + pci_dev->addr.domain, pci_dev->addr.bus, > + pci_dev->addr.devid, pci_dev->addr.function); > + if (device_attr.orig_attr.phys_port_cnt > 1) > + snprintf(name + len, sizeof(name), " port %u", i); Getting a build error [1] with icc [2]. Because commit 9a761de8ea14 ("net/mlx5: flow counter support") adds variable "device_attr" into loop scope, but there is already a variable with same name in function scope. In this case the variable in the loop scope should be used and compiler error looks correct, not sure why others compilers not complain about it. [1] .../dpdk/drivers/net/mlx5/mlx5.c(729): error #592: variable "device_attr" is used before its value is set if (device_attr.orig_attr.phys_port_cnt > 1) ^ [2] icc (ICC) 18.0.1 20171018