lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250117134523.GO6206@kernel.org>
Date: Fri, 17 Jan 2025 13:45:23 +0000
From: Simon Horman <horms@...nel.org>
To: Xin Tian <tianx@...silicon.com>
Cc: netdev@...r.kernel.org, leon@...nel.org, andrew+netdev@...n.ch,
	kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
	davem@...emloft.net, jeff.johnson@....qualcomm.com,
	przemyslaw.kitszel@...el.com, weihg@...silicon.com,
	wanry@...silicon.com
Subject: Re: [PATCH v3 04/14] net-next/yunsilicon: Add qp and cq management

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 <weihg@...silicon.com>
> Signed-off-by: Honggang Wei <weihg@...silicon.com>
> Co-developed-by: Lei Yan <jacky@...silicon.com>
> Signed-off-by: Lei Yan <jacky@...silicon.com>
> Signed-off-by: Xin Tian <tianx@...silicon.com>

...

> diff --git a/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h b/drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h

...

> +// 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.

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ