diff mbox series

[v2,rdma-core,1/2] Update kernel headers

Message ID 20211116150316.21925-2-liangwenpeng@huawei.com (mailing list archive)
State Superseded
Headers show
Series libhns: Add support for direct wqe | expand

Commit Message

Wenpeng Liang Nov. 16, 2021, 3:03 p.m. UTC
To commit ?? ("RDMA/hns: Support direct wqe of userspace").

Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
 kernel-headers/rdma/hns-abi.h       |  2 ++
 kernel-headers/rdma/rdma_netlink.h  |  5 +++++
 kernel-headers/rdma/rdma_user_rxe.h | 14 +++++++++++---
 3 files changed, 18 insertions(+), 3 deletions(-)

Comments

Wenpeng Liang Nov. 16, 2021, 3:31 p.m. UTC | #1
On 2021/11/16 23:03, Wenpeng Liang wrote:
> To commit ?? ("RDMA/hns: Support direct wqe of userspace").
> 
> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> ---
>  kernel-headers/rdma/hns-abi.h       |  2 ++
>  kernel-headers/rdma/rdma_netlink.h  |  5 +++++
>  kernel-headers/rdma/rdma_user_rxe.h | 14 +++++++++++---
>  3 files changed, 18 insertions(+), 3 deletions(-)

Hi Leon,

I have encountered a problem and I hope to master a correct
submission method.

This user space patch modifies the hns-abi.h file, so I use the
python command to generate the patch to keep the kernel-headers
consistent with the kernel mode:

python3.5 kernel-headers/update --not-final <kernel space dir> <commitID>

In addition to the modification of hns-abi.h, the generated patch
also involves the modification of other files. And resulted in the
following compilation error:

/rdma-core/providers/rxe/rxe.c: In function ‘rxe_post_one_recv’:
/rdma-core/providers/rxe/rxe.c:712:17: error: ‘struct rxe_dma_info’ has no member named ‘sge’
   712 | memcpy(wqe->dma.sge, recv_wr->sg_list,
       | ^
/rdma-core/providers/rxe/rxe.c:713:38: error: ‘struct rxe_dma_info’ has no member named ‘sge’
   713 | wqe->num_sge*sizeof(*wqe->dma.sge));

In this case, what is the correct way to submit the patch? Should
I wait for the rxe patch submission to complete before submitting
this patchset, or submit only the hns part of the patch generated
by python?

Thanks,
Wenpeng
Jason Gunthorpe Nov. 16, 2021, 7:57 p.m. UTC | #2
On Tue, Nov 16, 2021 at 11:31:00PM +0800, Wenpeng Liang wrote:
> 
> On 2021/11/16 23:03, Wenpeng Liang wrote:
> > To commit ?? ("RDMA/hns: Support direct wqe of userspace").
> > 
> > Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> >  kernel-headers/rdma/hns-abi.h       |  2 ++
> >  kernel-headers/rdma/rdma_netlink.h  |  5 +++++
> >  kernel-headers/rdma/rdma_user_rxe.h | 14 +++++++++++---
> >  3 files changed, 18 insertions(+), 3 deletions(-)
> 
> Hi Leon,
> 
> I have encountered a problem and I hope to master a correct
> submission method.

https://github.com/linux-rdma/rdma-core/pull/1084

Jason
Leon Romanovsky Nov. 17, 2021, 2:24 p.m. UTC | #3
On Tue, Nov 16, 2021 at 11:31:00PM +0800, Wenpeng Liang wrote:
> 
> On 2021/11/16 23:03, Wenpeng Liang wrote:
> > To commit ?? ("RDMA/hns: Support direct wqe of userspace").
> > 
> > Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> > ---
> >  kernel-headers/rdma/hns-abi.h       |  2 ++
> >  kernel-headers/rdma/rdma_netlink.h  |  5 +++++
> >  kernel-headers/rdma/rdma_user_rxe.h | 14 +++++++++++---
> >  3 files changed, 18 insertions(+), 3 deletions(-)
> 
> Hi Leon,
> 
> I have encountered a problem and I hope to master a correct
> submission method.
> 
> This user space patch modifies the hns-abi.h file, so I use the
> python command to generate the patch to keep the kernel-headers
> consistent with the kernel mode:
> 
> python3.5 kernel-headers/update --not-final <kernel space dir> <commitID>
> 
> In addition to the modification of hns-abi.h, the generated patch
> also involves the modification of other files. And resulted in the
> following compilation error:
> 
> /rdma-core/providers/rxe/rxe.c: In function ‘rxe_post_one_recv’:
> /rdma-core/providers/rxe/rxe.c:712:17: error: ‘struct rxe_dma_info’ has no member named ‘sge’
>    712 | memcpy(wqe->dma.sge, recv_wr->sg_list,
>        | ^
> /rdma-core/providers/rxe/rxe.c:713:38: error: ‘struct rxe_dma_info’ has no member named ‘sge’
>    713 | wqe->num_sge*sizeof(*wqe->dma.sge));
> 
> In this case, what is the correct way to submit the patch? Should
> I wait for the rxe patch submission to complete before submitting
> this patchset, or submit only the hns part of the patch generated
> by python?

Please wait a couple of days, we will fix Jason's PR and I will release
rdma-core, so you will be able to submit without errors.

Thanks

> 
> Thanks,
> Wenpeng
diff mbox series

Patch

diff --git a/kernel-headers/rdma/hns-abi.h b/kernel-headers/rdma/hns-abi.h
index 42b17765..f6fde06d 100644
--- a/kernel-headers/rdma/hns-abi.h
+++ b/kernel-headers/rdma/hns-abi.h
@@ -77,10 +77,12 @@  enum hns_roce_qp_cap_flags {
 	HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
 	HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
 	HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
+	HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5,
 };
 
 struct hns_roce_ib_create_qp_resp {
 	__aligned_u64 cap_flags;
+	__aligned_u64 dwqe_mmap_key;
 };
 
 struct hns_roce_ib_alloc_ucontext_resp {
diff --git a/kernel-headers/rdma/rdma_netlink.h b/kernel-headers/rdma/rdma_netlink.h
index 75a1ae23..e50c3573 100644
--- a/kernel-headers/rdma/rdma_netlink.h
+++ b/kernel-headers/rdma/rdma_netlink.h
@@ -297,6 +297,8 @@  enum rdma_nldev_command {
 
 	RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */
 
+	RDMA_NLDEV_CMD_STAT_GET_STATUS,
+
 	RDMA_NLDEV_NUM_OPS
 };
 
@@ -549,6 +551,9 @@  enum rdma_nldev_attr {
 
 	RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK,	/* u8 */
 
+	RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX,	/* u32 */
+	RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */
+
 	/*
 	 * Always the end
 	 */
diff --git a/kernel-headers/rdma/rdma_user_rxe.h b/kernel-headers/rdma/rdma_user_rxe.h
index e283c222..f09c5c9e 100644
--- a/kernel-headers/rdma/rdma_user_rxe.h
+++ b/kernel-headers/rdma/rdma_user_rxe.h
@@ -98,6 +98,10 @@  struct rxe_send_wr {
 			__u32	remote_qpn;
 			__u32	remote_qkey;
 			__u16	pkey_index;
+			__u16	reserved;
+			__u32	ah_num;
+			__u32	pad[4];
+			struct rxe_av av;
 		} ud;
 		struct {
 			__aligned_u64	addr;
@@ -141,14 +145,13 @@  struct rxe_dma_info {
 	__u32			sge_offset;
 	__u32			reserved;
 	union {
-		__u8		inline_data[0];
-		struct rxe_sge	sge[0];
+		__DECLARE_FLEX_ARRAY(__u8, inline_data);
+		__DECLARE_FLEX_ARRAY(struct rxe_sge, sge);
 	};
 };
 
 struct rxe_send_wqe {
 	struct rxe_send_wr	wr;
-	struct rxe_av		av;
 	__u32			status;
 	__u32			state;
 	__aligned_u64		iova;
@@ -168,6 +171,11 @@  struct rxe_recv_wqe {
 	struct rxe_dma_info	dma;
 };
 
+struct rxe_create_ah_resp {
+	__u32 ah_num;
+	__u32 reserved;
+};
+
 struct rxe_create_cq_resp {
 	struct mminfo mi;
 };