drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.h- Extension
.h- Size
- 2290 bytes
- Lines
- 78
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/psp/types.hen.h
Detected Declarations
struct mlx5e_psp_statsstruct mlx5e_pspfunction mlx5_is_psp_devicefunction mlx5_accel_psp_fs_init_rx_tablesfunction mlx5_accel_psp_fs_cleanup_rx_tablesfunction mlx5_accel_psp_fs_cleanup_tx_tablesfunction mlx5e_psp_registerfunction mlx5e_psp_cleanup
Annotated Snippet
struct mlx5e_psp_stats {
u64 psp_rx_pkts;
u64 psp_rx_bytes;
u64 psp_rx_pkts_auth_fail;
u64 psp_rx_bytes_auth_fail;
u64 psp_rx_pkts_frame_err;
u64 psp_rx_bytes_frame_err;
u64 psp_rx_pkts_drop;
u64 psp_rx_bytes_drop;
u64 psp_tx_pkts;
u64 psp_tx_bytes;
u64 psp_tx_pkts_drop;
u64 psp_tx_bytes_drop;
};
struct mlx5e_psp {
struct psp_dev *psp;
struct psp_dev_caps caps;
struct mlx5e_psp_fs *fs;
atomic_t tx_key_cnt;
atomic_t tx_drop;
};
static inline bool mlx5_is_psp_device(struct mlx5_core_dev *mdev)
{
if (!MLX5_CAP_GEN(mdev, psp))
return false;
if (!MLX5_CAP_PSP(mdev, psp_crypto_offload) ||
!MLX5_CAP_PSP(mdev, psp_crypto_esp_aes_gcm_128_encrypt) ||
!MLX5_CAP_PSP(mdev, psp_crypto_esp_aes_gcm_128_decrypt))
return false;
return true;
}
int mlx5_accel_psp_fs_init_rx_tables(struct mlx5e_priv *priv);
void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv);
int mlx5_accel_psp_fs_init_tx_tables(struct mlx5e_priv *priv);
void mlx5_accel_psp_fs_cleanup_tx_tables(struct mlx5e_priv *priv);
void mlx5e_psp_register(struct mlx5e_priv *priv);
void mlx5e_psp_unregister(struct mlx5e_priv *priv);
int mlx5e_psp_init(struct mlx5e_priv *priv);
void mlx5e_psp_cleanup(struct mlx5e_priv *priv);
#else
static inline int mlx5_accel_psp_fs_init_rx_tables(struct mlx5e_priv *priv)
{
return 0;
}
static inline void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv) { }
static inline int mlx5_accel_psp_fs_init_tx_tables(struct mlx5e_priv *priv)
{
return 0;
}
static inline void mlx5_accel_psp_fs_cleanup_tx_tables(struct mlx5e_priv *priv) { }
static inline bool mlx5_is_psp_device(struct mlx5_core_dev *mdev)
{
return false;
}
static inline void mlx5e_psp_register(struct mlx5e_priv *priv) { }
static inline void mlx5e_psp_unregister(struct mlx5e_priv *priv) { }
static inline int mlx5e_psp_init(struct mlx5e_priv *priv) { return 0; }
static inline void mlx5e_psp_cleanup(struct mlx5e_priv *priv) { }
#endif /* CONFIG_MLX5_EN_PSP */
#endif /* __MLX5E_ACCEL_PSP_H__ */
Annotation
- Immediate include surface: `net/psp/types.h`, `en.h`.
- Detected declarations: `struct mlx5e_psp_stats`, `struct mlx5e_psp`, `function mlx5_is_psp_device`, `function mlx5_accel_psp_fs_init_rx_tables`, `function mlx5_accel_psp_fs_cleanup_rx_tables`, `function mlx5_accel_psp_fs_cleanup_tx_tables`, `function mlx5e_psp_register`, `function mlx5e_psp_cleanup`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.