mbox series

[rdma-next,v3,0/2] IB device in-kernel API support indication

Message ID 1546951333-8109-1-git-send-email-galpress@amazon.com (mailing list archive)
Headers show
Series IB device in-kernel API support indication | expand

Message

Gal Pressman Jan. 8, 2019, 12:42 p.m. UTC
Hello all,
This patchset marks drivers that do not implement all mandatory verbs for
kverbs as non-kverbs providers though a flag in the IB device.  Currently, ULPs
add the device and fail when trying to make actual use.  Instead, in case of
missing verbs, mark the device as a non-kverbs provider and allow clients to
exit gracefully.

This also removes the need for stubs implementation of unsupported verbs, which
will no longer fail the device registration but mark the device as non-kverbs
provider.

A 'no_kverbs_req' flag is added to the ib_clients, which is off by default
except for uverbs. This is added in order to identify the uverbs module when
registering a new device/client.
It can also be done using name comparison but the flag seems better to me.

Patch #1 adds the flag to the IB device and marks devices that do not implement
all needed kverbs functions.
Patch #2 removes all stub functions from usnic.

Another pair of eyes going through the different callback usage flows is
welcome :), flows that are already protected (uapi METHOD_NEEDS_FN NULL check,
kernel verbs only flows) do not check for NULL prior to using callback.

This patchset is introduced following the discussion over the EFA driver [1],
which initially does not provide in-kernel API support.

[1] https://patchwork.kernel.org/cover/10711629/

Changelog:
v2->v3
* Remove warning print when mandatory verb is not implemented
* Change comment of no_kverbs_req flag
* Add NULL checks for callbacks in unprotected flows
v1->v2
* Make core code mark devices instead of having each driver advertise its support
* Prevent clients device addition in core code instead of inside the clients

Thanks,
Gal

Gal Pressman (2):
  RDMA: Add indication for in kernel API support to IB device
  IB/usnic: Remove stub functions

 drivers/infiniband/core/device.c             | 41 +++++++++++++--------
 drivers/infiniband/core/uverbs_main.c        |  1 +
 drivers/infiniband/core/verbs.c              | 28 +++++++++++++--
 drivers/infiniband/hw/mlx5/main.c            |  3 ++
 drivers/infiniband/hw/usnic/usnic_ib_main.c  |  7 ----
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 53 ----------------------------
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 15 --------
 include/rdma/ib_verbs.h                      |  5 +++
 8 files changed, 60 insertions(+), 93 deletions(-)

Comments

Majd Dibbiny Jan. 8, 2019, 9:18 p.m. UTC | #1
> On Jan 8, 2019, at 2:42 PM, Gal Pressman <galpress@amazon.com> wrote:
> 
> Hello all,
> This patchset marks drivers that do not implement all mandatory verbs for
> kverbs as non-kverbs providers though
through
>  a flag in the IB device.  Currently, ULPs
> add the device and fail when trying to make actual use.  Instead, in case of
> missing verbs, mark the device as a non-kverbs provider and allow clients to
> exit gracefully.
> 
> This also removes the need for stubs implementation of unsupported verbs, which
> will no longer fail the device registration but mark the device as non-kverbs
> provider.
> 
> A 'no_kverbs_req' flag is added to the ib_clients, which is off by default
> except for uverbs. This is added in order to identify the uverbs module when
> registering a new device/client.
> It can also be done using name comparison but the flag seems better to me.
> 
> Patch #1 adds the flag to the IB device and marks devices that do not implement
> all needed kverbs functions.
> Patch #2 removes all stub functions from usnic.
> 
> Another pair of eyes going through the different callback usage flows is
> welcome :), flows that are already protected (uapi METHOD_NEEDS_FN NULL check,
> kernel verbs only flows) do not check for NULL prior to using callback.
> 
> This patchset is introduced following the discussion over the EFA driver [1],
> which initially does not provide in-kernel API support.
> 
> [1] https://patchwork.kernel.org/cover/10711629/
> 
> Changelog:
> v2->v3
> * Remove warning print when mandatory verb is not implemented
> * Change comment of no_kverbs_req flag
> * Add NULL checks for callbacks in unprotected flows
> v1->v2
> * Make core code mark devices instead of having each driver advertise its support
> * Prevent clients device addition in core code instead of inside the clients
> 
> Thanks,
> Gal
> 
> Gal Pressman (2):
>  RDMA: Add indication for in kernel API support to IB device
>  IB/usnic: Remove stub functions
> 
> drivers/infiniband/core/device.c             | 41 +++++++++++++--------
> drivers/infiniband/core/uverbs_main.c        |  1 +
> drivers/infiniband/core/verbs.c              | 28 +++++++++++++--
> drivers/infiniband/hw/mlx5/main.c            |  3 ++
> drivers/infiniband/hw/usnic/usnic_ib_main.c  |  7 ----
> drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 53 ----------------------------
> drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 15 --------
> include/rdma/ib_verbs.h                      |  5 +++
> 8 files changed, 60 insertions(+), 93 deletions(-)
> 
> -- 
> 2.7.4
>
Gal Pressman Jan. 9, 2019, 7:33 a.m. UTC | #2
On 08-Jan-19 23:18, Majd Dibbiny wrote:
> 
>> On Jan 8, 2019, at 2:42 PM, Gal Pressman <galpress@amazon.com> wrote:
>>
>> Hello all,
>> This patchset marks drivers that do not implement all mandatory verbs for
>> kverbs as non-kverbs providers though
> through

Thanks Majd, will fix.

>>  a flag in the IB device.  Currently, ULPs
>> add the device and fail when trying to make actual use.  Instead, in case of
>> missing verbs, mark the device as a non-kverbs provider and allow clients to
>> exit gracefully.
>>
>> This also removes the need for stubs implementation of unsupported verbs, which
>> will no longer fail the device registration but mark the device as non-kverbs
>> provider.
>>
>> A 'no_kverbs_req' flag is added to the ib_clients, which is off by default
>> except for uverbs. This is added in order to identify the uverbs module when
>> registering a new device/client.
>> It can also be done using name comparison but the flag seems better to me.
>>
>> Patch #1 adds the flag to the IB device and marks devices that do not implement
>> all needed kverbs functions.
>> Patch #2 removes all stub functions from usnic.
>>
>> Another pair of eyes going through the different callback usage flows is
>> welcome :), flows that are already protected (uapi METHOD_NEEDS_FN NULL check,
>> kernel verbs only flows) do not check for NULL prior to using callback.
>>
>> This patchset is introduced following the discussion over the EFA driver [1],
>> which initially does not provide in-kernel API support.
>>
>> [1] https://patchwork.kernel.org/cover/10711629/
>>
>> Changelog:
>> v2->v3
>> * Remove warning print when mandatory verb is not implemented
>> * Change comment of no_kverbs_req flag
>> * Add NULL checks for callbacks in unprotected flows
>> v1->v2
>> * Make core code mark devices instead of having each driver advertise its support
>> * Prevent clients device addition in core code instead of inside the clients
>>
>> Thanks,
>> Gal
>>
>> Gal Pressman (2):
>>  RDMA: Add indication for in kernel API support to IB device
>>  IB/usnic: Remove stub functions
>>
>> drivers/infiniband/core/device.c             | 41 +++++++++++++--------
>> drivers/infiniband/core/uverbs_main.c        |  1 +
>> drivers/infiniband/core/verbs.c              | 28 +++++++++++++--
>> drivers/infiniband/hw/mlx5/main.c            |  3 ++
>> drivers/infiniband/hw/usnic/usnic_ib_main.c  |  7 ----
>> drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 53 ----------------------------
>> drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 15 --------
>> include/rdma/ib_verbs.h                      |  5 +++
>> 8 files changed, 60 insertions(+), 93 deletions(-)
>>
>> -- 
>> 2.7.4
>>