DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Yuanhan Liu <yliu@fridaylinux.org>, dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Nelio Laranjeiro <nelio.laranjeiro@6wind.com>,
	Yongseok Koh <yskoh@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: use PCI BDF as the port name
Date: Thu, 1 Mar 2018 13:59:43 +0000	[thread overview]
Message-ID: <a439fb44-0392-304d-6043-604c28d1687b@intel.com> (raw)
In-Reply-To: <1516613406-21257-1-git-send-email-yliu@fridaylinux.org>

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 <yliu@fridaylinux.org>

<...>

> @@ -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

  parent reply	other threads:[~2018-03-01 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  9:30 Yuanhan Liu
2018-01-23  8:23 ` Nélio Laranjeiro
2018-01-25 15:43   ` Shahaf Shuler
2018-03-01 13:59 ` Ferruh Yigit [this message]
2018-03-19 10:42   ` [dpdk-dev] [PATCH] net/mlx5: fix ICC compilation Nelio Laranjeiro
2018-03-20 23:16     ` Yongseok Koh
2018-03-21  6:16       ` Shahaf Shuler
2018-03-21  9:53     ` Ferruh Yigit
2018-03-27 13:07       ` Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a439fb44-0392-304d-6043-604c28d1687b@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=yliu@fridaylinux.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).