drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h
Extension
.h
Size
4090 bytes
Lines
153
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mlx5e_tls_sw_stats {
	atomic64_t tx_tls_ctx;
	atomic64_t tx_tls_del;
	atomic64_t tx_tls_pool_alloc;
	atomic64_t tx_tls_pool_free;
	atomic64_t rx_tls_ctx;
	atomic64_t rx_tls_del;
};

struct mlx5e_tls_debugfs {
	struct dentry *dfs;
	struct dentry *dfs_tx;
};

struct mlx5e_tls {
	struct mlx5_core_dev *mdev;
	struct mlx5e_tls_sw_stats sw_stats;
	struct workqueue_struct *rx_wq;
	struct mlx5e_tls_tx_pool *tx_pool;
	struct mlx5_crypto_dek_pool *dek_pool;
	struct mlx5e_tls_debugfs debugfs;
};

int mlx5e_ktls_init(struct mlx5e_priv *priv);
void mlx5e_ktls_cleanup(struct mlx5e_priv *priv);

int mlx5e_ktls_get_count(struct mlx5e_priv *priv);
void mlx5e_ktls_get_strings(struct mlx5e_priv *priv, u8 **data);
void mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 **data);

#else
static inline void mlx5e_ktls_build_netdev(struct mlx5e_priv *priv)
{
}

static inline int mlx5e_ktls_init_tx(struct mlx5e_priv *priv)
{
	return 0;
}

static inline void mlx5e_ktls_cleanup_tx(struct mlx5e_priv *priv)
{
}

static inline int mlx5e_ktls_init_rx(struct mlx5e_priv *priv)
{
	return 0;
}

static inline void mlx5e_ktls_cleanup_rx(struct mlx5e_priv *priv)
{
}

static inline int mlx5e_ktls_set_feature_rx(struct net_device *netdev, bool enable)
{
	netdev_warn(netdev, "kTLS is not supported\n");
	return -EOPNOTSUPP;
}

static inline struct mlx5e_ktls_resync_resp *
mlx5e_ktls_rx_resync_create_resp_list(void)
{
	return ERR_PTR(-EOPNOTSUPP);
}

static inline void
mlx5e_ktls_rx_resync_destroy_resp_list(struct mlx5e_ktls_resync_resp *resp_list) {}

static inline bool mlx5e_is_ktls_rx(struct mlx5_core_dev *mdev)
{
	return false;
}

static inline int mlx5e_ktls_init(struct mlx5e_priv *priv) { return 0; }
static inline void mlx5e_ktls_cleanup(struct mlx5e_priv *priv) { }
static inline int mlx5e_ktls_get_count(struct mlx5e_priv *priv) { return 0; }
static inline void mlx5e_ktls_get_strings(struct mlx5e_priv *priv, u8 **data) { }

static inline void mlx5e_ktls_get_stats(struct mlx5e_priv *priv, u64 **data) { }
#endif

#endif /* __MLX5E_TLS_H__ */

Annotation

Implementation Notes