[PATCH resend] rds_rdma: don't assume infiniband device is PCI

Subsystems: networking [general], rds - reliable datagram sockets, the rest

STALE5215d

3 messages, 3 authors, 2012-05-29 · open the first message on its own page

[PATCH resend] rds_rdma: don't assume infiniband device is PCI

From: Thadeu Lima de Souza Cascardo <hidden>
Date: 2012-05-28 18:52:24

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.

Signed-off-by: Thadeu Lima de Souza Cascardo <redacted>
Cc: dledford@redhat.com
Cc: Jes.Sorensen@redhat.com
Cc: Venkat Venkatsubra <redacted>
---

Hi, Venkat.

This patch is still not applied. Can you give your Ack?

Regards.
Cascardo.

---
 net/rds/ib.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/rds/ib.h b/net/rds/ib.h
index edfaaaf..8d2b3d5 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -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 */
-- 
1.7.4.4

Re: [PATCH resend] rds_rdma: don't assume infiniband device is PCI

From: Venkat Venkatsubra <hidden>
Date: 2012-05-28 20:15:31

On 5/28/2012 1:52 PM, Thadeu Lima de Souza Cascardo wrote:
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.

Signed-off-by: Thadeu Lima de Souza Cascardo<redacted>
Cc: dledford@redhat.com
Cc: Jes.Sorensen@redhat.com
Cc: Venkat Venkatsubra<redacted>
---
Acked-by: Venkat Venkatsubra <redacted>

Re: [PATCH resend] rds_rdma: don't assume infiniband device is PCI

From: David Miller <davem@davemloft.net>
Date: 2012-05-29 21:23:00

From: Venkat Venkatsubra <redacted>
Date: Mon, 28 May 2012 15:15:18 -0500
On 5/28/2012 1:52 PM, Thadeu Lima de Souza Cascardo wrote:
quoted
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.

Signed-off-by: Thadeu Lima de Souza
Cascardo[off-list ref]
Cc: dledford@redhat.com
Cc: Jes.Sorensen@redhat.com
Cc: Venkat Venkatsubra<redacted>
---
Acked-by: Venkat Venkatsubra <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help