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: <1572132594-2006-2-git-send-email-aroulin@cumulusnetworks.com>
Date:   Sat, 26 Oct 2019 16:29:52 -0700
From:   Andy Roulin <aroulin@...ulusnetworks.com>
To:     netdev@...r.kernel.org
Cc:     dsahern@...il.com, nikolay@...ulusnetworks.com,
        roopa@...ulusnetworks.com, j.vosburgh@...il.com, vfalico@...il.com,
        andy@...yhouse.net
Subject: [PATCH net-next 1/3] bonding: move 3ad port state defs to include/uapi

The actor and partner 802.3ad operating states are exported to userspace
in bond_netlink.c, see bond_slave_fill_info with the following
attributes:

- IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE; and
- IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE.

The operating states are exported as bitfields and userspace lacks a way
to interpret them, e.g., iproute2 only prints the states as numbers.

For userspace to interpret kernel bitfields, the bitfield definitions
should be part of the uapi. The bitfield itself is defined in the 802.3ad
standard.

This commit moves the 802.3ad bitfield definitions to
uapi/linux/if_bonding.h

Signed-off-by: Andy Roulin <aroulin@...ulusnetworks.com>
Acked-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Acked-by: Roopa Prabhu <roopa@...ulusnetworks.com>
---
 drivers/net/bonding/bond_3ad.c  | 10 ----------
 include/uapi/linux/if_bonding.h | 10 ++++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 9274dcc6e9b0..503af517bc64 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -48,16 +48,6 @@
 #define AD_CHURN_DETECTION_TIME    60
 #define AD_AGGREGATE_WAIT_TIME     2
 
-/* Port state definitions (43.4.2.2 in the 802.3ad standard) */
-#define AD_STATE_LACP_ACTIVITY   0x1
-#define AD_STATE_LACP_TIMEOUT    0x2
-#define AD_STATE_AGGREGATION     0x4
-#define AD_STATE_SYNCHRONIZATION 0x8
-#define AD_STATE_COLLECTING      0x10
-#define AD_STATE_DISTRIBUTING    0x20
-#define AD_STATE_DEFAULTED       0x40
-#define AD_STATE_EXPIRED         0x80
-
 /* Port Variables definitions used by the State Machines (43.4.7 in the
  * 802.3ad standard)
  */
diff --git a/include/uapi/linux/if_bonding.h b/include/uapi/linux/if_bonding.h
index 790585f0e61b..6829213a54c5 100644
--- a/include/uapi/linux/if_bonding.h
+++ b/include/uapi/linux/if_bonding.h
@@ -95,6 +95,16 @@
 #define BOND_XMIT_POLICY_ENCAP23	3 /* encapsulated layer 2+3 */
 #define BOND_XMIT_POLICY_ENCAP34	4 /* encapsulated layer 3+4 */
 
+/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */
+#define AD_STATE_LACP_ACTIVITY   0x1
+#define AD_STATE_LACP_TIMEOUT    0x2
+#define AD_STATE_AGGREGATION     0x4
+#define AD_STATE_SYNCHRONIZATION 0x8
+#define AD_STATE_COLLECTING      0x10
+#define AD_STATE_DISTRIBUTING    0x20
+#define AD_STATE_DEFAULTED       0x40
+#define AD_STATE_EXPIRED         0x80
+
 typedef struct ifbond {
 	__s32 bond_mode;
 	__s32 num_slaves;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ