aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
diff options
context:
space:
mode:
authorSteen Hegelund <steen.hegelund@microchip.com>2021-06-24 09:07:55 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-24 11:28:13 -0700
commitd6fce5141929697a27f029c633433d487f6f62cb (patch)
treeafd44e9dc8a42a8bfa5b77f39bcf876eeee7ee84 /drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
parentnet: sparx5: add vlan support (diff)
downloadlinux-dev-d6fce5141929697a27f029c633433d487f6f62cb.tar.xz
linux-dev-d6fce5141929697a27f029c633433d487f6f62cb.zip
net: sparx5: add switching support
This adds SwitchDev support by hardware offloading the software bridge. Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: Bjarni Jonasson <bjarni.jonasson@microchip.com> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c')
-rw-r--r--drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
index 8a3008c86534..569a7f7ef0bb 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
@@ -117,6 +117,15 @@ static int sparx5_port_stop(struct net_device *ndev)
return 0;
}
+static void sparx5_set_rx_mode(struct net_device *dev)
+{
+ struct sparx5_port *port = netdev_priv(dev);
+ struct sparx5 *sparx5 = port->sparx5;
+
+ if (!test_bit(port->portno, sparx5->bridge_mask))
+ __dev_mc_sync(dev, sparx5_mc_sync, sparx5_mc_unsync);
+}
+
static int sparx5_port_get_phys_port_name(struct net_device *dev,
char *buf, size_t len)
{
@@ -167,6 +176,7 @@ static const struct net_device_ops sparx5_port_netdev_ops = {
.ndo_open = sparx5_port_open,
.ndo_stop = sparx5_port_stop,
.ndo_start_xmit = sparx5_port_xmit_impl,
+ .ndo_set_rx_mode = sparx5_set_rx_mode,
.ndo_get_phys_port_name = sparx5_port_get_phys_port_name,
.ndo_set_mac_address = sparx5_set_mac_address,
.ndo_validate_addr = eth_validate_addr,