Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extraction
From: Guo, Jia <hidden>
Date: 2020-09-29 02:27:25
-----Original Message----- From: Ferruh Yigit <redacted> Sent: Tuesday, September 29, 2020 12:00 AM To: Guo, Jia <redacted>; Wu, Jingjing <redacted>; Zhang, Qi Z [off-list ref]; Xing, Beilei [off-list ref] Cc: dev@dpdk.org; Wang, Haiyue <redacted> Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extraction On 9/27/2020 3:08 AM, Jeff Guo wrote:quoted
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/MPLSquoted
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 <redacted> Acked-by: Haiyue Wang <redacted><...>quoted
+/* 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))))quoted
+ return 0; + + if (likely(!(stat_err0 & IAVF_RX_FLEX_ERR0_BITS))) { + flags |= (PKT_RX_IP_CKSUM_GOOD |PKT_RX_L4_CKSUM_GOOD);quoted
+ return flags; + } + + if (unlikely(stat_err0 & (1 <<IAVF_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))quoted
+ 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)))quoted
+ 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)))quoted
+ flags |= PKT_RX_EIP_CKSUM_BAD; + + return flags; +}Is this static inline function used anywhere? If not can we delete it?
Oh, sorry, that is a mistake here and could and should be deleted, thanks Ferruh.
quoted
+ static inline void iavf_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union iavf_rx_desc*rxdp)quoted
{@@ -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",quoted
+ rte_le_to_cpu_16(rxdp->wb.l2tag2_1st), + rte_le_to_cpu_16(rxdp->wb.l2tag2_2nd)); + } else { + mb->vlan_tci_outer = 0; + } +#endifHow this 'RTE_LIBRTE_IAVF_16BYTE_RX_DESC' controlled with meson? Also is it mentioned in any driver documentation?
Oh, another thing I miss, the config should announce and doc, will add it later.