Skip to contentSkip to conversation

rds_rdma: don't assume infiniband device is PCI

PATCH Superseded Thadeu Lima de Souza Cascardo 3 participants 9 messages Jan 4, 2012 – Jan 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rds_rdma: don't assume infiniband device is PCI

RDS code assumes that the struct ib_device dma_device member, which is a pointer, points to a struct device embedded in a struct pci_dev.

This is not the case for ehca, for example, which is a OF driver, and makes dma_device point to a struct device embedded in a struct platform_device.

This will make the system crash when rds_rdma is loaded in a system with ehca, since it will try to access the bus member of a non-existent struct pci_dev.

The only reason rds_rdma uses the struct pci_dev is to get the NUMA node the device is attached to. Using dev_to_node for that is much better, since it won't assume which bus the infiniband is attached to.

---
 net/rds/ib.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/rds/ib.h +1 -2
index edfaaaf..8d2b3d5 100644
@@ -186,8 +186,7 @@ struct rds_ib_device {
 	struct work_struct	free_work;
 };
 
-#define pcidev_to_node(pcidev) pcibus_to_node(pcidev->bus)
-#define ibdev_to_node(ibdev) pcidev_to_node(to_pci_dev(ibdev->dma_device))
+#define ibdev_to_node(ibdev) dev_to_node(ibdev->dma_device)
 #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev)
 
 /* bits for i_ack_flags */
Signature · 1 line
1.7.4.4
#2 lore raw
Quoted 1 line · Roland Dreier

Looks great to me:

And BTW if Oracle has some non-published work they should probably just rebase it on top of this fix. We should merge this rather than shipping a kernel with an obvious know crash like this.

- R.

#3 lore raw
Quoted 9 lines · Roland Dreier
Quoted 1 line · Roland Dreier

Looks great to me:

And BTW if Oracle has some non-published work they should probably just rebase it on top of this fix. We should merge this rather than shipping a kernel with an obvious know crash like this.

- R.

Hi, Roland.

Sorry that I didn't include you. Should I include the infiniband users under net/ in the files that Infiniband maintainers take care of?

David,

Is this going through your tree? In patchwork, its state is "Not Applicable".

Thanks.
Cascardo.

maintainer
#4 lore raw

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:17:06 -0200

Quoted 2 lines

Is this going through your tree? In patchwork, its state is "Not Applicable".

There was an active RDS maintainer, though I haven't seen patches from that person in a while.

#5 lore raw
Quoted 9 lines · David Miller

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:17:06 -0200

Quoted 2 lines

Is this going through your tree? In patchwork, its state is "Not Applicable".

There was an active RDS maintainer, though I haven't seen patches from that person in a while.

Hi, David.

Venkat is the current RDS maintainer and he has Acked the patch.

Thanks.
Cascardo.

maintainer
#6 lore raw

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:52:58 -0200

Quoted 7 lines · David Miller
Quoted 6 lines

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:17:06 -0200

Quoted 2 lines

Is this going through your tree? In patchwork, its state is "Not Applicable".

Quoted 7 lines
Quoted 3 lines

There was an active RDS maintainer, though I haven't seen patches from that person in a while.

Hi, David.

Venkat is the current RDS maintainer and he has Acked the patch.

Not according to patchwork. I don't see him reply at all to the patch posting and give his explicit "Acked-by: "

#7 lore raw
Quoted 14 lines · David Miller

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:52:58 -0200

Quoted 11 lines · David Miller
Quoted 9 lines

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 13 Jan 2012 16:17:06 -0200

Quoted 2 lines

Is this going through your tree? In patchwork, its state is "Not Applicable".

There was an active RDS maintainer, though I haven't seen patches from that person in a while.

Quoted 7 lines
Quoted 3 lines

Hi, David.

Venkat is the current RDS maintainer and he has Acked the patch.

Not according to patchwork. I don't see him reply at all to the patch posting and give his explicit "Acked-by: "

Venkat,

Care to send an Acked-by using a different MUA? Yours sends no In-Reply-To or References header field.

David,

This is the message Venkat has sent.

http://marc.info/?l=linux-netdev&m=132587819932339&w=2

Thanks.
Cascardo.

#8 lore raw
In reply to Thadeu Lima de Souza Cascardo
Quoted 5 lines · Thadeu Lima de Souza Cascardo

Hi, Roland.

Sorry that I didn't include you. Should I include the infiniband users under net/ in the files that Infiniband maintainers take care of?

I don't maintain those things but I may have an opinion about them :)

 - R.