RE: [PATCH v2] [RFC] rdma/cm: support option to allow manually setting IB path

Sean Hefty
2009-10-22T17:52:13Z

>> +static int ucma_set_ib_path(struct ucma_context *ctx,
>> + struct ib_path_rec_data *path_data, size_t optlen)
>> +{
>> + struct ib_sa_path_rec sa_path;
>> + struct rdma_cm_event event;
>> + int ret;
>> +
>> + if (optlen != sizeof(*path_data))
>> + return -EINVAL;
>> +
>> + if (path_data->flags != IB_PATH_GMP | IB_PATH_PRIMARY |
>> + IB_PATH_OUTBOUND | IB_PATH_INBOUND)
>> + return -EINVAL;
>
>This should accept an array here, to aid easing in APM support:

I agree - I thought about this after sending the patch. This is more what I
think is needed at this point:

if ((optlen % sizeof(*path_data)) != 0) return -EINVAL;

if (number of paths > 1)
return -ENOSYS;

if (path_data->flags != (IB_PATH_GMP | IB_PATH_PRIMARY |
IB_PATH_OUTBOUND | IB_PATH_INBOUND))

return -EINVAL;

>Could you do basic APM support right now, exactly with the same
>capability as ucm has?

The rdma_cm is not coded to handle APM. That should be a separate patch.

>
>> +enum {
>> + IB_PATH_GMP = 1,
>> + IB_PATH_PRIMARY = (1<<1),
>> + IB_PATH_ALTERNATE = (1<<2),
>> + IB_PATH_OUTBOUND = (1<<3),
>> + IB_PATH_INBOUND = (1<<4)
>> +};
>
>I like the PATH_PRIMARY/PATH_ALTERNATE idea,
>
>But I think IB_PATH_OUTBOUND_REV is still required.

I'm not fond of the reverse idea. Why do you think it's needed?