From: Jay Vosburgh <jv@jvosburgh.net>
To: Tonghao Zhang <tonghao@bamaicloud.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Zengbing Tu <tuzengbing@didiglobal.com>
Subject: Re: [PATCH net-next v4 4/4] net: bonding: add tracepoint for 802.3ad
Date: Thu, 15 May 2025 11:30:14 +0200 [thread overview]
Message-ID: <28674.1747301414@vermin> (raw)
In-Reply-To: <DDF908383E15A2CE+20250514092534.27472-5-tonghao@bamaicloud.com>
Tonghao Zhang <tonghao@bamaicloud.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@jvosburgh.net>
>Cc: "David S. Miller" <davem@davemloft.net>
>Cc: Eric Dumazet <edumazet@google.com>
>Cc: Jakub Kicinski <kuba@kernel.org>
>Cc: Paolo Abeni <pabeni@redhat.com>
>Cc: Simon Horman <horms@kernel.org>
>Cc: Jonathan Corbet <corbet@lwn.net>
>Cc: Andrew Lunn <andrew+netdev@lunn.ch>
>Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
>Signed-off-by: Zengbing Tu <tuzengbing@didiglobal.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@jvosburgh.net
prev parent reply other threads:[~2025-05-15 9:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250514092534.27472-1-tonghao@bamaicloud.com>
2025-05-14 9:25 ` [PATCH net-next v4 1/4] net: bonding: add broadcast_neighbor option for 802.3ad Tonghao Zhang
2025-05-14 9:36 ` Nikolay Aleksandrov
2025-05-14 9:46 ` Nikolay Aleksandrov
2025-05-14 9:25 ` [PATCH net-next v4 2/4] net: bonding: add broadcast_neighbor netlink option Tonghao Zhang
2025-05-14 9:25 ` [PATCH net-next v4 3/4] net: bonding: send peer notify when failure recovery Tonghao Zhang
2025-05-14 9:39 ` Nikolay Aleksandrov
2025-05-14 9:25 ` [PATCH net-next v4 4/4] net: bonding: add tracepoint for 802.3ad Tonghao Zhang
2025-05-14 9:39 ` Nikolay Aleksandrov
2025-05-15 9:30 ` Jay Vosburgh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=28674.1747301414@vermin \
--to=jv@jvosburgh.net \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tonghao@bamaicloud.com \
--cc=tuzengbing@didiglobal.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox