From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
Cc: dev@dpdk.org, Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Nelio Laranjeiro <nelio.laranjeiro@6wind.com>,
Yongseok Koh <yskoh@mellanox.com>,
Shahaf Shuler <shahafs@mellanox.com>,
stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/mlx4: use PCI address as port name
Date: Fri, 16 Feb 2018 11:19:24 -0200 [thread overview]
Message-ID: <20180216131924.GA5247@localhost.localdomain> (raw)
In-Reply-To: <1518337772-24763-1-git-send-email-yliu@fridaylinux.org>
On Sun, Feb 11, 2018 at 04:29:32PM +0800, 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
^
I believe you mean mlx4 here?
> 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.
> Judging the fact that there are 2 ports associated with one PCI for
> ConnectX-3, a postfix is needed. Thus, the final name looks like
> something below:
>
> 0000:04:00.0-port0
> 0000:04:00.0-port1
>
> Cc: stable@dpdk.org
> Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
> ---
> drivers/net/mlx4/mlx4.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index ee93daf..eb8851c 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -497,6 +497,14 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
> struct priv *priv = NULL;
> struct rte_eth_dev *eth_dev = NULL;
> struct ether_addr mac;
> + char name[RTE_ETH_NAME_MAX_LEN];
> + int len;
> +
> + 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.phys_port_cnt > 1)
> + snprintf(name + len, sizeof(name), "-port%u", i);
>
> /* If port is not enabled, skip. */
> if (!(conf.ports.enabled & (1 << i)))
> @@ -605,14 +613,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
> /* Get actual MTU if possible. */
> mlx4_mtu_get(priv, &priv->mtu);
> DEBUG("port %u MTU is %u", priv->port, priv->mtu);
> - /* from rte_ethdev.c */
> - {
> - char name[RTE_ETH_NAME_MAX_LEN];
> -
> - snprintf(name, sizeof(name), "%s port %u",
> - mlx4_glue->get_device_name(ibv_dev), port);
> - eth_dev = rte_eth_dev_allocate(name);
> - }
> + eth_dev = rte_eth_dev_allocate(name);
> if (eth_dev == NULL) {
> ERROR("can not allocate rte ethdev");
> rte_errno = ENOMEM;
> --
> 2.7.4
>
prev parent reply other threads:[~2018-02-16 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-11 8:29 Yuanhan Liu
2018-02-12 10:40 ` Adrien Mazarguil
2018-02-16 13:19 ` Marcelo Ricardo Leitner [this message]
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=20180216131924.GA5247@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=nelio.laranjeiro@6wind.com \
--cc=shahafs@mellanox.com \
--cc=stable@dpdk.org \
--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).