drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.h- Extension
.h- Size
- 3404 bytes
- Lines
- 122
- 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
linux/skbuff.hnet/xfrm.hnet/psp.hen.hen/txrx.h
Detected Declarations
struct mlx5e_accel_tx_psp_statefunction mlx5e_psp_is_offload_statefunction mlx5e_psp_is_offloadfunction mlx5e_psp_txwqe_build_eseg_csumfunction mlx5e_psp_tx_ids_lenfunction mlx5e_psp_is_rx_flowfunction mlx5e_psp_is_offload_statefunction mlx5e_psp_is_offloadfunction mlx5e_psp_txwqe_build_eseg_csumfunction mlx5e_psp_is_rx_flowfunction mlx5e_psp_offload_handle_rx_skb
Annotated Snippet
struct mlx5e_accel_tx_psp_state {
u32 tailen;
u32 keyid;
__be32 spi;
u8 inner_ipproto;
u8 ver;
};
#ifdef CONFIG_MLX5_EN_PSP
static inline bool mlx5e_psp_is_offload_state(struct mlx5e_accel_tx_psp_state *psp_state)
{
return (psp_state->tailen != 0);
}
static inline bool mlx5e_psp_is_offload(struct sk_buff *skb, struct net_device *netdev)
{
bool ret;
rcu_read_lock();
ret = !!psp_skb_get_assoc_rcu(skb);
rcu_read_unlock();
return ret;
}
bool mlx5e_psp_handle_tx_skb(struct net_device *netdev,
struct sk_buff *skb,
struct mlx5e_accel_tx_psp_state *psp_st);
void mlx5e_psp_tx_build_eseg(struct mlx5e_priv *priv, struct sk_buff *skb,
struct mlx5e_accel_tx_psp_state *psp_st,
struct mlx5_wqe_eth_seg *eseg);
void mlx5e_psp_handle_tx_wqe(struct mlx5e_tx_wqe *wqe,
struct mlx5e_accel_tx_psp_state *psp_st,
struct mlx5_wqe_inline_seg *inlseg);
static inline bool mlx5e_psp_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb,
struct mlx5e_accel_tx_psp_state *psp_st,
struct mlx5_wqe_eth_seg *eseg)
{
u8 inner_ipproto;
if (!mlx5e_psp_is_offload_state(psp_st))
return false;
inner_ipproto = psp_st->inner_ipproto;
eseg->cs_flags = MLX5_ETH_WQE_L3_CSUM;
if (inner_ipproto) {
eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM;
if (inner_ipproto == IPPROTO_TCP || inner_ipproto == IPPROTO_UDP)
eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
if (likely(skb->ip_summed == CHECKSUM_PARTIAL))
sq->stats->csum_partial_inner++;
} else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
sq->stats->csum_partial_inner++;
}
return true;
}
static inline unsigned int mlx5e_psp_tx_ids_len(struct mlx5e_accel_tx_psp_state *psp_st)
{
return psp_st->tailen;
}
static inline bool mlx5e_psp_is_rx_flow(struct mlx5_cqe64 *cqe)
{
return MLX5_PSP_METADATA_MARKER(be32_to_cpu(cqe->ft_metadata));
}
bool mlx5e_psp_offload_handle_rx_skb(struct net_device *netdev, struct sk_buff *skb,
struct mlx5_cqe64 *cqe);
#else
static inline bool mlx5e_psp_is_offload_state(struct mlx5e_accel_tx_psp_state *psp_state)
{
return false;
}
static inline bool mlx5e_psp_is_offload(struct sk_buff *skb, struct net_device *netdev)
{
return false;
}
static inline bool mlx5e_psp_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb,
struct mlx5e_accel_tx_psp_state *psp_st,
struct mlx5_wqe_eth_seg *eseg)
{
return false;
}
Annotation
- Immediate include surface: `linux/skbuff.h`, `net/xfrm.h`, `net/psp.h`, `en.h`, `en/txrx.h`.
- Detected declarations: `struct mlx5e_accel_tx_psp_state`, `function mlx5e_psp_is_offload_state`, `function mlx5e_psp_is_offload`, `function mlx5e_psp_txwqe_build_eseg_csum`, `function mlx5e_psp_tx_ids_len`, `function mlx5e_psp_is_rx_flow`, `function mlx5e_psp_is_offload_state`, `function mlx5e_psp_is_offload`, `function mlx5e_psp_txwqe_build_eseg_csum`, `function mlx5e_psp_is_rx_flow`.
- 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.