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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4eb26cb5-c46e-498f-ad3a-be740737715d@lunn.ch>
Date: Fri, 6 Feb 2026 04:01:02 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "illusion.wang" <illusion.wang@...ula-matrix.com>
Cc: dimon.zhao@...ula-matrix.com, alvin.wang@...ula-matrix.com,
	sam.chen@...ula-matrix.com, netdev@...r.kernel.org,
	andrew+netdev@...n.ch, corbet@....net, kuba@...nel.org,
	linux-doc@...r.kernel.org, lorenzo@...nel.org, pabeni@...hat.com,
	horms@...nel.org, vadim.fedorenko@...ux.dev,
	lukas.bulwahn@...hat.com, edumazet@...gle.com,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 net-next 01/11] net/nebula-matrix: add minimum nbl
 build framework

> +#define NBL_CAP_TEST_BIT(val, loc) (((val) >> (loc)) & 0x1)
> +
> +#define NBL_CAP_IS_CTRL(val) NBL_CAP_TEST_BIT(val, NBL_CAP_HAS_CTRL_BIT)
> +#define NBL_CAP_IS_NET(val) NBL_CAP_TEST_BIT(val, NBL_CAP_HAS_NET_BIT)
> +#define NBL_CAP_IS_NIC(val) NBL_CAP_TEST_BIT(val, NBL_CAP_IS_NIC_BIT)
> +#define NBL_CAP_IS_OCP(val) NBL_CAP_TEST_BIT(val, NBL_CAP_IS_OCP_BIT)
> +#define NBL_CAP_IS_LEONIS(val) NBL_CAP_TEST_BIT(val, NBL_CAP_IS_LEONIS_BIT)
> +
> +enum {
> +	NBL_CAP_HAS_CTRL_BIT = 0,
> +	NBL_CAP_HAS_NET_BIT,
> +	NBL_CAP_IS_NIC_BIT,
> +	NBL_CAP_IS_LEONIS_BIT,
> +	NBL_CAP_IS_OCP_BIT,
> +};

> +static const struct pci_device_id nbl_id_table[] = {
> +	{ PCI_DEVICE(NBL_VENDOR_ID, NBL_DEVICE_ID_M18110),
> +	  .driver_data = BIT(NBL_CAP_HAS_NET_BIT) | BIT(NBL_CAP_IS_NIC_BIT) |
> +			 BIT(NBL_CAP_IS_LEONIS_BIT) },
> +	{ PCI_DEVICE(NBL_VENDOR_ID, NBL_DEVICE_ID_M18110_LX),
> +	  .driver_data = BIT(NBL_CAP_HAS_NET_BIT) | BIT(NBL_CAP_IS_NIC_BIT) |
> +			 BIT(NBL_CAP_IS_LEONIS_BIT) },

This seems overly complicated. Maybe NBL_CAP_* should be directly
BIT() values? 

NBL_CAP_TEST_BIT then goes away:

#define NBL_CAP_IS_CTRL(val) (val & NBL_CAP_HAS_CTRL_BIT)

which is simple enough you can have it inline, macro not needed.

It is however hard to say, because you add these macros here, but
don't have any uses of them.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ