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: <20240403212931.128541-6-rrameshbabu@nvidia.com>
Date: Wed,  3 Apr 2024 14:28:43 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org
Cc: ahmed.zaki@...el.com,
	aleksander.lobakin@...el.com,
	alexandre.torgue@...s.st.com,
	andrew@...n.ch,
	cjubran@...dia.com,
	corbet@....net,
	davem@...emloft.net,
	dtatulea@...dia.com,
	edumazet@...gle.com,
	gal@...dia.com,
	hkallweit1@...il.com,
	jacob.e.keller@...el.com,
	jiri@...nulli.us,
	joabreu@...opsys.com,
	justinstitt@...gle.com,
	kory.maincent@...tlin.com,
	kuba@...nel.org,
	leon@...nel.org,
	liuhangbin@...il.com,
	maxime.chevallier@...tlin.com,
	pabeni@...hat.com,
	paul.greenwalt@...el.com,
	przemyslaw.kitszel@...el.com,
	rdunlap@...radead.org,
	richardcochran@...il.com,
	saeed@...nel.org,
	tariqt@...dia.com,
	vadim.fedorenko@...ux.dev,
	vladimir.oltean@....com,
	wojciech.drewek@...el.com,
	Rahul Rameshbabu <rrameshbabu@...dia.com>
Subject: [PATCH net-next v2 5/6] netlink: specs: ethtool: add header-flags enumeration

Enable specifying header flags using enumerated entries in the spec file
rather than raw flag values.

Suggested-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@...dia.com>
Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
---
 Documentation/netlink/specs/ethtool.yaml |  5 +++++
 include/uapi/linux/ethtool_netlink.h     | 11 +++++------
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index f5aa1e7f3383..bae3bb013787 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -16,6 +16,10 @@ definitions:
     name: stringset
     type: enum
     entries: []
+  -
+    name: header-flags
+    type: flags
+    entries: [ compact-bitset, omit-reply, stats ]
 
 attribute-sets:
   -
@@ -30,6 +34,7 @@ attribute-sets:
       -
         name: flags
         type: u32
+        enum: header-flags
 
   -
     name: bitset-bit
diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h
index 8dfd714c2308..34a4a64262b2 100644
--- a/include/uapi/linux/ethtool_netlink.h
+++ b/include/uapi/linux/ethtool_netlink.h
@@ -117,12 +117,11 @@ enum {
 
 /* request header */
 
-/* use compact bitsets in reply */
-#define ETHTOOL_FLAG_COMPACT_BITSETS	(1 << 0)
-/* provide optional reply for SET or ACT requests */
-#define ETHTOOL_FLAG_OMIT_REPLY	(1 << 1)
-/* request statistics, if supported by the driver */
-#define ETHTOOL_FLAG_STATS		(1 << 2)
+enum ethtool_header_flags {
+	ETHTOOL_FLAG_COMPACT_BITSETS	= 1 << 0,	/* use compact bitsets in reply */
+	ETHTOOL_FLAG_OMIT_REPLY		= 1 << 1,	/* provide optional reply for SET or ACT requests */
+	ETHTOOL_FLAG_STATS		= 1 << 2,	/* request statistics, if supported by the driver */
+};
 
 #define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
 			  ETHTOOL_FLAG_OMIT_REPLY | \
-- 
2.42.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ