[dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extraction

Guo, Jia jia.guo at intel.com
Tue Sep 29 04:27:16 CEST 2020


> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit at intel.com>
> Sent: Tuesday, September 29, 2020 12:00 AM
> To: Guo, Jia <jia.guo at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>;
> Zhang, Qi Z <qi.z.zhang at intel.com>; Xing, Beilei <beilei.xing at intel.com>
> Cc: dev at dpdk.org; Wang, Haiyue <haiyue.wang at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata
> extraction
> 
> 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?
> 

Oh, sorry, that is a mistake here and could and should be deleted, thanks Ferruh. 

> > +
> >   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?

Oh, another thing I miss, the config should announce and doc, will add it later.


More information about the dev mailing list