Skip to content

Commit 8f0bcd1

Browse files
Tariq ToukanSaeed Mahameed
authored andcommitted
net/mlx5e: TLS, Do not expose FPGA TLS counter if not supported
The set of TLS TX global SW counters in mlx5e_tls_sw_stats_desc is updated from all rings by using atomic ops. This set of stats is used only in the FPGA TLS use case, not in the Connect-X TLS one, where regular per-ring counters are used. Do not expose them in the Connect-X use case, as this would cause counter duplication. For example, tx_tls_drop_no_sync_data would appear twice in the ethtool stats. Fixes: d2ead1f ("net/mlx5e: Add kTLS TX HW offload support") Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Reviewed-by: Moshe Shemesh <moshe@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent b521105 commit 8f0bcd1

File tree

1 file changed

+8
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+8
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_stats.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <net/sock.h>
3636

3737
#include "en.h"
38-
#include "accel/tls.h"
3938
#include "fpga/sdk.h"
4039
#include "en_accel/tls.h"
4140

@@ -51,9 +50,14 @@ static const struct counter_desc mlx5e_tls_sw_stats_desc[] = {
5150

5251
#define NUM_TLS_SW_COUNTERS ARRAY_SIZE(mlx5e_tls_sw_stats_desc)
5352

53+
static bool is_tls_atomic_stats(struct mlx5e_priv *priv)
54+
{
55+
return priv->tls && !mlx5_accel_is_ktls_device(priv->mdev);
56+
}
57+
5458
int mlx5e_tls_get_count(struct mlx5e_priv *priv)
5559
{
56-
if (!priv->tls)
60+
if (!is_tls_atomic_stats(priv))
5761
return 0;
5862

5963
return NUM_TLS_SW_COUNTERS;
@@ -63,7 +67,7 @@ int mlx5e_tls_get_strings(struct mlx5e_priv *priv, uint8_t *data)
6367
{
6468
unsigned int i, idx = 0;
6569

66-
if (!priv->tls)
70+
if (!is_tls_atomic_stats(priv))
6771
return 0;
6872

6973
for (i = 0; i < NUM_TLS_SW_COUNTERS; i++)
@@ -77,7 +81,7 @@ int mlx5e_tls_get_stats(struct mlx5e_priv *priv, u64 *data)
7781
{
7882
int i, idx = 0;
7983

80-
if (!priv->tls)
84+
if (!is_tls_atomic_stats(priv))
8185
return 0;
8286

8387
for (i = 0; i < NUM_TLS_SW_COUNTERS; i++)

0 commit comments

Comments
 (0)