public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: "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>, Shuah Khan <shuah@kernel.org>,
	Alexander Sverdlin <alexander.sverdlin@gmail.com>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jonas Gorski <jonas.gorski@gmail.com>
Subject: Re: [PATCH] selftests: net: local_termination: test link-local protocols
Date: Tue, 10 Mar 2026 11:08:02 +0200	[thread overview]
Message-ID: <20260310090802.3fr4i5wkcyeydlio@skbuf> (raw)
In-Reply-To: <a085c707b3085eea58850f125c51a8868c5fb6f1.1773072062.git.daniel@makrotopia.org>

On Mon, Mar 09, 2026 at 04:03:57PM +0000, Daniel Golle wrote:
> Add tests to local_termination.sh to verify that link-local frames
> arrive. On some switches the DSA driver uses bridges to connect the
> user ports to their CPU ports. More "intelligent" switches typically
> don't forward link-local frames, but may trap them to an internal
> microcontroller. The driver may have to change trapping rules, so
> link-local frames end up on the DSA CPU ports instead of being
> silently dropped or trapped to the internal microcontroller of the
> switch.
> 
> Add two tests which help to validate this has been done correctly:
>  - Link-local STP BPDU should always arrive at the Linux netdev

I don't really like the "always" comment here. The only reason why STP
is part of the forwarding plane and not the control plane is because the
bridge has stp_state=0. See br_handle_frame():

	if (unlikely(is_link_local_ether_addr(dest))) {
		u16 fwd_mask = p->br->group_fwd_mask_required;

		/*
		 * See IEEE 802.1D Table 7-10 Reserved addresses
		 *
		 * Assignment		 		Value
		 * Bridge Group Address		01-80-C2-00-00-00
		 * (MAC Control) 802.3		01-80-C2-00-00-01
		 * (Link Aggregation) 802.3	01-80-C2-00-00-02
		 * 802.1X PAE address		01-80-C2-00-00-03
		 *
		 * 802.1AB LLDP 		01-80-C2-00-00-0E
		 *
		 * Others reserved for future standardization
		 */
		fwd_mask |= p->group_fwd_mask;
		switch (dest[5]) {
		case 0x00:	/* Bridge Group Address */
			/* If STP is turned off,
			   then must forward to keep loop detection */
			if (p->br->stp_enabled == BR_NO_STP ||
			    fwd_mask & (1u << dest[5]))
				goto forward;
			*pskb = skb;
			__br_handle_local_finish(skb);
			return RX_HANDLER_PASS;

perhaps this can be part of the commit message somehow.

>  - Link-local LLDP should arrive at standalone ports (and the test
>    should be skipped on bridged ports similar to how it is done
>    for the IEEE1588v2/PTP tests)
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---

With that addressed:

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>

      reply	other threads:[~2026-03-10  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 16:03 [PATCH] selftests: net: local_termination: test link-local protocols Daniel Golle
2026-03-10  9:08 ` Vladimir Oltean [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=20260310090802.3fr4i5wkcyeydlio@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=alexander.sverdlin@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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