aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpsw_ale.c
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2015-01-13 07:05:49 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-13 16:54:23 -0500
commit25906052d953d3fbdb7e19480b9de5e6bb949f3f (patch)
tree6ec171a214475a4d6b6711d739dd89fd8c9a4677 /drivers/net/ethernet/ti/cpsw_ale.c
parentfd48e639dfd3e86dd85bdeb40512a44b74b02e6f (diff)
drivers: net: cpsw: fix multicast flush in dual emac mode
Since ALE table is a common resource for both the interfaces in Dual EMAC mode and while bringing up the second interface in cpsw_ndo_set_rx_mode() all the multicast entries added by the first interface is flushed out and only second interface multicast addresses are added. Fixing this by flushing multicast addresses based on dual EMAC port vlans which will not affect the other emac port multicast addresses. Fixes: d9ba8f9 (driver: net: ethernet: cpsw: dual emac interface implementation) Cc: <stable@vger.kernel.org> # v3.9+ Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw_ale.c')
-rw-r--r--drivers/net/ethernet/ti/cpsw_ale.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 097ebe7077ac..5246b3a18ff8 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -234,7 +234,7 @@ static void cpsw_ale_flush_mcast(struct cpsw_ale *ale, u32 *ale_entry,
234 cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE); 234 cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
235} 235}
236 236
237int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask) 237int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
238{ 238{
239 u32 ale_entry[ALE_ENTRY_WORDS]; 239 u32 ale_entry[ALE_ENTRY_WORDS];
240 int ret, idx; 240 int ret, idx;
@@ -245,6 +245,14 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask)
245 if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR) 245 if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR)
246 continue; 246 continue;
247 247
248 /* if vid passed is -1 then remove all multicast entry from
249 * the table irrespective of vlan id, if a valid vlan id is
250 * passed then remove only multicast added to that vlan id.
251 * if vlan id doesn't match then move on to next entry.
252 */
253 if (vid != -1 && cpsw_ale_get_vlan_id(ale_entry) != vid)
254 continue;
255
248 if (cpsw_ale_get_mcast(ale_entry)) { 256 if (cpsw_ale_get_mcast(ale_entry)) {
249 u8 addr[6]; 257 u8 addr[6];
250 258