summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/lib
diff options
context:
space:
mode:
authorPatrisious Haddad <phaddad@nvidia.com>2022-12-06 15:33:49 +0300
committerLeon Romanovsky <leon@kernel.org>2023-08-20 12:35:23 +0300
commit2e92f669b86d70a26a77b088c74e1cb6d26322e1 (patch)
tree722077b936a2e4c4b4936e7e90719ad1576b2cbd /drivers/net/ethernet/mellanox/mlx5/core/lib
parent8603efbd18b091273876b72e6d9973df8b0a428a (diff)
downloadlinux-2e92f669b86d70a26a77b088c74e1cb6d26322e1.tar.xz
net/mlx5e: Move MACsec flow steering and statistics database from ethernet to core
Since now MACsec flow steering (macsec_fs) and MACsec statistics (stats) are maintained by the core driver, move their data as well to be saved inside core structures instead of staying part of ethernet MACsec database. In addition cleanup all MACsec stats functions from the ethernet MACsec code and move what's needed to be part of macsec_fs instead. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/lib')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c11
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
index c585d61324bf..11f9c5a8e43a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -106,6 +106,9 @@ struct mlx5_macsec_fs {
struct net_device *netdev;
struct mlx5_macsec_tx *tx_fs;
struct mlx5_macsec_rx *rx_fs;
+
+ /* Stats manage */
+ struct mlx5_macsec_stats stats;
};
static void macsec_fs_destroy_groups(struct mlx5_macsec_flow_table *ft)
@@ -1355,6 +1358,14 @@ void mlx5_macsec_fs_get_stats_fill(struct mlx5_macsec_fs *macsec_fs, void *macse
&stats->macsec_rx_pkts_drop, &stats->macsec_rx_bytes_drop);
}
+struct mlx5_macsec_stats *mlx5_macsec_fs_get_stats(struct mlx5_macsec_fs *macsec_fs)
+{
+ if (!macsec_fs)
+ return NULL;
+
+ return &macsec_fs->stats;
+}
+
union mlx5_macsec_rule *
mlx5_macsec_fs_add_rule(struct mlx5_macsec_fs *macsec_fs,
const struct macsec_context *macsec_ctx,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h
index 6a749e036e68..c0c28d08eae5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h
@@ -56,6 +56,7 @@ void mlx5_macsec_fs_del_rule(struct mlx5_macsec_fs *macsec_fs,
int action);
void mlx5_macsec_fs_get_stats_fill(struct mlx5_macsec_fs *macsec_fs, void *macsec_stats);
+struct mlx5_macsec_stats *mlx5_macsec_fs_get_stats(struct mlx5_macsec_fs *macsec_fs);
#endif