Skip to content

Commit 710ae72

Browse files
idoschdavem330
authored andcommitted
net: bridge: Mark FDB entries that were added by user as such
Externally learned entries can be added by a user or by a switch driver that is notifying the bridge driver about entries that were learned in hardware. In the first case, the entries are not marked with the 'added_by_user' flag, which causes switch drivers to ignore them and not offload them. The 'added_by_user' flag can be set on externally learned FDB entries based on the 'swdev_notify' parameter in br_fdb_external_learn_add(), which effectively means if the created / updated FDB entry was added by a user or not. Fixes: 816a3be ("switchdev: Add fdb.added_by_user to switchdev notifications") Signed-off-by: Ido Schimmel <[email protected]> Reported-by: Alexander Petrovskiy <[email protected]> Reviewed-by: Petr Machata <[email protected]> Cc: Roopa Prabhu <[email protected]> Cc: Nikolay Aleksandrov <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent a11dcd6 commit 710ae72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/bridge/br_fdb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,8 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
11281128
err = -ENOMEM;
11291129
goto err_unlock;
11301130
}
1131+
if (swdev_notify)
1132+
fdb->added_by_user = 1;
11311133
fdb->added_by_external_learn = 1;
11321134
fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
11331135
} else {
@@ -1147,6 +1149,9 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p,
11471149
modified = true;
11481150
}
11491151

1152+
if (swdev_notify)
1153+
fdb->added_by_user = 1;
1154+
11501155
if (modified)
11511156
fdb_notify(br, fdb, RTM_NEWNEIGH, swdev_notify);
11521157
}

0 commit comments

Comments
 (0)