Skip to content

Commit

Permalink
IPoIB: Set dev_id field of net_device
Browse files Browse the repository at this point in the history
Use the net device's dev_id field to encode the port number of the pci
device.  This can be used to to associate a net device with the pci
device's port. The encoding is: dev_id = port - 1.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Eli Cohen authored and Roland Dreier committed Oct 23, 2010
1 parent fed1db3 commit c3aa9b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ static struct net_device *ipoib_add_port(const char *format,
goto alloc_mem_failed;

SET_NETDEV_DEV(priv->dev, hca->dma_device);
priv->dev->dev_id = port - 1;

if (!ib_query_port(hca, port, &attr))
priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu);
Expand Down

0 comments on commit c3aa9b1

Please sign in to comment.