Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"robh@kernel.org" <robh@kernel.org>,
	"lxu@maxlinear.com" <lxu@maxlinear.com>,
	"john@phrozen.org" <john@phrozen.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"yweng@maxlinear.com" <yweng@maxlinear.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"bxu@maxlinear.com" <bxu@maxlinear.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"ajayaraman@maxlinear.com" <ajayaraman@maxlinear.com>,
	"fchan@maxlinear.com" <fchan@maxlinear.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"hauke@hauke-m.de" <hauke@hauke-m.de>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jpovazanec@maxlinear.com" <jpovazanec@maxlinear.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>
Subject: Re: [PATCH net-next v7 12/12] net: dsa: add driver for MaxLinear GSW1xx switch family
Date: Thu, 6 Nov 2025 19:29:58 +0200	[thread overview]
Message-ID: <20251106172958.jjfr3jbzlyexmidg@skbuf> (raw)
In-Reply-To: <6c4144088bbf367f6b166b4f3eceef16afdc19c1.camel@siemens.com>

On Thu, Nov 06, 2025 at 04:36:55PM +0000, Sverdlin, Alexander wrote:
> Hi Vladimir,
> 
> On Thu, 2025-11-06 at 17:26 +0100, Alexander Sverdlin wrote:
> > > > The remaining failing test cases are:
> > > > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to unknown MAC address   [FAIL]
> > > >          reception succeeded, but should have failed
> > > > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to unknown MAC address, allmulti   [FAIL]
> > > >          reception succeeded, but should have failed
> > > > 
> > > > So far I didn't notice any problems with untagged read-word IP traffic over
> > > > GSW145 ports.
> > > > 
> > > > Do you have a suggestion what could I check further regarding the failing
> > > > test cases? As I understood, all of them pass on your side?
> > > 
> > > These failures mean that the test thinks the port implements IFF_UNICAST_FLT,
> > > yet it doesn't drop unregistered traffic.
> > > 
> > >  	[ $no_unicast_flt = true ] && should_receive=true || should_receive=false
> > >  	check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \
> > >  		"$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \
> > >  		$should_receive "$test_name"
> > > 
> > > But DSA doesn't report IFF_UNICAST_FLT for this switch, because it doesn't fulfill
> > > the dsa_switch_supports_uc_filtering() requirements. So should_receive should have
> > > been true, and the question becomes why does this code snippet set no_unicast_flt=false:
> > > 
> > > vlan_over_bridged_port()
> > > {
> > >  	local no_unicast_flt=true
> > >  	local vlan_filtering=$1
> > >  	local skip_ptp=false
> > > 
> > >  	# br_manage_promisc() will not force a single vlan_filtering port to
> > >  	# promiscuous mode, so we should still expect unicast filtering to take
> > >  	# place if the device can do it.
> > >  	if [ $(has_unicast_flt $h2) = yes ] && [ $vlan_filtering = 1 ]; then
> > >  		no_unicast_flt=false
> > >  	fi
> > > 
> > > Because IFF_UNICAST_FLT is not a UAPI-visible property, has_unicast_flt() does
> > > an indirect check: it creates a macvlan upper with a different MAC address than
> > > the physical interface's, and this results in a dev_uc_add() in the kernel.
> > > If the unicast address is non-empty but the device doesn't have IFF_UNICAST_FLT,
> > > __dev_set_rx_mode() makes the interface promiscuous, which has_unicast_flt()
> > > then tests.
> > 
> > here is the corresponding kernel log preceding the failing test cases, maybe it
> > might help?
> > 
> > [  539.836062] mxl-gsw1xx 8000f00.mdio:00 lan1: left allmulticast mode
> > [  539.845053] am65-cpsw-nuss 8000000.ethernet eth0: left allmulticast mode
> > [  539.853401] br0: port 1(lan1) entered disabled state
> > [  545.641001] am65-cpsw-nuss 8000000.ethernet: Removing vlan 1 from vlan filter
> > [  546.075411] mxl-gsw1xx 8000f00.mdio:00 lan1: Link is Down
> > [  546.666944] mxl-gsw1xx 8000f00.mdio:00 lan0: Link is Down
> > [  547.779308] mxl-gsw1xx 8000f00.mdio:00 lan1: configuring for phy/internal link mode
> > [  548.803903] mxl-gsw1xx 8000f00.mdio:00 lan0: configuring for phy/internal link mode
> > [  549.561829] mxl-gsw1xx 8000f00.mdio:00 lan1: configuring for phy/internal link mode
> > [  550.366300] mxl-gsw1xx 8000f00.mdio:00 lan1: configuring for phy/internal link mode
> > [  550.395032] br0: port 1(lan1) entered blocking state
> > [  550.401063] br0: port 1(lan1) entered disabled state
> > [  550.406470] mxl-gsw1xx 8000f00.mdio:00 lan1: entered allmulticast mode
> > [  550.413868] am65-cpsw-nuss 8000000.ethernet eth0: entered allmulticast mode
> > [  550.440111] am65-cpsw-nuss 8000000.ethernet: Adding vlan 1 to vlan filter
> > [  550.465479] am65-cpsw-nuss 8000000.ethernet: Adding vlan 100 to vlan filter
> > [  552.519232] mxl-gsw1xx 8000f00.mdio:00 lan1: Link is Up - 100Mbps/Full - flow control rx/tx
> > [  552.530513] br0: port 1(lan1) entered blocking state
> > [  552.536463] br0: port 1(lan1) entered forwarding state
> > [  552.999330] mxl-gsw1xx 8000f00.mdio:00 lan0: Link is Up - 100Mbps/Full - flow control rx/tx
> > [  581.899262] lan1.100: entered promiscuous mode
> > [  592.995574] lan1.100: left promiscuous mode
> > [  596.665022] lan1.100: entered allmulticast mode
> > [  607.789778] lan1.100: left allmulticast mode
> > --
> > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to macvlan MAC address   [ OK ]
> > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to unknown MAC address   [FAIL]
> >         reception succeeded, but should have failed
> > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to unknown MAC address, promisc   [ OK ]
> > TEST: VLAN over vlan_filtering=1 bridged port: Unicast IPv4 to unknown MAC address, allmulti   [FAIL]
> >         reception succeeded, but should have failed
> 
> does the following help?
> 
> # dev=lan1
> # ip link set $dev up
> [ 2005.688205] mxl-gsw1xx 8000f00.mdio:00 lan1: configuring for phy/internal link mode
> [ 2005.714288] 8021q: adding VLAN 0 to HW filter on device lan1
> # ip link add link $dev name macvlan-tmp type macvlan mode private
> # ip l show lan1
> 4: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b7 brd ff:ff:ff:ff:ff:ff
> # ip l 
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP mode DEFAULT group default qlen 1000
>     link/ether c0:d6:0a:e6:89:9e brd ff:ff:ff:ff:ff:ff
> 3: lan0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b6 brd ff:ff:ff:ff:ff:ff
> 4: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b7 brd ff:ff:ff:ff:ff:ff
> 5: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b8 brd ff:ff:ff:ff:ff:ff
> 6: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b9 brd ff:ff:ff:ff:ff:ff
> 7: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:ba brd ff:ff:ff:ff:ff:ff
> 8: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether 96:f1:ca:89:bc:b0 brd ff:ff:ff:ff:ff:ff
> 60: macvlan-tmp@lan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
>     link/ether 9e:07:e8:7c:9d:99 brd ff:ff:ff:ff:ff:ff
> # ip link set macvlan-tmp address 00:a0:03:ea:fe:b8
> # ip link set macvlan-tmp up
> [ 2109.392322] 8021q: adding VLAN 0 to HW filter on device macvlan-tmp
> # ip -j -d link show dev $dev | jq -r '.[].promiscuity'
> 2
> # ip -j -d link show dev $dev
> [{"ifindex":4,"link":"eth0","ifname":"lan1","flags":["NO-CARRIER","BROADCAST","MULTICAST","PROMISC","UP"],"mtu":1500,"qdisc":"noqueue","operstate":"DOWN","linkmode":"DEFAULT","group":"defau]
> # ip -d link show dev $dev
> 4: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
>     link/ether 00:a0:03:ea:fe:b7 brd ff:ff:ff:ff:ff:ff promiscuity 2 allmulti 0 minmtu 68 maxmtu 2378 
>     dsa conduit eth0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro 

It partially does, yes. The promiscuity is 2, which suggests it was
already 1 when has_unicast_flt() started to run. The function is not
written to expect that to happen. Although I don't yet understand why
lan1 originally entered promiscuous mode - that is not in your logs.

This is a separate environment from the selftest with the commands ran
manually, no? Because you can just run the selftest with "bash -x".

  reply	other threads:[~2025-11-06 17:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 12:16 [PATCH net-next v7 00/12] net: dsa: lantiq_gswip: Add support for MaxLinear GSW1xx switch family Daniel Golle
2025-11-03 12:18 ` [PATCH net-next v7 01/12] net: dsa: lantiq_gswip: split into common and MMIO parts Daniel Golle
2025-11-03 12:18 ` [PATCH net-next v7 02/12] net: dsa: lantiq_gswip: support enable/disable learning Daniel Golle
2025-11-03 12:19 ` [PATCH net-next v7 03/12] net: dsa: lantiq_gswip: support Energy Efficient Ethernet Daniel Golle
2025-11-03 12:19 ` [PATCH net-next v7 04/12] net: dsa: lantiq_gswip: set link parameters also for CPU port Daniel Golle
2025-11-03 12:19 ` [PATCH net-next v7 05/12] net: dsa: lantiq_gswip: define and use GSWIP_TABLE_MAC_BRIDGE_VAL1_VALID Daniel Golle
2025-11-03 12:19 ` [PATCH net-next v7 06/12] dt-bindings: net: dsa: lantiq,gswip: add MaxLinear RMII refclk output property Daniel Golle
2025-11-04  7:47   ` Krzysztof Kozlowski
2025-11-03 12:19 ` [PATCH net-next v7 07/12] net: dsa: lantiq_gswip: add vendor property to setup MII refclk output Daniel Golle
2025-11-03 12:19 ` [PATCH net-next v7 08/12] dt-bindings: net: dsa: lantiq,gswip: add support for MII delay properties Daniel Golle
2025-11-03 12:20 ` [PATCH net-next v7 09/12] net: dsa: lantiq_gswip: allow adjusting MII delays Daniel Golle
2025-11-03 12:20 ` [PATCH net-next v7 10/12] dt-bindings: net: dsa: lantiq,gswip: add support for MaxLinear GSW1xx switches Daniel Golle
2025-11-04  7:48   ` Krzysztof Kozlowski
2025-11-03 12:20 ` [PATCH net-next v7 11/12] net: dsa: add tagging driver for MaxLinear GSW1xx switch family Daniel Golle
2025-11-03 12:20 ` [PATCH net-next v7 12/12] net: dsa: add " Daniel Golle
2025-11-04  8:03   ` Sverdlin, Alexander
2025-11-06 14:38     ` Paolo Abeni
2025-11-06 15:26       ` Sverdlin, Alexander
2025-11-06 15:30       ` Vladimir Oltean
2025-11-06 15:27     ` Vladimir Oltean
2025-11-06 16:26       ` Sverdlin, Alexander
2025-11-06 16:36         ` Sverdlin, Alexander
2025-11-06 17:29           ` Vladimir Oltean [this message]
2025-11-06 17:36             ` Sverdlin, Alexander
2025-11-06 22:50 ` [PATCH net-next v7 00/12] net: dsa: lantiq_gswip: Add support " patchwork-bot+netdevbpf

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=20251106172958.jjfr3jbzlyexmidg@skbuf \
    --to=olteanv@gmail.com \
    --cc=ajayaraman@maxlinear.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=andrew@lunn.ch \
    --cc=bxu@maxlinear.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=fchan@maxlinear.com \
    --cc=hauke@hauke-m.de \
    --cc=horms@kernel.org \
    --cc=john@phrozen.org \
    --cc=jpovazanec@maxlinear.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=yweng@maxlinear.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