summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-14 15:06:54 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-17 10:26:59 +0200
commita1883178e9c26afc0ecc18490a86d39d0b04dc07 (patch)
treeea0b29ba571342e2c8f812549062b431220fbd0a /drivers/net/mlx5/mlx5_ethdev.c
parent05f1d6842fc34a905ff971c9bbbd20c4653e9b26 (diff)
downloaddpdk-next-eventdev-a1883178e9c26afc0ecc18490a86d39d0b04dc07.zip
dpdk-next-eventdev-a1883178e9c26afc0ecc18490a86d39d0b04dc07.tar.gz
dpdk-next-eventdev-a1883178e9c26afc0ecc18490a86d39d0b04dc07.tar.xz
net/mlx5: remove useless driver name comparison
The function mlx5_dev_to_port_id() is returning all the ports associated to a rte_device. It was comparing driver names while already comparing rte_device pointers. If two devices are the same, they will have the same driver. So the useless driver name comparison is removed. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 61eda53..cacdf8e 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1305,10 +1305,7 @@ mlx5_dev_to_port_id(const struct rte_device *dev, uint16_t *port_list,
RTE_ETH_FOREACH_DEV(id) {
struct rte_eth_dev *ldev = &rte_eth_devices[id];
- if (!ldev->device ||
- !ldev->device->driver ||
- strcmp(ldev->device->driver->name, MLX5_DRIVER_NAME) ||
- ldev->device != dev)
+ if (ldev->device != dev)
continue;
if (n < port_list_n)
port_list[n] = id;