Skip to content

Commit c264294

Browse files
KanjiMonsterkuba-moo
authored andcommitted
net: dsa: b53: fix enabling ip multicast
In the New Control register bit 1 is either reserved, or has a different function: Out of Range Error Discard When enabled, the ingress port discards any frames if the Length field is between 1500 and 1536 (excluding 1500 and 1536) and with good CRC. The actual bit for enabling IP multicast is bit 0, which was only explicitly enabled for BCM5325 so far. For older switch chips, this bit defaults to 0, so we want to enable it as well, while newer switch chips default to 1, and their documentation says "It is illegal to set this bit to zero." So drop the wrong B53_IPMC_FWD_EN define, enable the IP multicast bit also for other switch chips. While at it, rename it to (B53_)IP_MC as that is how it is called in Broadcom code. Fixes: 63cc54a ("net: dsa: b53: Fix egress flooding settings") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20251102100758.28352-2-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent c732119 commit c264294

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
371371
* frames should be flooded or not.
372372
*/
373373
b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
374-
mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IPMC_FWD_EN;
374+
mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IP_MC;
375375
b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
376376
} else {
377377
b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
378-
mgmt |= B53_IP_MCAST_25;
378+
mgmt |= B53_IP_MC;
379379
b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
380380
}
381381
}

drivers/net/dsa/b53/b53_regs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111

112112
/* IP Multicast control (8 bit) */
113113
#define B53_IP_MULTICAST_CTRL 0x21
114-
#define B53_IP_MCAST_25 BIT(0)
115-
#define B53_IPMC_FWD_EN BIT(1)
114+
#define B53_IP_MC BIT(0)
116115
#define B53_UC_FWD_EN BIT(6)
117116
#define B53_MC_FWD_EN BIT(7)
118117

0 commit comments

Comments
 (0)