netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net RESEND] net: ethernet: ti: am65-cpsw: Add IFF_UNICAST_FLT flag to port device
@ 2024-02-28 11:13 Sanjuán García, Jorge
  2024-02-29  4:05 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: Sanjuán García, Jorge @ 2024-02-28 11:13 UTC (permalink / raw)
  To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, s-vadapalli@ti.com, r-gunasekaran@ti.com,
	rogerq@kernel.org
  Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sanjuán García, Jorge

Since commit 8940e6b669ca ("net: dsa: avoid call to __dev_set_promiscuity()
while rtnl_mutex isn't held") when conecting one of this switch's port
to a DSA switch as the conduit interface, the network interface is set to
promiscuous mode by default and cannot be set to not promiscuous mode again
from userspace. The reason for this is that the cpsw ports net devices
do not have the flag IFF_UNICAST_FLT set in their private flags.

The cpsw switch should be able to set not promiscuous mode as otherwise
a '1' is written to bit ALE_PORT_MACONLY_CAF which makes ethernet frames
get an additional VLAN tag when entering the port connected to the DSA
switch. Setting the IFF_UNICAST_FLT flag to all ports allows us to have
the conduit interface on the DSA subsystem set as not promiscuous.

Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 3c7854537cb5..a3c5360d27c2 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2207,6 +2207,7 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx)
 	port->ndev->vlan_features |=  NETIF_F_SG;
 	port->ndev->netdev_ops = &am65_cpsw_nuss_netdev_ops;
 	port->ndev->ethtool_ops = &am65_cpsw_ethtool_ops_slave;
+	port->ndev->priv_flags |= IFF_UNICAST_FLT;
 
 	/* Configuring Phylink */
 	port->slave.phylink_config.dev = &port->ndev->dev;
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-06 13:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 11:13 [PATCH net RESEND] net: ethernet: ti: am65-cpsw: Add IFF_UNICAST_FLT flag to port device Sanjuán García, Jorge
2024-02-29  4:05 ` Jakub Kicinski
2024-02-29 13:22   ` Andrew Lunn
2024-03-01 11:09   ` Ravi Gunasekaran
2024-03-01 15:49     ` Vladimir Oltean
2024-03-04 10:27       ` Sanjuán García, Jorge
2024-03-06 13:48         ` Roger Quadros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).