MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_tx_eseg_none

Function mlx5_tx_eseg_none

dpdk/drivers/net/mlx5/mlx5_tx.h:953–991  ·  view source on GitHub ↗

* Build the Ethernet Segment without inlined data. * Supports Software Parser, Checksums and VLAN insertion Tx offload features. * * @param txq * Pointer to TX queue structure. * @param loc * Pointer to burst routine local context. * @param wqe * Pointer to WQE to fill with built Ethernet Segment. * @param olx * Configured Tx offloads mask. It is fully defined at * compile tim

Source from the content-addressed store, hash-verified

951 * compile time and may be used for optimization.
952 */
953static __rte_always_inline void
954mlx5_tx_eseg_none(struct mlx5_txq_data *__rte_restrict txq __rte_unused,
955 struct mlx5_txq_local *__rte_restrict loc,
956 struct mlx5_wqe *__rte_restrict wqe,
957 unsigned int olx)
958{
959 struct mlx5_wqe_eseg *__rte_restrict es = &wqe->eseg;
960 uint32_t csum;
961
962 /*
963 * Calculate and set check sum flags first, dword field
964 * in segment may be shared with Software Parser flags.
965 */
966 csum = MLX5_TXOFF_CONFIG(CSUM) ? txq_ol_cksum_to_cs(loc->mbuf) : 0;
967 es->flags = rte_cpu_to_le_32(csum);
968 /*
969 * Calculate and set Software Parser offsets and flags.
970 * These flags a set for custom UDP and IP tunnel packets.
971 */
972 es->swp_offs = txq_mbuf_to_swp(loc, &es->swp_flags, olx);
973 /* Fill metadata field if needed. */
974 es->metadata = MLX5_TXOFF_CONFIG(METADATA) ?
975 loc->mbuf->ol_flags & RTE_MBUF_DYNFLAG_TX_METADATA ?
976 rte_cpu_to_be_32(*RTE_FLOW_DYNF_METADATA(loc->mbuf)) :
977 0 : 0;
978 /* Engage VLAN tag insertion feature if requested. */
979 if (MLX5_TXOFF_CONFIG(VLAN) &&
980 loc->mbuf->ol_flags & RTE_MBUF_F_TX_VLAN) {
981 /*
982 * We should get here only if device support
983 * this feature correctly.
984 */
985 MLX5_ASSERT(txq->vlan_en);
986 es->inline_hdr = rte_cpu_to_be_32(MLX5_ETH_WQE_VLAN_INSERT |
987 loc->mbuf->vlan_tci);
988 } else {
989 es->inline_hdr = RTE_BE32(0);
990 }
991}
992
993/**
994 * Build the Ethernet Segment with minimal inlined data

Callers 4

Calls 2

txq_ol_cksum_to_csFunction · 0.85
txq_mbuf_to_swpFunction · 0.85

Tested by

no test coverage detected