aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski2022-05-19 18:40:56 -0700
committerJakub Kicinski2022-05-19 18:40:57 -0700
commit53332f845194b8dedf213c5bf51c2d4af88364ee (patch)
tree74f150699298b71575dacef3ad481b6cab16d59b
parent86afd5a0e78eb9b84b158b33d85f711c5f748fd1 (diff)
parent4951995dbe9dd0c3fbe1fbfdb760b05a797700f1 (diff)
Merge branch 'lantiq_gswip-two-small-fixes'
Martin Blumenstingl says: ==================== lantiq_gswip: Two small fixes While updating the Lantiq target in OpenWrt to Linux 5.15 I came across an FDB related error message. While that still needs to be solved I found two other small issues on the way. This series fixes the two minor issues found while revisiting the FDB code in the lantiq_gswip driver: - The first patch fixes the start index used in gswip_port_fdb() to find the entry with the matching bridge. The updated logic is now consistent with the rest of the driver. - The second patch fixes a typo in a dev_err() message. [0] https://lore.kernel.org/netdev/20220517194015.1081632-1-martin.blumenstingl@googlemail.com/ ==================== Link: https://lore.kernel.org/r/20220518220051.1520023-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/dsa/lantiq_gswip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index 12c15da55664..8af4def38a98 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -1360,7 +1360,7 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port,
struct net_device *bridge = dsa_port_bridge_dev_get(dsa_to_port(ds, port));
struct gswip_priv *priv = ds->priv;
struct gswip_pce_table_entry mac_bridge = {0,};
- unsigned int cpu_port = priv->hw_info->cpu_port;
+ unsigned int max_ports = priv->hw_info->max_ports;
int fid = -1;
int i;
int err;
@@ -1368,7 +1368,7 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port,
if (!bridge)
return -EINVAL;
- for (i = cpu_port; i < ARRAY_SIZE(priv->vlans); i++) {
+ for (i = max_ports; i < ARRAY_SIZE(priv->vlans); i++) {
if (priv->vlans[i].bridge == bridge) {
fid = priv->vlans[i].fid;
break;
@@ -1426,8 +1426,9 @@ static int gswip_port_fdb_dump(struct dsa_switch *ds, int port,
err = gswip_pce_table_entry_read(priv, &mac_bridge);
if (err) {
- dev_err(priv->dev, "failed to write mac bridge: %d\n",
- err);
+ dev_err(priv->dev,
+ "failed to read mac bridge entry %d: %d\n",
+ i, err);
return err;
}