]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mlxsw: spectrum_switchdev: Prepare for locked FDB notifications
authorIdo Schimmel <idosch@nvidia.com>
Tue, 8 Nov 2022 10:47:14 +0000 (11:47 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Nov 2022 03:06:15 +0000 (19:06 -0800)
Subsequent patches will need to report locked FDB entries to the bridge
driver. Prepare for that by adding a 'locked' argument to
mlxsw_sp_fdb_call_notifiers() according to which the 'locked' bit is set
in the FDB notification info. For now, always pass 'false'.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

index 4efccd942fb89bebb25298b40b85f52e124bb76c..0fbefa43f9b11a9b0d0565c63488d3ce1eb7b64b 100644 (file)
@@ -2888,13 +2888,14 @@ static void mlxsw_sp_fdb_nve_call_notifiers(struct net_device *dev,
 static void
 mlxsw_sp_fdb_call_notifiers(enum switchdev_notifier_type type,
                            const char *mac, u16 vid,
-                           struct net_device *dev, bool offloaded)
+                           struct net_device *dev, bool offloaded, bool locked)
 {
        struct switchdev_notifier_fdb_info info = {};
 
        info.addr = mac;
        info.vid = vid;
        info.offloaded = offloaded;
+       info.locked = locked;
        call_switchdev_notifiers(type, dev, &info.info, NULL);
 }
 
@@ -2952,7 +2953,8 @@ do_fdb_op:
        if (!do_notification)
                return;
        type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
-       mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev, adding);
+       mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev, adding,
+                                   false);
 
        return;
 
@@ -3015,7 +3017,8 @@ do_fdb_op:
        if (!do_notification)
                return;
        type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
-       mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev, adding);
+       mlxsw_sp_fdb_call_notifiers(type, mac, vid, bridge_port->dev, adding,
+                                   false);
 
        return;
 
@@ -3122,7 +3125,7 @@ static void mlxsw_sp_fdb_notify_mac_uc_tunnel_process(struct mlxsw_sp *mlxsw_sp,
 
        type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE :
                        SWITCHDEV_FDB_DEL_TO_BRIDGE;
-       mlxsw_sp_fdb_call_notifiers(type, mac, vid, nve_dev, adding);
+       mlxsw_sp_fdb_call_notifiers(type, mac, vid, nve_dev, adding, false);
 
        mlxsw_sp_fid_put(fid);
 
@@ -3264,7 +3267,7 @@ mlxsw_sp_switchdev_bridge_vxlan_fdb_event(struct mlxsw_sp *mlxsw_sp,
                                         &vxlan_fdb_info.info, NULL);
                mlxsw_sp_fdb_call_notifiers(SWITCHDEV_FDB_OFFLOADED,
                                            vxlan_fdb_info.eth_addr,
-                                           fdb_info->vid, dev, true);
+                                           fdb_info->vid, dev, true, false);
                break;
        case SWITCHDEV_FDB_DEL_TO_DEVICE:
                err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp,
@@ -3359,7 +3362,7 @@ static void mlxsw_sp_switchdev_bridge_fdb_event_work(struct work_struct *work)
                        break;
                mlxsw_sp_fdb_call_notifiers(SWITCHDEV_FDB_OFFLOADED,
                                            fdb_info->addr,
-                                           fdb_info->vid, dev, true);
+                                           fdb_info->vid, dev, true, false);
                break;
        case SWITCHDEV_FDB_DEL_TO_DEVICE:
                fdb_info = &switchdev_work->fdb_info;
@@ -3443,7 +3446,8 @@ mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp,
        call_switchdev_notifiers(SWITCHDEV_VXLAN_FDB_OFFLOADED, dev,
                                 &vxlan_fdb_info->info, NULL);
        mlxsw_sp_fdb_call_notifiers(SWITCHDEV_FDB_OFFLOADED,
-                                   vxlan_fdb_info->eth_addr, vid, dev, true);
+                                   vxlan_fdb_info->eth_addr, vid, dev, true,
+                                   false);
 
        mlxsw_sp_fid_put(fid);
 
@@ -3493,7 +3497,8 @@ mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp,
                                       false, false);
        vid = bridge_device->ops->fid_vid(bridge_device, fid);
        mlxsw_sp_fdb_call_notifiers(SWITCHDEV_FDB_OFFLOADED,
-                                   vxlan_fdb_info->eth_addr, vid, dev, false);
+                                   vxlan_fdb_info->eth_addr, vid, dev, false,
+                                   false);
 
        mlxsw_sp_fid_put(fid);
 }