Re: [PATCH v3 04/14] net-next/yunsilicon: Add qp and cq management
flat view
From: Simon Horman <horms@kernel.org>
Date: 2025-01-17 13:45:28
On Wed, Jan 15, 2025 at 06:22:51PM +0800, Xin Tian wrote:
Add qp(queue pair) and cq(completion queue) resource management APIs Co-developed-by: Honggang Wei <redacted> Signed-off-by: Honggang Wei <redacted> Co-developed-by: Lei Yan <redacted> Signed-off-by: Lei Yan <redacted> Signed-off-by: Xin Tian <redacted>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h b/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h
...
quoted hunk ↗ jump to hunk
+// qp +struct xsc_send_wqe_ctrl_seg { + __le32 msg_opcode:8; + __le32 with_immdt:1; + __le32 csum_en:2; + __le32 ds_data_num:5; + __le32 wqe_id:16; + __le32 msg_len; + union { + __le32 opcode_data; + struct { + u8 has_pph:1; + u8 so_type:1; + __le16 so_data_size:14; + u8:8; + u8 so_hdr_len:8; + }; + struct { + __le16 desc_id; + __le16 is_last_wqe:1; + __le16 dst_qp_id:15; + }; + }; + __le32 se:1; + __le32 ce:1; + __le32:30; +}; + +struct xsc_wqe_data_seg { + union { + __le32 in_line:1; + struct { + __le32:1; + __le32 seg_len:31; + __le32 mkey; + __le64 va; + }; + struct { + __le32:1; + __le32 len:7; + u8 in_line_data[15]; + }; + }; +};
Hi Xin Tian, Sparse seems very unhappy about the combination of __le32 and bitfields in struct xsc_send_wqe_ctrl_seg and struct xsc_wqe_data_seg. .../xsc_core.h:87:35: error: invalid bitfield specifier for type restricted __le32. ... I did not look into this deeply. But, in general, I would suggest using GET_FIELD and SET_FIELD as an alternative to bitfields. ...