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>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
Zengbing Tu <tuzengbing@didiglobal.com>
Subject: Re: [net-next v6 4/4] net: bonding: add tracepoint for 802.3ad
Date: Tue, 24 Jun 2025 12:43:23 -0700 [thread overview]
Message-ID: <2482590.1750794203@famine> (raw)
In-Reply-To: <8DB4F573-128C-4A2D-A4D0-3909586AFF8C@bamaicloud.com>
Tonghao Zhang <tonghao@bamaicloud.com> wrote:
>> 2025年6月17日 18:37,Tonghao Zhang <tonghao@bamaicloud.com> 写道:
>>
>>> 2025年6月17日 08:28,Jay Vosburgh <jv@jvosburgh.net> 写道:
>>>
>>> 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.
>>>
>>> This patch really has nothing to do with the rest of the series
>>> (it's unrelated to the broadcast_neighbor functionality), and should
>>> really be sent separately.
>> … monitoring the lacp state is part of “no-stacking” arch solution. So I sent it as series.
>> if unnecessary, I will set it separately.
>>
>>> That said, I recall asking about work that was proposed some
>> Sorry I may miss your commits about this patch.
>>> time ago to create netlink events (visible to ip monitor, et al) when
>>> the LACP state changes. That would be a cleaner method to watch the
>>> LACP state machine (as it would integrate with all of the other event
>> Why not consider a BPF+tracepoint solution? It provides more flexible LACP data collection with simpler implementation.
>We developed a component. It collects kernel events via kprobe, ftrace, and tracepoint. Events include:
>- Scheduling latency
>- Direct memory reclaim
>- Network packets drop
>- LACP state events
>
>BPF + tracepoint is our optimal approach. I think we should support this method.
At present, as far as I know, networking state change events are
exported to user space through netlink. Absent a compelling reason why
the LACP state change cannot be exported via netlink, my view is that it
should be consistent with all other network events.
Also, to be clear, I'm asking for justification because this is
a request to do something in a special bonding-unique way. There are
already a lot of special cases in bonding, in which things are done
differently than the usual practice. Adding an API element, such as a
tracepoint, is forever, and as such adding one that also differs from
the usual practice deserves scrutiny.
-J
>>> infrastructure). Maybe I missed the response, but what became of that
>>> work?
>>>
>>> -J
>>>
>>>> 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>
>>>> Cc: Steven Rostedt <rostedt@goodmis.org>
>>>> Cc: Masami Hiramatsu <mhiramat@kernel.org>
>>>> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>>>> Cc: Nikolay Aleksandrov <razor@blackwall.org>
>>>> Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
>>>> Signed-off-by: Zengbing Tu <tuzengbing@didiglobal.com>
>>>> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
>>>> ---
>>>> 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);
>>>> +
>>>> 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
>
>
>
---
-Jay Vosburgh, jv@jvosburgh.net
next prev parent reply other threads:[~2025-06-24 19:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 3:44 [net-next v6 0/4] add broadcast_neighbor for no-stacking networking arch Tonghao Zhang
2025-06-10 3:44 ` [net-next v6 1/4] net: bonding: add broadcast_neighbor option for 802.3ad Tonghao Zhang
2025-06-16 23:04 ` Jakub Kicinski
2025-06-17 10:25 ` Tonghao Zhang
2025-06-10 3:44 ` [net-next v6 2/4] net: bonding: add broadcast_neighbor netlink option Tonghao Zhang
2025-06-10 3:44 ` [net-next v6 3/4] net: bonding: send peer notify when failure recovery Tonghao Zhang
2025-06-17 0:36 ` Jay Vosburgh
2025-06-17 10:47 ` Tonghao Zhang
2025-06-17 11:39 ` Tonghao Zhang
2025-06-18 2:51 ` Tonghao Zhang
2025-06-10 3:44 ` [net-next v6 4/4] net: bonding: add tracepoint for 802.3ad Tonghao Zhang
2025-06-17 0:28 ` Jay Vosburgh
2025-06-17 10:37 ` Tonghao Zhang
2025-06-23 2:11 ` Tonghao Zhang
2025-06-24 19:43 ` Jay Vosburgh [this message]
2025-06-26 2:57 ` Tonghao Zhang
2025-06-16 2:07 ` [net-next v6 0/4] add broadcast_neighbor for no-stacking networking arch Tonghao Zhang
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=2482590.1750794203@famine \
--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=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=rostedt@goodmis.org \
--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