[ofa-general] [PATCHv4 05/10] ib/cm: Enable CM support for RDMAoE
Sean Hefty
sean.hefty at intel.com
Thu Aug 6 11:12:49 PDT 2009
>diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
>index f930f1d..63d6de3 100644
>--- a/drivers/infiniband/core/cm.c
>+++ b/drivers/infiniband/core/cm.c
>@@ -3699,7 +3699,7 @@ static void cm_add_one(struct ib_device *ib_device)
> set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
> for (i = 1; i <= ib_device->phys_port_cnt; i++) {
> tt = rdma_port_get_transport(ib_device, i);
>- if (tt != RDMA_TRANSPORT_IB)
>+ if (tt != RDMA_TRANSPORT_IB && tt != RDMA_TRANSPORT_RDMAOE)
> continue;
>
> port = kzalloc(sizeof *port, GFP_KERNEL);
>diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
>index 4f5096d..21c78f5 100644
>--- a/drivers/infiniband/core/ucm.c
>+++ b/drivers/infiniband/core/ucm.c
>@@ -1240,13 +1240,19 @@ static void ib_ucm_add_one(struct ib_device *device)
> {
> struct ib_ucm_device *ucm_dev;
> int i;
>+ enum rdma_transport_type tt;
>
> if (!device->alloc_ucontext || device->node_type == RDMA_NODE_IB_SWITCH)
> return;
>
>- for (i = 1; i <= device->phys_port_cnt; ++i)
>- if (rdma_port_get_transport(device, i) != RDMA_TRANSPORT_IB)
>- return;
>+ for (i = 1; i <= device->phys_port_cnt; ++i) {
>+ tt = rdma_port_get_transport(device, i);
>+ if (tt == RDMA_TRANSPORT_IB || tt == RDMA_TRANSPORT_RDMAOE)
>+ break;
>+ }
>+
>+ if (i > device->phys_port_cnt)
>+ return;
>
> ucm_dev = kzalloc(sizeof *ucm_dev, GFP_KERNEL);
> if (!ucm_dev)
nit: There's a slight change in logic here. Previously, the cm/ucm added a
device only if all ports were the correct type. Now, they add a device if any
port is the correct type. In practice, this shouldn't be an issue, but other
code in the cm/ucm is assuming that all ports on the device are usable.
More information about the general
mailing list