Commit 1d6ae965 authored by MD Danish Anwar's avatar MD Danish Anwar Committed by Jakub Kicinski

net: ti: icssg-prueth: Add multicast filtering support in HSR mode

Add support for multicast filtering in HSR mode
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
Link: https://patch.msgid.link/20240911081603.2521729-6-danishanwar@ti.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 56375086
...@@ -492,6 +492,36 @@ static int icssg_prueth_del_mcast(struct net_device *ndev, const u8 *addr) ...@@ -492,6 +492,36 @@ static int icssg_prueth_del_mcast(struct net_device *ndev, const u8 *addr)
return 0; return 0;
} }
static int icssg_prueth_hsr_add_mcast(struct net_device *ndev, const u8 *addr)
{
struct prueth_emac *emac = netdev_priv(ndev);
struct prueth *prueth = emac->prueth;
icssg_fdb_add_del(emac, addr, prueth->default_vlan,
ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
ICSSG_FDB_ENTRY_BLOCK, true);
icssg_vtbl_modify(emac, emac->port_vlan, BIT(emac->port_id),
BIT(emac->port_id), true);
return 0;
}
static int icssg_prueth_hsr_del_mcast(struct net_device *ndev, const u8 *addr)
{
struct prueth_emac *emac = netdev_priv(ndev);
struct prueth *prueth = emac->prueth;
icssg_fdb_add_del(emac, addr, prueth->default_vlan,
ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
ICSSG_FDB_ENTRY_BLOCK, false);
return 0;
}
/** /**
* emac_ndo_open - EMAC device open * emac_ndo_open - EMAC device open
* @ndev: network adapter device * @ndev: network adapter device
...@@ -652,6 +682,9 @@ static int emac_ndo_stop(struct net_device *ndev) ...@@ -652,6 +682,9 @@ static int emac_ndo_stop(struct net_device *ndev)
icssg_class_disable(prueth->miig_rt, prueth_emac_slice(emac)); icssg_class_disable(prueth->miig_rt, prueth_emac_slice(emac));
if (emac->prueth->is_hsr_offload_mode)
__dev_mc_unsync(ndev, icssg_prueth_hsr_del_mcast);
else
__dev_mc_unsync(ndev, icssg_prueth_del_mcast); __dev_mc_unsync(ndev, icssg_prueth_del_mcast);
atomic_set(&emac->tdown_cnt, emac->tx_ch_num); atomic_set(&emac->tdown_cnt, emac->tx_ch_num);
...@@ -730,7 +763,12 @@ static void emac_ndo_set_rx_mode_work(struct work_struct *work) ...@@ -730,7 +763,12 @@ static void emac_ndo_set_rx_mode_work(struct work_struct *work)
return; return;
} }
__dev_mc_sync(ndev, icssg_prueth_add_mcast, icssg_prueth_del_mcast); if (emac->prueth->is_hsr_offload_mode)
__dev_mc_sync(ndev, icssg_prueth_hsr_add_mcast,
icssg_prueth_hsr_del_mcast);
else
__dev_mc_sync(ndev, icssg_prueth_add_mcast,
icssg_prueth_del_mcast);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment