Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-dsa-b53-minor-fdb-related-fixes'

Jonas Gorski says:

====================
net: dsa: b53: minor fdb related fixes

While investigating and fixing/implenting proper ARL support for
bcm63xx, I encountered multiple minor issues in the current ARL
implementation:

* The ARL multicast support was not properly enabled for older chips,
and instead a potentially reserved bit was toggled.
* While traversing the ARL table, "Search done" triggered one final
entry which will be invalid for 4 ARL bin chips, and failed to stop
the search on chips with only one result register.
* For chips where we have only one result register, we only traversed at
most half the maximum entries.

I also had a fix for IVL_SVL_SELECT which is only valid for some chips,
but since this would only have an effect for !vlan_enabled, and we
always have that enabled, it isn't really worth fixing (and rather drop
the !vlan_enabled paths).
====================

Link: https://patch.msgid.link/20251102100758.28352-1-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+10 -8
+9 -6
drivers/net/dsa/b53/b53_common.c
··· 371 371 * frames should be flooded or not. 372 372 */ 373 373 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; 375 375 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 376 376 } else { 377 377 b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt); 378 - mgmt |= B53_IP_MCAST_25; 378 + mgmt |= B53_IP_MC; 379 379 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 380 380 } 381 381 } ··· 2037 2037 do { 2038 2038 b53_read8(dev, B53_ARLIO_PAGE, offset, &reg); 2039 2039 if (!(reg & ARL_SRCH_STDN)) 2040 - return 0; 2040 + return -ENOENT; 2041 2041 2042 2042 if (reg & ARL_SRCH_VLID) 2043 2043 return 0; ··· 2087 2087 int b53_fdb_dump(struct dsa_switch *ds, int port, 2088 2088 dsa_fdb_dump_cb_t *cb, void *data) 2089 2089 { 2090 + unsigned int count = 0, results_per_hit = 1; 2090 2091 struct b53_device *priv = ds->priv; 2091 2092 struct b53_arl_entry results[2]; 2092 - unsigned int count = 0; 2093 2093 u8 offset; 2094 2094 int ret; 2095 2095 u8 reg; 2096 + 2097 + if (priv->num_arl_bins > 2) 2098 + results_per_hit = 2; 2096 2099 2097 2100 mutex_lock(&priv->arl_mutex); 2098 2101 ··· 2118 2115 if (ret) 2119 2116 break; 2120 2117 2121 - if (priv->num_arl_bins > 2) { 2118 + if (results_per_hit == 2) { 2122 2119 b53_arl_search_rd(priv, 1, &results[1]); 2123 2120 ret = b53_fdb_copy(port, &results[1], cb, data); 2124 2121 if (ret) ··· 2128 2125 break; 2129 2126 } 2130 2127 2131 - } while (count++ < b53_max_arl_entries(priv) / 2); 2128 + } while (count++ < b53_max_arl_entries(priv) / results_per_hit); 2132 2129 2133 2130 mutex_unlock(&priv->arl_mutex); 2134 2131
+1 -2
drivers/net/dsa/b53/b53_regs.h
··· 111 111 112 112 /* IP Multicast control (8 bit) */ 113 113 #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) 116 115 #define B53_UC_FWD_EN BIT(6) 117 116 #define B53_MC_FWD_EN BIT(7) 118 117