[dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extraction
Ferruh Yigit
ferruh.yigit at intel.com
Mon Sep 28 17:59:51 CEST 2020
On 9/27/2020 3:08 AM, Jeff Guo wrote:
> Enable metadata extraction for flexible descriptors in AVF, that would
> allow network function directly get metadata without additional parsing
> which would reduce the CPU cost for VFs. The enabling metadata
> extractions involve the metadata of VLAN/IPv4/IPv6/IPv6-FLOW/TCP/MPLS
> flexible descriptors, and the VF could negotiate the capability of
> the flexible descriptor with PF and correspondingly configure the
> specific offload at receiving queues.
>
> Signed-off-by: Jeff Guo <jia.guo at intel.com>
> Acked-by: Haiyue Wang <haiyue.wang at intel.com>
<...>
> +/* Rx L3/L4 checksum */
> +static inline uint64_t
> +iavf_rxd_error_to_pkt_flags(uint16_t stat_err0)
> +{
> + uint64_t flags = 0;
> +
> + /* check if HW has decoded the packet and checksum */
> + if (unlikely(!(stat_err0 & (1 << IAVF_RX_FLEX_DESC_STATUS0_L3L4P_S))))
> + return 0;
> +
> + if (likely(!(stat_err0 & IAVF_RX_FLEX_ERR0_BITS))) {
> + flags |= (PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD);
> + return flags;
> + }
> +
> + if (unlikely(stat_err0 & (1 << IAVF_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))
> + flags |= PKT_RX_IP_CKSUM_BAD;
> + else
> + flags |= PKT_RX_IP_CKSUM_GOOD;
> +
> + if (unlikely(stat_err0 & (1 << IAVF_RX_FLEX_DESC_STATUS0_XSUM_L4E_S)))
> + flags |= PKT_RX_L4_CKSUM_BAD;
> + else
> + flags |= PKT_RX_L4_CKSUM_GOOD;
> +
> + if (unlikely(stat_err0 & (1 << IAVF_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))
> + flags |= PKT_RX_EIP_CKSUM_BAD;
> +
> + return flags;
> +}
Is this static inline function used anywhere? If not can we delete it?
> +
> static inline void
> iavf_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union iavf_rx_desc *rxdp)
> {
> @@ -740,6 +967,21 @@ iavf_flex_rxd_to_vlan_tci(struct rte_mbuf *mb,
> } else {
> mb->vlan_tci = 0;
> }
> +
> +#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC
> + if (rte_le_to_cpu_16(rxdp->wb.status_error1) &
> + (1 << IAVF_RX_FLEX_DESC_STATUS1_L2TAG2P_S)) {
> + mb->ol_flags |= PKT_RX_QINQ_STRIPPED | PKT_RX_QINQ |
> + PKT_RX_VLAN_STRIPPED | PKT_RX_VLAN;
> + mb->vlan_tci_outer = mb->vlan_tci;
> + mb->vlan_tci = rte_le_to_cpu_16(rxdp->wb.l2tag2_2nd);
> + PMD_RX_LOG(DEBUG, "Descriptor l2tag2_1: %u, l2tag2_2: %u",
> + rte_le_to_cpu_16(rxdp->wb.l2tag2_1st),
> + rte_le_to_cpu_16(rxdp->wb.l2tag2_2nd));
> + } else {
> + mb->vlan_tci_outer = 0;
> + }
> +#endif
How this 'RTE_LIBRTE_IAVF_16BYTE_RX_DESC' controlled with meson?
Also is it mentioned in any driver documentation?
More information about the dev
mailing list