Skip to contentSkip to conversation

IPoIB: set dev_id field of IPoIB net_device

PATCH In review Eli Cohen 2 participants 2 messages Sep 20, 2010 – Oct 23, 2010 InfiniBand

lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

PATCH 1/1 IPoIB: set dev_id field of IPoIB 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.

---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -0
index b4b2257..30d2333 100644
@@ -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);
Signature · 6 lines
1.7.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html