rocker: Explicitly mark learned FDB entries as offloaded
authorIdo Schimmel <idosch@nvidia.com>
Tue, 1 Nov 2022 12:39:36 +0000 (14:39 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Nov 2022 03:45:23 +0000 (20:45 -0700)
Currently, FDB entries that are notified to the bridge driver via
'SWITCHDEV_FDB_ADD_TO_BRIDGE' are always marked as offloaded by the
bridge. With MAB enabled, this will no longer be universally true.
Device drivers will report locked FDB entries to the bridge to let it
know that the corresponding hosts required authorization, but it does
not mean that these entries are necessarily programmed in the underlying
hardware.

We would like to solve it by having the bridge driver determine the
offload indication based of the 'offloaded' bit in the FDB notification
[1].

Prepare for that change by having rocker explicitly mark learned FDB
entries as offloaded. This is consistent with all the other switchdev
drivers.

[1] https://lore.kernel.org/netdev/20221025100024.1287157-4-idosch@nvidia.com/

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/rocker/rocker_ofdpa.c

index 77ad09ad8304b30e7047b9104a0409ea0471efd4..826990459fa4438554c4bca44446adbbcce0ae7c 100644 (file)
@@ -1826,6 +1826,7 @@ static void ofdpa_port_fdb_learn_work(struct work_struct *work)
 
        info.addr = lw->addr;
        info.vid = lw->vid;
+       info.offloaded = !removing;
        event = removing ? SWITCHDEV_FDB_DEL_TO_BRIDGE :
                           SWITCHDEV_FDB_ADD_TO_BRIDGE;