DPDK patches and discussions
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@nvidia.com>
To: viacheslavo@nvidia.com, matan@nvidia.com
Cc: rasland@nvidia.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/4] net/mlx5: fix invalid multi-process ID
Date: Sun, 24 Jan 2021 19:02:03 +0800	[thread overview]
Message-ID: <1611486126-84749-2-git-send-email-suanmingm@nvidia.com> (raw)
In-Reply-To: <1611486126-84749-1-git-send-email-suanmingm@nvidia.com>

The device port_id is used for inter-process communication and must
be the same both for primary and secondary process

This IPC port_id was configured with the invalid temporary value in
port spawn routine. This temporary value was used by the function
rte_eth_dev_get_port_by_name() to check whether the port exists.

This commit corrects the mp port_id with rte_eth_dev port_id.

Fixes: 2eb4d0107acc ("net/mlx5: refactor PCI probing on Linux")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 9ac1d46..1d91b92 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -930,8 +930,6 @@
 	priv->dev_port = spawn->phys_port;
 	priv->pci_dev = spawn->pci_dev;
 	priv->mtu = RTE_ETHER_MTU;
-	priv->mp_id.port_id = port_id;
-	strlcpy(priv->mp_id.name, MLX5_MP_NAME, RTE_MP_MAX_NAME_LEN);
 	/* Some internal functions rely on Netlink sockets, open them now. */
 	priv->nl_socket_rdma = mlx5_nl_init(NETLINK_RDMA);
 	priv->nl_socket_route =	mlx5_nl_init(NETLINK_ROUTE);
@@ -1347,6 +1345,8 @@
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
 		eth_dev->data->representor_id = priv->representor_id;
 	}
+	priv->mp_id.port_id = eth_dev->data->port_id;
+	strlcpy(priv->mp_id.name, MLX5_MP_NAME, RTE_MP_MAX_NAME_LEN);
 	/*
 	 * Store associated network device interface index. This index
 	 * is permanent throughout the lifetime of device. So, we may store
-- 
1.8.3.1


  reply	other threads:[~2021-01-24 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 11:02 [dpdk-dev] [PATCH 0/4] net/mlx: fix secondary process bugs Suanming Mou
2021-01-24 11:02 ` Suanming Mou [this message]
2021-01-25  8:31   ` [dpdk-dev] [PATCH 1/4] net/mlx5: fix invalid multi-process ID Raslan Darawsheh
2021-01-24 11:02 ` [dpdk-dev] [PATCH 2/4] net/mlx5: fix secondary process port detach crash Suanming Mou
2021-01-24 11:02 ` [dpdk-dev] [PATCH 3/4] net/mlx5: fix secondary process attach port Tx queue Suanming Mou
2021-01-25  8:30   ` Raslan Darawsheh
2021-01-24 11:02 ` [dpdk-dev] [PATCH 4/4] net/mlx4: " Suanming Mou
2021-01-25 10:09 ` [dpdk-dev] [PATCH 0/4] net/mlx: fix secondary process bugs Raslan Darawsheh

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=1611486126-84749-2-git-send-email-suanmingm@nvidia.com \
    --to=suanmingm@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=viacheslavo@nvidia.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).