diff mbox series

[d/azure,2/2] UBUNTU: SAUCE: Expose extended attributes for user IB verbs QUERY_DEVICE, CREATE_CQ and CREATE_QP

Message ID 20190814180804.6019-2-marcelo.cerri@canonical.com
State New
Headers show
Series None | expand

Commit Message

Marcelo Henrique Cerri Aug. 14, 2019, 6:08 p.m. UTC
From: Long Li <longli@microsoft.com>

BugLink: https://bugs.launchpad.net/bugs/1839673

The user-mode driver may call this IB verbs to get extended data. The RDMA layer
checks if those data are available in lower layer, and copy those data back to user
mode. There is no need to change lower layer driver as those data have already been
returned in RDMA-lower driver interfaces.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sultan Alsawaf Aug. 14, 2019, 6:19 p.m. UTC | #1
On Wed, Aug 14, 2019 at 03:08:04PM -0300, Marcelo Henrique Cerri wrote:
> From: Long Li <longli@microsoft.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1839673
> 
> The user-mode driver may call this IB verbs to get extended data. The RDMA layer
> checks if those data are available in lower layer, and copy those data back to user
> mode. There is no need to change lower layer driver as those data have already been
> returned in RDMA-lower driver interfaces.
> 
> Signed-off-by: Long Li <longli@microsoft.com>
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c b/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
> index 3ad27e9d6a5d..1877cf60853b 100644
> --- a/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
> +++ b/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
> @@ -2669,6 +2669,11 @@ int hvnd_register_device(struct hvnd_dev *dev, char *ip_addr, char *mac_addr)
>  
>  	dev->ibdev.ops.get_port_immutable = hvnd_get_port_immutable;
>  
> +	dev->ibdev.uverbs_ex_cmd_mask |=
> +                (1ull << IB_USER_VERBS_EX_CMD_QUERY_DEVICE) |
> +                (1ull << IB_USER_VERBS_EX_CMD_CREATE_CQ) |
> +                (1ull << IB_USER_VERBS_EX_CMD_CREATE_QP);
> +
>  	//DMA ops for mapping all possible addresses
>  	dev->ibdev.dev.parent = &(dev->hvdev->device);
>  	dev->ibdev.dev.dma_ops = &vmbus_dma_ops;
> -- 
> 2.20.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c b/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
index 3ad27e9d6a5d..1877cf60853b 100644
--- a/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
+++ b/drivers/infiniband/hw/vmbus-rdma/vmbus-rdma-144.0/provider.c
@@ -2669,6 +2669,11 @@  int hvnd_register_device(struct hvnd_dev *dev, char *ip_addr, char *mac_addr)
 
 	dev->ibdev.ops.get_port_immutable = hvnd_get_port_immutable;
 
+	dev->ibdev.uverbs_ex_cmd_mask |=
+                (1ull << IB_USER_VERBS_EX_CMD_QUERY_DEVICE) |
+                (1ull << IB_USER_VERBS_EX_CMD_CREATE_CQ) |
+                (1ull << IB_USER_VERBS_EX_CMD_CREATE_QP);
+
 	//DMA ops for mapping all possible addresses
 	dev->ibdev.dev.parent = &(dev->hvdev->device);
 	dev->ibdev.dev.dma_ops = &vmbus_dma_ops;