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: <28674.1747301414@vermin>
Date: Thu, 15 May 2025 11:30:14 +0200
From: Jay Vosburgh <jv@...sburgh.net>
To: Tonghao Zhang <tonghao@...aicloud.com>
cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
    Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
    Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
    Jonathan Corbet <corbet@....net>,
    Andrew Lunn <andrew+netdev@...n.ch>,
    Zengbing Tu <tuzengbing@...iglobal.com>
Subject: Re: [PATCH net-next v4 4/4] net: bonding: add tracepoint for 802.3ad

Tonghao Zhang <tonghao@...aicloud.com> wrote:

>Users can monitor NIC link status changes through netlink. However, LACP
>protocol failures may occur despite operational physical links. There is
>no way to detect LACP state changes. This patch adds tracepoint at LACP state
>transition.
>
>Cc: Jay Vosburgh <jv@...sburgh.net>
>Cc: "David S. Miller" <davem@...emloft.net>
>Cc: Eric Dumazet <edumazet@...gle.com>
>Cc: Jakub Kicinski <kuba@...nel.org>
>Cc: Paolo Abeni <pabeni@...hat.com>
>Cc: Simon Horman <horms@...nel.org>
>Cc: Jonathan Corbet <corbet@....net>
>Cc: Andrew Lunn <andrew+netdev@...n.ch>
>Signed-off-by: Tonghao Zhang <tonghao@...aicloud.com>
>Signed-off-by: Zengbing Tu <tuzengbing@...iglobal.com>
>---
> drivers/net/bonding/bond_3ad.c |  6 ++++++
> include/trace/events/bonding.h | 37 ++++++++++++++++++++++++++++++++++
> 2 files changed, 43 insertions(+)
> create mode 100644 include/trace/events/bonding.h
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index d1c2d416ac87..55703230ab29 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -16,6 +16,9 @@
> #include <net/bond_3ad.h>
> #include <net/netlink.h>
> 
>+#define CREATE_TRACE_POINTS
>+#include <trace/events/bonding.h>
>+
> /* General definitions */
> #define AD_SHORT_TIMEOUT           1
> #define AD_LONG_TIMEOUT            0
>@@ -1146,6 +1149,9 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
> 			  port->actor_port_number,
> 			  last_state,
> 			  port->sm_mux_state);
>+
>+		trace_3ad_mux_state(port->slave->dev, last_state, port->sm_mux_state);
>+

	First, wasn't someone trying to integrate the LACP state changes
into the usual "ip monitor" netlink notifications?  What happened to
that?

	Second, the "3ad" nomenclature is obsolete; it refers to the
original IEEE 802.3ad standard, which was replaced by 802.1AX in 2008.
Most of the time, though, folks refer to this as "LACP."  Anyway, my
point here is that the name, assuming we go with a tracepoint, should
have "lacp" in it instead of "3ad."

	-J

> 		switch (port->sm_mux_state) {
> 		case AD_MUX_DETACHED:
> 			port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
>diff --git a/include/trace/events/bonding.h b/include/trace/events/bonding.h
>new file mode 100644
>index 000000000000..1ee4b07d912a
>--- /dev/null
>+++ b/include/trace/events/bonding.h
>@@ -0,0 +1,37 @@
>+/* SPDX-License-Identifier: GPL-2.0 */
>+
>+#if !defined(_TRACE_BONDING_H) || defined(TRACE_HEADER_MULTI_READ)
>+#define _TRACE_BONDING_H
>+
>+#include <linux/netdevice.h>
>+#include <linux/tracepoint.h>
>+
>+#undef TRACE_SYSTEM
>+#define TRACE_SYSTEM bonding
>+
>+TRACE_EVENT(3ad_mux_state,
>+	TP_PROTO(struct net_device *dev, u32 last_state, u32 curr_state),
>+	TP_ARGS(dev, last_state, curr_state),
>+
>+	TP_STRUCT__entry(
>+		__field(int, ifindex)
>+		__string(dev_name, dev->name)
>+		__field(u32, last_state)
>+		__field(u32, curr_state)
>+	),
>+
>+	TP_fast_assign(
>+		__entry->ifindex = dev->ifindex;
>+		__assign_str(dev_name);
>+		__entry->last_state = last_state;
>+		__entry->curr_state = curr_state;
>+	),
>+
>+	TP_printk("ifindex %d dev %s last_state 0x%x curr_state 0x%x",
>+		  __entry->ifindex, __get_str(dev_name),
>+		  __entry->last_state, __entry->curr_state)
>+);
>+
>+#endif /* _TRACE_BONDING_H */
>+
>+#include <trace/define_trace.h>
>-- 
>2.34.1
>
>

---
	-Jay Vosburgh, jv@...sburgh.net

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ