drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h- Extension
.h- Size
- 6905 bytes
- Lines
- 260
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/skbuff.hlinux/netdevice.hen_accel/ipsec_rxtx.hen_accel/ktls.hen_accel/ktls_txrx.hen_accel/macsec.hen.hen/txrx.hen_accel/psp.hen_accel/psp_rxtx.hnet/geneve.h
Detected Declarations
struct mlx5e_accel_tx_statefunction Copyrightfunction mlx5e_tx_tunnel_accelfunction mlx5_geneve_tx_allowedfunction mlx5e_accel_tx_beginfunction mlx5e_accel_tx_ids_lenfunction mlx5e_accel_tx_esegfunction mlx5e_accel_tx_finishfunction mlx5e_accel_init_rxfunction mlx5e_accel_cleanup_rxfunction mlx5e_accel_init_txfunction mlx5e_accel_cleanup_tx
Annotated Snippet
struct mlx5e_accel_tx_state {
#ifdef CONFIG_MLX5_EN_TLS
struct mlx5e_accel_tx_tls_state tls;
#endif
#ifdef CONFIG_MLX5_EN_IPSEC
struct mlx5e_accel_tx_ipsec_state ipsec;
#endif
#ifdef CONFIG_MLX5_EN_PSP
struct mlx5e_accel_tx_psp_state psp_st;
#endif
};
static inline bool mlx5e_accel_tx_begin(struct net_device *dev,
struct mlx5e_txqsq *sq,
struct sk_buff *skb,
struct mlx5e_accel_tx_state *state)
{
#ifdef CONFIG_MLX5_EN_TLS
/* May send WQEs. */
if (tls_is_skb_tx_device_offloaded(skb))
if (unlikely(!mlx5e_ktls_handle_tx_skb(dev, sq, skb,
&state->tls)))
return false;
#endif
#ifdef CONFIG_MLX5_EN_PSP
if (mlx5e_psp_is_offload(skb, dev)) {
if (unlikely(!mlx5e_psp_handle_tx_skb(dev, skb, &state->psp_st)))
return false;
}
#endif
#ifdef CONFIG_MLX5_EN_IPSEC
if (test_bit(MLX5E_SQ_STATE_IPSEC, &sq->state) && xfrm_offload(skb)) {
if (unlikely(!mlx5e_ipsec_handle_tx_skb(dev, skb, &state->ipsec)))
return false;
}
#endif
#ifdef CONFIG_MLX5_MACSEC
if (unlikely(mlx5e_macsec_skb_is_offload(skb))) {
struct mlx5e_priv *priv = netdev_priv(dev);
if (unlikely(!mlx5e_macsec_handle_tx_skb(priv->macsec, skb)))
return false;
}
#endif
return true;
}
static inline unsigned int mlx5e_accel_tx_ids_len(struct mlx5e_txqsq *sq,
struct sk_buff *skb,
struct mlx5e_accel_tx_state *state)
{
#ifdef CONFIG_MLX5_EN_PSP
if (mlx5e_psp_is_offload_state(&state->psp_st))
return mlx5e_psp_tx_ids_len(&state->psp_st);
#endif
#ifdef CONFIG_MLX5_EN_IPSEC
if (test_bit(MLX5E_SQ_STATE_IPSEC, &sq->state))
return mlx5e_ipsec_tx_ids_len(&state->ipsec);
#endif
return 0;
}
/* Part of the eseg touched by TX offloads */
#define MLX5E_ACCEL_ESEG_LEN offsetof(struct mlx5_wqe_eth_seg, mss)
static inline void mlx5e_accel_tx_eseg(struct mlx5e_priv *priv,
struct sk_buff *skb,
struct mlx5e_accel_tx_state *accel,
struct mlx5_wqe_eth_seg *eseg, u16 ihs)
{
#ifdef CONFIG_MLX5_EN_PSP
if (mlx5e_psp_is_offload_state(&accel->psp_st))
mlx5e_psp_tx_build_eseg(priv, skb, &accel->psp_st, eseg);
#endif
#ifdef CONFIG_MLX5_EN_IPSEC
if (xfrm_offload(skb))
mlx5e_ipsec_tx_build_eseg(priv, skb, eseg);
#endif
#ifdef CONFIG_MLX5_MACSEC
if (unlikely(mlx5e_macsec_skb_is_offload(skb)))
mlx5e_macsec_tx_build_eseg(priv->macsec, skb, eseg);
#endif
Annotation
- Immediate include surface: `linux/skbuff.h`, `linux/netdevice.h`, `en_accel/ipsec_rxtx.h`, `en_accel/ktls.h`, `en_accel/ktls_txrx.h`, `en_accel/macsec.h`, `en.h`, `en/txrx.h`.
- Detected declarations: `struct mlx5e_accel_tx_state`, `function Copyright`, `function mlx5e_tx_tunnel_accel`, `function mlx5_geneve_tx_allowed`, `function mlx5e_accel_tx_begin`, `function mlx5e_accel_tx_ids_len`, `function mlx5e_accel_tx_eseg`, `function mlx5e_accel_tx_finish`, `function mlx5e_accel_init_rx`, `function mlx5e_accel_cleanup_rx`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.