summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2019-04-01 04:26:59 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-04-05 17:45:22 +0200
commitd874a4eed5b6ed3380637089f5e2f0ba04d58eb5 (patch)
tree7390cce1ad1ad2f5148f3d44705ff4e71a1ac5f5 /drivers/net/mlx5/mlx5_ethdev.c
parent7f98942886bcb80a504f8bfb99638bb14a8ba14d (diff)
downloaddpdk-next-eventdev-d874a4eed5b6ed3380637089f5e2f0ba04d58eb5.zip
dpdk-next-eventdev-d874a4eed5b6ed3380637089f5e2f0ba04d58eb5.tar.gz
dpdk-next-eventdev-d874a4eed5b6ed3380637089f5e2f0ba04d58eb5.tar.xz
net/mlx5: use port sibling iterators
Iterating over siblings was done with RTE_ETH_FOREACH_DEV() which skips the owned ports. The new iterators RTE_ETH_FOREACH_DEV_SIBLING() and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index aab8e67..9ae9ddd 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1364,11 +1364,7 @@ mlx5_dev_to_port_id(const struct rte_device *dev, uint16_t *port_list,
uint16_t id;
unsigned int n = 0;
- RTE_ETH_FOREACH_DEV(id) {
- struct rte_eth_dev *ldev = &rte_eth_devices[id];
-
- if (ldev->device != dev)
- continue;
+ RTE_ETH_FOREACH_DEV_OF(id, dev) {
if (n < port_list_n)
port_list[n] = id;
n++;