mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 07:34:03 -04:00
net/mlx5e: kTLS, Add debugfs
Add TLS debugfs to improve observability by exposing the size of the tls TX pool. To observe the size of the TX pool: $ cat /sys/kernel/debug/mlx5/<pci>/nic/tls/tx/pool_size Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Co-developed-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
committed by
Saeed Mahameed
parent
288eca60cc
commit
0fedee1ae9
@@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
||||||
// Copyright (c) 2019 Mellanox Technologies.
|
// Copyright (c) 2019 Mellanox Technologies.
|
||||||
|
|
||||||
|
#include <linux/debugfs.h>
|
||||||
#include "en.h"
|
#include "en.h"
|
||||||
#include "lib/mlx5.h"
|
#include "lib/mlx5.h"
|
||||||
#include "en_accel/ktls.h"
|
#include "en_accel/ktls.h"
|
||||||
@@ -177,6 +178,15 @@ void mlx5e_ktls_cleanup_rx(struct mlx5e_priv *priv)
|
|||||||
destroy_workqueue(priv->tls->rx_wq);
|
destroy_workqueue(priv->tls->rx_wq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mlx5e_tls_debugfs_init(struct mlx5e_tls *tls,
|
||||||
|
struct dentry *dfs_root)
|
||||||
|
{
|
||||||
|
if (IS_ERR_OR_NULL(dfs_root))
|
||||||
|
return;
|
||||||
|
|
||||||
|
tls->debugfs.dfs = debugfs_create_dir("tls", dfs_root);
|
||||||
|
}
|
||||||
|
|
||||||
int mlx5e_ktls_init(struct mlx5e_priv *priv)
|
int mlx5e_ktls_init(struct mlx5e_priv *priv)
|
||||||
{
|
{
|
||||||
struct mlx5e_tls *tls;
|
struct mlx5e_tls *tls;
|
||||||
@@ -189,11 +199,23 @@ int mlx5e_ktls_init(struct mlx5e_priv *priv)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
priv->tls = tls;
|
priv->tls = tls;
|
||||||
|
priv->tls->mdev = priv->mdev;
|
||||||
|
|
||||||
|
mlx5e_tls_debugfs_init(tls, priv->dfs_root);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlx5e_ktls_cleanup(struct mlx5e_priv *priv)
|
void mlx5e_ktls_cleanup(struct mlx5e_priv *priv)
|
||||||
{
|
{
|
||||||
|
struct mlx5e_tls *tls = priv->tls;
|
||||||
|
|
||||||
|
if (!mlx5e_is_ktls_device(priv->mdev))
|
||||||
|
return;
|
||||||
|
|
||||||
|
debugfs_remove_recursive(tls->debugfs.dfs);
|
||||||
|
tls->debugfs.dfs = NULL;
|
||||||
|
|
||||||
kfree(priv->tls);
|
kfree(priv->tls);
|
||||||
priv->tls = NULL;
|
priv->tls = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#ifndef __MLX5E_KTLS_H__
|
#ifndef __MLX5E_KTLS_H__
|
||||||
#define __MLX5E_KTLS_H__
|
#define __MLX5E_KTLS_H__
|
||||||
|
|
||||||
|
#include <linux/debugfs.h>
|
||||||
#include <linux/tls.h>
|
#include <linux/tls.h>
|
||||||
#include <net/tls.h>
|
#include <net/tls.h>
|
||||||
#include "en.h"
|
#include "en.h"
|
||||||
@@ -72,10 +73,17 @@ struct mlx5e_tls_sw_stats {
|
|||||||
atomic64_t rx_tls_del;
|
atomic64_t rx_tls_del;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct mlx5e_tls_debugfs {
|
||||||
|
struct dentry *dfs;
|
||||||
|
struct dentry *dfs_tx;
|
||||||
|
};
|
||||||
|
|
||||||
struct mlx5e_tls {
|
struct mlx5e_tls {
|
||||||
|
struct mlx5_core_dev *mdev;
|
||||||
struct mlx5e_tls_sw_stats sw_stats;
|
struct mlx5e_tls_sw_stats sw_stats;
|
||||||
struct workqueue_struct *rx_wq;
|
struct workqueue_struct *rx_wq;
|
||||||
struct mlx5e_tls_tx_pool *tx_pool;
|
struct mlx5e_tls_tx_pool *tx_pool;
|
||||||
|
struct mlx5e_tls_debugfs debugfs;
|
||||||
};
|
};
|
||||||
|
|
||||||
int mlx5e_ktls_init(struct mlx5e_priv *priv);
|
int mlx5e_ktls_init(struct mlx5e_priv *priv);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
||||||
// Copyright (c) 2019 Mellanox Technologies.
|
// Copyright (c) 2019 Mellanox Technologies.
|
||||||
|
|
||||||
|
#include <linux/debugfs.h>
|
||||||
#include "en_accel/ktls.h"
|
#include "en_accel/ktls.h"
|
||||||
#include "en_accel/ktls_txrx.h"
|
#include "en_accel/ktls_txrx.h"
|
||||||
#include "en_accel/ktls_utils.h"
|
#include "en_accel/ktls_utils.h"
|
||||||
@@ -886,8 +887,24 @@ bool mlx5e_ktls_handle_tx_skb(struct net_device *netdev, struct mlx5e_txqsq *sq,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mlx5e_tls_tx_debugfs_init(struct mlx5e_tls *tls,
|
||||||
|
struct dentry *dfs_root)
|
||||||
|
{
|
||||||
|
if (IS_ERR_OR_NULL(dfs_root))
|
||||||
|
return;
|
||||||
|
|
||||||
|
tls->debugfs.dfs_tx = debugfs_create_dir("tx", dfs_root);
|
||||||
|
if (!tls->debugfs.dfs_tx)
|
||||||
|
return;
|
||||||
|
|
||||||
|
debugfs_create_size_t("pool_size", 0400, tls->debugfs.dfs_tx,
|
||||||
|
&tls->tx_pool->size);
|
||||||
|
}
|
||||||
|
|
||||||
int mlx5e_ktls_init_tx(struct mlx5e_priv *priv)
|
int mlx5e_ktls_init_tx(struct mlx5e_priv *priv)
|
||||||
{
|
{
|
||||||
|
struct mlx5e_tls *tls = priv->tls;
|
||||||
|
|
||||||
if (!mlx5e_is_ktls_tx(priv->mdev))
|
if (!mlx5e_is_ktls_tx(priv->mdev))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -895,6 +912,8 @@ int mlx5e_ktls_init_tx(struct mlx5e_priv *priv)
|
|||||||
if (!priv->tls->tx_pool)
|
if (!priv->tls->tx_pool)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
mlx5e_tls_tx_debugfs_init(tls, tls->debugfs.dfs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,6 +922,9 @@ void mlx5e_ktls_cleanup_tx(struct mlx5e_priv *priv)
|
|||||||
if (!mlx5e_is_ktls_tx(priv->mdev))
|
if (!mlx5e_is_ktls_tx(priv->mdev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
debugfs_remove_recursive(priv->tls->debugfs.dfs_tx);
|
||||||
|
priv->tls->debugfs.dfs_tx = NULL;
|
||||||
|
|
||||||
mlx5e_tls_tx_pool_cleanup(priv->tls->tx_pool);
|
mlx5e_tls_tx_pool_cleanup(priv->tls->tx_pool);
|
||||||
priv->tls->tx_pool = NULL;
|
priv->tls->tx_pool = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user