Skip to content

Commit

Permalink
mlx4_en: use net_device dev_id to indicate port number
Browse files Browse the repository at this point in the history
Today, there are no means to know which port of a hardware device a netdev
interface uses. struct net_device conatins a field, dev_id, that can be used
for that. Use this field to save the port number in ConnectX that is being used
by the net device; port numbers are zero based.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eli Cohen authored and David S. Miller committed May 31, 2010
1 parent 5929706 commit 741a00b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/mlx4/en_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
}

SET_NETDEV_DEV(dev, &mdev->dev->pdev->dev);
dev->dev_id = port - 1;

/*
* Initialize driver private data
Expand Down

0 comments on commit 741a00b

Please sign in to comment.