summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-03-27 13:15:40 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-29 17:25:32 +0100
commit9c0a9eed37f17c84b92a75071e1df2de3d5d16d6 (patch)
tree3f38d401986102221c49d84a9f4ebdc0e670ab0e /drivers/net/mlx5/mlx5_ethdev.c
parent17e19bc4dde71079a18b188ab8523035e6df0b3e (diff)
downloaddpdk-next-eventdev-9c0a9eed37f17c84b92a75071e1df2de3d5d16d6.zip
dpdk-next-eventdev-9c0a9eed37f17c84b92a75071e1df2de3d5d16d6.tar.gz
dpdk-next-eventdev-9c0a9eed37f17c84b92a75071e1df2de3d5d16d6.tar.xz
net/mlx5: switch to the names in the shared IB context
The IB device names are moved from device private data to the shared context, code involving the names is updated. The IB port index treatment is added where it is relevant. Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 2b83898..0662594 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -138,8 +138,10 @@ mlx5_get_master_ifname(const struct rte_eth_dev *dev,
unsigned int dev_port_prev = ~0u;
char match[IF_NAMESIZE] = "";
+ assert(priv);
+ assert(priv->sh);
{
- MKSTR(path, "%s/device/net", priv->ibdev_path);
+ MKSTR(path, "%s/device/net", priv->sh->ibdev_path);
dir = opendir(path);
if (dir == NULL) {
@@ -159,7 +161,7 @@ mlx5_get_master_ifname(const struct rte_eth_dev *dev,
continue;
MKSTR(path, "%s/device/net/%s/%s",
- priv->ibdev_path, name,
+ priv->sh->ibdev_path, name,
(dev_type ? "dev_id" : "dev_port"));
file = fopen(path, "rb");
@@ -222,7 +224,9 @@ mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE])
struct mlx5_priv *priv = dev->data->dev_private;
unsigned int ifindex =
priv->nl_socket_rdma >= 0 ?
- mlx5_nl_ifindex(priv->nl_socket_rdma, priv->ibdev_name, 1) : 0;
+ mlx5_nl_ifindex(priv->nl_socket_rdma,
+ priv->sh->ibdev_name,
+ priv->ibv_port) : 0;
if (!ifindex) {
if (!priv->representor)