]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Initialize PGT table
authorAmit Cohen <amcohen@nvidia.com>
Mon, 27 Jun 2022 07:06:19 +0000 (10:06 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 28 Jun 2022 12:31:36 +0000 (14:31 +0200)
Initialize PGT table as part of mlxsw_sp_init(). This table will be used
first in the next patch by FID code to set flooding entries, and later by
MDB code to add multicast entries.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index b128f900d0feb26e2d8e952e7e193274d6a4ab63..ff94cd9d872f0eae194e790af7e1d8c018eb20ce 100644 (file)
@@ -3010,6 +3010,12 @@ static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
                return err;
        }
 
+       err = mlxsw_sp_pgt_init(mlxsw_sp);
+       if (err) {
+               dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize PGT\n");
+               goto err_pgt_init;
+       }
+
        err = mlxsw_sp_fids_init(mlxsw_sp);
        if (err) {
                dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize FIDs\n");
@@ -3202,6 +3208,8 @@ err_traps_init:
 err_policers_init:
        mlxsw_sp_fids_fini(mlxsw_sp);
 err_fids_init:
+       mlxsw_sp_pgt_fini(mlxsw_sp);
+err_pgt_init:
        mlxsw_sp_kvdl_fini(mlxsw_sp);
        mlxsw_sp_parsing_fini(mlxsw_sp);
        return err;
@@ -3370,6 +3378,7 @@ static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
        mlxsw_sp_traps_fini(mlxsw_sp);
        mlxsw_sp_policers_fini(mlxsw_sp);
        mlxsw_sp_fids_fini(mlxsw_sp);
+       mlxsw_sp_pgt_fini(mlxsw_sp);
        mlxsw_sp_kvdl_fini(mlxsw_sp);
        mlxsw_sp_parsing_fini(mlxsw_sp);
 }