summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2010-09-20 07:05:06 +0000
committerRoland Dreier <rolandd@cisco.com>2010-10-23 13:35:48 -0700
commitc3aa9b186b95025d4ba4e90d6140c9887dfaae0a (patch)
tree1ab36ff2660cb642362c4da3cc1f01b0545c6616 /drivers/infiniband
parentfed1db33fe85573487a4732d628ac5afdb5dc776 (diff)
downloadop-kernel-dev-c3aa9b186b95025d4ba4e90d6140c9887dfaae0a.zip
op-kernel-dev-c3aa9b186b95025d4ba4e90d6140c9887dfaae0a.tar.gz
IPoIB: Set dev_id field of net_device
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index b4b2257..30d2333 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -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);
OpenPOWER on IntegriCloud