Skip to contentSkip to conversation

davinci_emac.c: Fix IFF_ALLMULTI setup

PATCH In review Mariusz Ceier 5 participants 7 messages Oct 21, 2013 – Oct 22, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 davinci_emac.c: Fix IFF_ALLMULTI setup

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

---
 drivers/net/ethernet/ti/davinci_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/davinci_emac.c +1 -1
index 67df09e..ff3bf0e 100644
@@ -876,7 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev)
 		    netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
 			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
 			emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
-		}
+		} else
 		if (!netdev_mc_empty(ndev)) {
 			struct netdev_hw_addr *ha;
 
Signature · 1 line
1.8.4
#1 lore raw

Hello.

Quoted 23 lines · Mariusz Ceier

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

---
  drivers/net/ethernet/ti/davinci_emac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/davinci_emac.c +0 -0
index 67df09e..ff3bf0e 100644

drivers/net/ethernet/ti/davinci_emac.c static void emac_dev_mcast_set(struct net_device *ndev) · line 880

Quoted 6 lines
drivers/net/ethernet/ti/davinci_emac.c +1 -1
@@ -876,7 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev)
  		    netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
  			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
  			emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
-		}
+		} else
  		if (!netdev_mc_empty(ndev)) {

It should be:

		} else if (!netdev_mc_empty(ndev)) {

WBR, Sergei

#2 lore raw

PATCH 1/1 davinci_emac.c: Fix IFF_ALLMULTI setup

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

---
 drivers/net/ethernet/ti/davinci_emac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_emac.c +1 -2
index 67df09e..6a32ef9 100644
@@ -876,8 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev)
 		    netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
 			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
 			emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
-		}
-		if (!netdev_mc_empty(ndev)) {
+		} else if (!netdev_mc_empty(ndev)) {
 			struct netdev_hw_addr *ha;
 
 			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
Signature · 1 line
1.8.4
Acked-by on v1 1/1
#3 lore raw
Quoted 8 lines · Mariusz Ceier

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

Quoted 7 lines

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

---

Can you add [PATCH v2] in your subject in future so that it will be easier to the maintainer to pick the latest version of the patch.

Regards
Mugunthan V N

#4 lore raw

Yes of course ;) This was my first patch for the kernel. I will remember about v2 tag next time.

Thanks,
Mariusz Ceier

Quoted 23 lines · Mugunthan V N
Quoted 8 lines · Mariusz Ceier

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

Quoted 7 lines

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

---

Can you add [PATCH v2] in your subject in future so that it will be easier to the maintainer to pick the latest version of the patch.

Regards
Mugunthan V N

maintainer
#5 lore raw
In reply to Mariusz Ceier

From: Mariusz Ceier <[email protected]>
Date: Mon, 21 Oct 2013 19:45:04 +0200

Quoted 8 lines

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

Quoted 6 lines

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

Applied and queued up for -stable, thanks.

#6 lore raw
In reply to Mariusz Ceier

Hi Mariusz,

Quoted 4 lines · Mariusz Ceier

When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't, emac_dev_mcast_set should only enable RX of multicasts and reset MACHASH registers.

Quoted 9 lines

It does this, but afterwards it either sets up multicast MACs filtering or disables RX of multicasts and resets MACHASH registers again, rendering IFF_ALLMULTI flag useless.

This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.

Tested with kernel 2.6.37.

It would have been better if you would have tested this on the latest kernel. Anyway David has pulled this patch in his tree.

Regards,
--Prabhakar Lad