New GID query API broke EFA
Hi all,
The new IOCTL query GID API 9f85cbe50aa0 ("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, as ibv_query_gid() no longer works.
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;
EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
Gal
Leon Romanovsky
maintainerQuoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.
Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to rdma_get_gid_attr() for devices without GID table.
1234 table = rdma_gid_table(device, port_num);
1235 if (index < 0 || index >= table->sz)
1236 return ERR_PTR(-EINVAL);
So you can extend that function to return for table == NULL an error and remove rdma_ib_or_roce()
Thanks
Quoted 2 lines
Gal
Quoted 14 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
Quoted 8 lines
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()
Thanks Leon, I will send a patch.
Jason Gunthorpe
maintainerQuoted 14 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
Quoted 8 lines
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()
How does table == NULL ever?
Jason
Quoted 21 lines · Jason Gunthorpe
Quoted 20 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);
Quoted 4 lines
Quoted 2 lines
So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()How does table == NULL ever?
A driver with gid_tbl_len == 0 would make the allocation return NULL, no?
Quoted 22 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 20 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()How does table == NULL ever?
A driver with
gid_tbl_len== 0 would make the allocation return NULL, no?
Nevermind, we don't really allocate with gid_tbl_len as the size, and any allocation failure will fail ib_register_device().
So I guess there is no way for it to be NULL.
Leon Romanovsky
maintainerQuoted 26 lines · Gal Pressman
Quoted 25 lines · Gal Pressman
Quoted 24 lines · Jason Gunthorpe
Quoted 22 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
How does table == NULL ever?
A driver with
gid_tbl_len== 0 would make the allocation return NULL, no?Nevermind, we don't really allocate with
gid_tbl_lenas the size, and any allocation failure will failib_register_device().
So I guess there is no way for it to be NULL.
I think so too.
Thanks
Leon Romanovsky
maintainerQuoted 21 lines · Jason Gunthorpe
Quoted 20 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);
Quoted 4 lines
Quoted 2 lines
So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()How does table == NULL ever?
ok, you are right in that regards.
However, mlx5 IB representors don't support GIDs and sets gid_tbl_len to be zero. Do we want to rely on the assumption that table will always exist?
Thanks
Quoted 2 lines
Jason
Jason Gunthorpe
maintainerQuoted 22 lines · Leon Romanovsky
Quoted 21 lines · Jason Gunthorpe
Quoted 20 lines · Leon Romanovsky
Quoted 5 lines · Gal Pressman
Hi all,
The new IOCTL query GID API
9f85cbe50aa0("RDMA/uverbs: Expose the new GID query API to user space") currently breaks EFA, asibv_query_gid()no longer works.Quoted 7 lines
The problem is that the IOCTL call checks for:
if (!rdma_ib_or_roce(ib_dev, port_num)) return -EOPNOTSUPP;EFA is neither of these, but it uses GIDs.
Any objections to remove the check? Any other solutions come to mind?
We added this check to protect access to
rdma_get_gid_attr()for devices without GID table.
1234 table =rdma_gid_table(device, port_num);
1235 if (index < 0 || index >=table->sz)
1236 returnERR_PTR(-EINVAL);
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
So you can extend that function to return for table == NULL an error and remove
rdma_ib_or_roce()How does table == NULL ever?
ok, you are right in that regards.
However, mlx5 IB representors don't support GIDs and setsgid_tbl_lento be zero. Do we want to rely on the assumption that table will always exist?
We do already, seems like the rdma_ib_or_roce should just be deleted
Jason