net/iavf: support flex desc metadata extraction
Subsystems (2)
PATCH 1/1 net/iavf: support flex desc metadata extraction
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/OVS/ 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.
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/Makefile | 1 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 398 +++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 230 +++++++++++++- drivers/net/iavf/iavf_rxtx.h | 17 ++ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 258 ++++++++++++++++ 9 files changed, 937 insertions(+), 22 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -55,6 +55,12 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/Makefile +1 -0
@@ -26,6 +26,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_generic_flow.c SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_fdir.c SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_hash.c +SYMLINK-$(CONFIG_RTE_LIBRTE_ICE_PMD)-include := rte_pmd_iavf.h ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_sse.c endif
drivers/net/iavf/iavf.h +24 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *flex_desc;/* flexible descriptor type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,28 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_flex_desc_type { +IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , +IAVF_FLEX_DESC_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t flex_desc_dflt; +uint8_t flex_desc[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +188,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +398 -0
422 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +219 -11
307 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +17 -0
@@ -331,6 +331,7 @@ enum iavf_rxdid {IAVF_RXDID_COMMS_AUX_TCP =21 ,IAVF_RXDID_COMMS_OVS_1 =22 ,IAVF_RXDID_COMMS_OVS_2 =23 , +IAVF_RXDID_COMMS_AUX_IP_OFFSET =25 , IAVF_RXDID_LAST = 63, };
@@ -355,6 +356,20 @@ enum iavf_rx_flex_desc_status_error_0_bits { IAVF_RX_FLEX_DESC_STATUS0_LAST /* this entry must be last!!! */ }; +enum iavf_rx_flex_desc_status_error_1_bits { +/* Note: These are predefined bit offsets */ +IAVF_RX_FLEX_DESC_STATUS1_CPM_S =0 ,/* 4 bits */ +IAVF_RX_FLEX_DESC_STATUS1_NAT_S =4 , +IAVF_RX_FLEX_DESC_STATUS1_CRYPTO_S =5 , +/* [10:6] reserved */ +IAVF_RX_FLEX_DESC_STATUS1_L2TAG2P_S =11 , +IAVF_RX_FLEX_DESC_STATUS1_XTRMD2_VALID_S =12 , +IAVF_RX_FLEX_DESC_STATUS1_XTRMD3_VALID_S =13 , +IAVF_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S =14 , +IAVF_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S =15 , +IAVF_RX_FLEX_DESC_STATUS1_LAST /* this entry must be last!!! */ +}; +/* for iavf_32b_rx_flex_desc.ptype_flex_flags0 member */ #define IAVF_RX_FLEX_DESC_PTYPE_M (0x3FF)/* 10-bits */
@@ -438,6 +453,8 @@ int iavf_tx_vec_dev_check(struct rte_eth_dev *dev);int iavf_rxq_vec_setup (struct iavf_rx_queue *rxq);int iavf_txq_vec_setup (struct iavf_tx_queue *txq); +uint8_t iavf_flex_desc_type_to_rxdid (uint8_t xtr_type); +const uint32_t *iavf_get_default_ptype_table (void ); static inline
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -642,25 +642,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +258 -0
258 lines not on this page · raw message
Signature · 1 line
2.20.1
Hi Jeff,
drivers/net/iavf/Makefile
Quoted 37 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Jeff Guo
Sent: Wednesday, September 9, 2020 10:54
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] [PATCH v1] net/iavf: support flex desc metadata extractionEnable 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/OVS/ 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 <[email protected]>--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/Makefile | 1 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 398 +++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 230 +++++++++++++- drivers/net/iavf/iavf_rxtx.h | 17 ++ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 258 ++++++++++++++++ 9 files changed, 937 insertions(+), 22 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h-------------
drivers/net/iavf/Makefile +0
-0
meson build only now, remove the Makefile
Quoted 14 lines
drivers/net/iavf/iavf_rxtx.c +7
-0@@ -26,6 +26,74 @@ + +/* Translate the rx flex descriptor status to pkt flags */ +static inline void +iavf_rxd_to_pkt_fields (struct rte_mbuf *mb, +volatile union iavf_rx_flex_desc *rxdp,uint8_t rxdid) +{ + if (rxdid == IAVF_RXDID_COMMS_GENERIC ||
drivers/net/iavf/iavf_rxtx.c line 44
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +10
-0+ rxdid == IAVF_RXDID_COMMS_AUX_VLAN || + rxdid == IAVF_RXDID_COMMS_AUX_IPV4 || + rxdid == IAVF_RXDID_COMMS_AUX_IPV6 || + rxdid == IAVF_RXDID_COMMS_AUX_IPV6_FLOW || + rxdid == IAVF_RXDID_COMMS_AUX_TCP || + rxdid == IAVF_RXDID_COMMS_AUX_IP_OFFSET) +iavf_rxd_to_pkt_fields_aux (mb, rxdp); + else if (rxdid == IAVF_RXDID_COMMS_OVS_1) + iavf_rxd_to_pkt_fields_ovs(mb, rxdp); +}
We can optimize this by calling function handle:
struct iavf_rx_queue *rxq->rxd_to_pkt_fields(mb, rxdp)
and when setup the queue, assign the right handle according to the rxdid.
if (rxdid == IAVF_RXDID_COMMS_GENERIC ...)
rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_aux; else if (OVS_1) rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_ovs;
Quoted 262 lines
drivers/net/iavf/meson.build +2
-0@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')drivers/net/iavf/rte_pmd_iavf.h new file +248
-0@@ -0,0 +1,258 @@ +/* SPDX-Liavfnse-Identifier: BSD-3-Clause +* Copyright(c) 2019 Intel Corporation +*/ + +#ifndef _RTE_PMD_IAVF_H_ +#define _RTE_PMD_IAVF_H_ + +/** + * @file rte_pmd_iavf.h + * + * iavf PMD specific functions. + * + * @b EXPERIMENTAL: this API may change, or be removed, without prior notiavf + * + */ + +#include <stdio.h> +#include <rte_mbuf.h> +#include <rte_mbuf_dyn.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The supported network flexible descriptor's extraction metadata format. + */ +union rte_net_iavf_flex_desc_metadata { + uint32_t metadata; + + struct { + uint16_t data0; + uint16_t data1; + } raw; + + struct { + uint16_t stag_vid:12, + stag_dei:1, + stag_pcp:3; + uint16_t ctag_vid:12, + ctag_dei:1, + ctag_pcp:3; + } vlan; + + struct { + uint16_t protocol:8, + ttl:8; + uint16_t tos:8, + ihl:4, + version:4; + } ipv4; + + struct { + uint16_t hoplimit:8, + nexthdr:8; + uint16_t flowhi4:4, + tc:8, + version:4; + } ipv6; + + struct { + uint16_t flowlo16; + uint16_t flowhi4:4, + tc:8, + version:4; + } ipv6_flow; + + struct { + uint16_t fin:1, + syn:1, + rst:1, + psh:1, + ack:1, + urg:1, + ece:1, + cwr:1, + res1:4, + doff:4; + uint16_t rsvd; + } tcp; + + uint32_t ip_ofs; +}; + +/* Offset of mbuf dynamic field for flexible descriptor's extraction data */ +extern int rte_net_iavf_dynfield_flex_desc_metadata_offs; + +/* Mask of mbuf dynamic flags for flexible descriptor's extraction type */ +extern uint64_t rte_net_iavf_dynflag_flex_desc_vlan_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv4_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv6_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_tcp_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ovs_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ip_offset_mask; + +/** + * The mbuf dynamic field pointer for flexible descriptor's extraction metadata. + */ +#define RTE_NET_IAVF_DYNF_FLEX_DESC_METADATA(m) \ + RTE_MBUF_DYNFIELD((m), \ + rte_net_iavf_dynfield_flex_desc_metadata_offs, \ + uint32_t *) + +/** + * The mbuf dynamic flag for VLAN protocol extraction metadata, it is valid + * when dev_args 'flex_desc' has 'vlan' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_VLAN \ + (rte_net_iavf_dynflag_flex_desc_vlan_mask) + +/** + * The mbuf dynamic flag for IPv4 protocol extraction metadata, it is valid + * when dev_args 'flex_desc' has 'ipv4' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV4 \ + (rte_net_iavf_dynflag_flex_desc_ipv4_mask) + +/** + * The mbuf dynamic flag for IPv6 protocol extraction metadata, it is valid + * when dev_args 'flex_desc' has 'ipv6' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6 \ + (rte_net_iavf_dynflag_flex_desc_ipv6_mask) + +/** + * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata, it is + * valid when dev_args 'flex_desc' has 'ipv6_flow' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6_FLOW \ + (rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask) + +/** + * The mbuf dynamic flag for TCP protocol extraction metadata, it is valid + * when dev_args 'flex_desc' has 'tcp' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_TCP \ + (rte_net_iavf_dynflag_flex_desc_tcp_mask) + +/** + * The mbuf dynamic flag for the extraction metadata of OVS flexible + * descriptor, it is valid when dev_args 'flex_desc' has 'ovs' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_OVS \ + (rte_net_iavf_dynflag_flex_desc_ovs_mask) + +/** + * The mbuf dynamic flag for IP_OFFSET extraction metadata, it is valid + * when dev_args 'flex_desc' has 'ip_offset' specified. + */ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IP_OFFSET \ + (rte_net_iavf_dynflag_flex_desc_ip_offset_mask) + +/** + * Check if mbuf dynamic field for flexible descriptor's extraction metadata + * is registered. + * + * @return + * True if registered, false otherwise. + */ +__rte_experimental +static __rte_always_inline int +rte_net_iavf_dynf_flex_desc_metadata_avail(void) +{ + return rte_net_iavf_dynfield_flex_desc_metadata_offs != -1; +} + +/** + * Get the mbuf dynamic field for flexible descriptor's extraction metadata. + * + * @param m + * The pointer to the mbuf. + * @return + * The saved protocol extraction metadata. + */ +__rte_experimental +static __rte_always_inline uint32_t +rte_net_iavf_dynf_flex_desc_metadata_get(struct rte_mbuf *m) +{ + return *RTE_NET_IAVF_DYNF_FLEX_DESC_METADATA(m); +} + +/** + * Dump the mbuf dynamic field for flexible descriptor's extraction metadata. + * + * @param m + * The pointer to the mbuf. + */ +__rte_experimental +static inline void +rte_net_iavf_dump_flex_desc_metadata(struct rte_mbuf *m) +{ + union rte_net_iavf_flex_desc_metadata data; + + if (!rte_net_iavf_dynf_flex_desc_metadata_avail()) + return; + + data.metadata = rte_net_iavf_dynf_flex_desc_metadata_get(m); + + if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_VLAN) + printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," + "vlan,stag=%u:%u:%u,ctag=%u:%u:%u", + data.raw.data0, data.raw.data1, + data.vlan.stag_pcp, + data.vlan.stag_dei, + data.vlan.stag_vid, + data.vlan.ctag_pcp, + data.vlan.ctag_dei, + data.vlan.ctag_vid); + else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV4) + printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," + "ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u", + data.raw.data0, data.raw.data1, + data.ipv4.version, + data.ipv4.ihl, + data.ipv4.tos, + data.ipv4.ttl, + data.ipv4.protocol); + else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6) + printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," + "ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u", + data.raw.data0, data.raw.data1, + data.ipv6.version, + data.ipv6.tc, + data.ipv6.flowhi4, + data.ipv6.nexthdr, + data.ipv6.hoplimit); + else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6_FLOW) + printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," + "ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x", + data.raw.data0, data.raw.data1, + data.ipv6_flow.version, + data.ipv6_flow.tc, + data.ipv6_flow.flowhi4, + data.ipv6_flow.flowlo16); + else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_TCP) + printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," + "tcp,doff=%u,flags=%s%s%s%s%s%s%s%s", + data.raw.data0, data.raw.data1, + data.tcp.doff, + data.tcp.cwr ? "C" : "", + data.tcp.ece ? "E" : "", + data.tcp.urg ? "U" : "", + data.tcp.ack ? "A" : "", + data.tcp.psh ? "P" : "", + data.tcp.rst ? "R" : "", + data.tcp.syn ? "S" : "", + data.tcp.fin ? "F" : "");
drivers/net/iavf/rte_pmd_iavf.h line 258
Quoted 10 lines
drivers/net/iavf/rte_pmd_iavf.h new file +10
-0+ else if (m->ol_flags & RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IP_OFFSET) + printf(" - Flexible descriptor's Extraction: ip_offset=%u", + data.ip_ofs); +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_PMD_IAVF_H_ */
You need to export these global symbols into rte_pmd_iavf_version.map like:
EXPERIMENTAL {
global:
rte_net_iavf_dynfield_proto_xtr_metadata_offs;
...
};Quoted 2 lines
--
2.20.1
hi, haiyue
Quoted 44 lines
-----Original Message-----
From: Wang, Haiyue <[email protected]>
Sent: Thursday, September 17, 2020 11:00 AM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v1] net/iavf: support flex desc metadata extractionHi Jeff,
Quoted 31 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Jeff Guo
Sent: Wednesday, September 9, 2020 10:54
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Guo, Jia <[email protected]>
Subject: [dpdk-dev] [PATCH v1] net/iavf: support flex desc metadata extractionEnable 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/OVS/ 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 <[email protected]>--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/Makefile | 1 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 398 +++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 230 +++++++++++++- drivers/net/iavf/iavf_rxtx.h | 17 ++ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 258 ++++++++++++++++ 9 files changed, 937 insertions(+), 22 deletions(-) create mode100644
drivers/net/iavf/rte_pmd_iavf.h
Quoted 8 lines
drivers/net/iavf/Makefile
Quoted 5 lines
-------------
drivers/net/iavf/Makefile +0
-0meson build only now, remove the
Makefile
Oh, that is exactly.
Quoted 24 lines
Quoted 11 lines
(quoted diff) +0
-0
b/drivers/net/iavf/iavf_rxtx.cindex05a7dd898..fa71b4a80100644drivers/net/iavf/iavf_rxtx.c +3
-0@@ -26,6 +26,74 @@ + +/* Translate the rx flex descriptor status to pkt flags */ static +inline void iavf_rxd_to_pkt_fields(struct rte_mbuf *mb,drivers/net/iavf/iavf_rxtx.c line 40
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +10
-0+ volatile union iavf_rx_flex_desc *rxdp, uint8_t rxdid) { if +(rxdid == IAVF_RXDID_COMMS_GENERIC || + rxdid == IAVF_RXDID_COMMS_AUX_VLAN || + rxdid == IAVF_RXDID_COMMS_AUX_IPV4 || + rxdid == IAVF_RXDID_COMMS_AUX_IPV6 || + rxdid == IAVF_RXDID_COMMS_AUX_IPV6_FLOW || + rxdid == IAVF_RXDID_COMMS_AUX_TCP || + rxdid == IAVF_RXDID_COMMS_AUX_IP_OFFSET) +iavf_rxd_to_pkt_fields_aux(mb, rxdp); else if (rxdid == +IAVF_RXDID_COMMS_OVS_1) iavf_rxd_to_pkt_fields_ovs(mb, rxdp); }We can optimize this by calling function handle:
Quoted 9 lines
struct
iavf_rx_queue*rxq->rxd_to_pkt_fields(mb, rxdp)and when setup the queue, assign the right handle according to the rxdid.
if (rxdid ==IAVF_RXDID_COMMS_GENERIC...)rxq->rxd_to_pkt_fields=iavf_rxd_to_pkt_fields_aux;
else if (OVS_1)rxq->rxd_to_pkt_fields=iavf_rxd_to_pkt_fields_ovs;
Sounds not bad if it could let it more clear for handling these diversity protocols, let's see what we could bring some modification in coming version.
Quoted 273 lines
Quoted 30 lines
drivers/net/iavf/meson.build +2
-0@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')(quoted diff) +0
-0
b/drivers/net/iavf/rte_pmd_iavf.hnew file mode 100644 index 000000000..858201bd7drivers/net/iavf/rte_pmd_iavf.h new file +16
-0@@ -0,0 +1,258 @@ +/* SPDX-Liavfnse-Identifier: BSD-3-Clause +* Copyright(c) 2019 Intel Corporation */ + +#ifndef _RTE_PMD_IAVF_H_ +#define _RTE_PMD_IAVF_H_ + +/** +* @file rte_pmd_iavf.h +* +* iavf PMD specific functions. +* +* @b EXPERIMENTAL: this API may change, or be removed, without prior +notiavf +* +*/ +drivers/net/iavf/rte_pmd_iavf.h line 26
Quoted 10 lines
drivers/net/iavf/rte_pmd_iavf.h new file +10
-0+#include <stdio.h> +#include <rte_mbuf.h> +#include <rte_mbuf_dyn.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** +* The supported network flexible descriptor's extraction metadata format.
Quoted 61 lines
drivers/net/iavf/rte_pmd_iavf.h new file +61
-0+*/ +union rte_net_iavf_flex_desc_metadata {uint32_t metadata; + +struct { +uint16_t data0; +uint16_t data1; +} raw; + +struct { +uint16_t stag_vid:12 , + stag_dei:1 , + stag_pcp:3 ; +uint16_t ctag_vid:12 , + ctag_dei:1 , + ctag_pcp:3 ; +} vlan; + +struct { +uint16_t protocol:8 , + ttl:8 ; +uint16_t tos:8 , + ihl:4 , + version:4 ; +} ipv4; + +struct { +uint16_t hoplimit:8 , + nexthdr:8 ; +uint16_t flowhi4:4 , + tc:8 , + version:4 ; +} ipv6; + +struct { +uint16_t flowlo16; +uint16_t flowhi4:4 , + tc:8 , + version:4 ; +} ipv6_flow; + +struct { +uint16_t fin:1 , + syn:1 , + rst:1 , + psh:1 , + ack:1 , + urg:1 , + ece:1 , + cwr:1 , + res1:4 , + doff:4 ; +uint16_t rsvd; +} tcp; + +uint32_t ip_ofs; +}; + +/* Offset of mbuf dynamic field for flexible descriptor's extraction +data */ extern int rte_net_iavf_dynfield_flex_desc_metadata_offs; + +/* Mask of mbuf dynamic flags for flexible descriptor's extraction drivers/net/iavf/rte_pmd_iavf.h
Quoted 10 lines
drivers/net/iavf/rte_pmd_iavf.h new file +10
-0+type */ extern uint64_t rte_net_iavf_dynflag_flex_desc_vlan_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv4_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv6_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_tcp_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ovs_mask; +extern uint64_t rte_net_iavf_dynflag_flex_desc_ip_offset_mask; + +/** +* The mbuf dynamic field pointer for flexible descriptor's extraction metadata.
Quoted 76 lines
drivers/net/iavf/rte_pmd_iavf.h new file +76
-0+*/ +#define RTE_NET_IAVF_DYNF_FLEX_DESC_METADATA (m) \ +RTE_MBUF_DYNFIELD((m), \ + rte_net_iavf_dynfield_flex_desc_metadata_offs, \ + uint32_t *) + +/** +* The mbuf dynamic flag for VLAN protocol extraction metadata, it is +valid +* when dev_args 'flex_desc' has 'vlan' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_VLAN \ +(rte_net_iavf_dynflag_flex_desc_vlan_mask) + +/** +* The mbuf dynamic flag for IPv4 protocol extraction metadata, it is +valid +* when dev_args 'flex_desc' has 'ipv4' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV4 \ +(rte_net_iavf_dynflag_flex_desc_ipv4_mask) + +/** +* The mbuf dynamic flag for IPv6 protocol extraction metadata, it is +valid +* when dev_args 'flex_desc' has 'ipv6' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6 \ +(rte_net_iavf_dynflag_flex_desc_ipv6_mask) + +/** +* The mbuf dynamic flag for IPv6 with flow protocol extraction +metadata, it is +* valid when dev_args 'flex_desc' has 'ipv6_flow' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6_FLOW \ +(rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask) + +/** +* The mbuf dynamic flag for TCP protocol extraction metadata, it is +valid +* when dev_args 'flex_desc' has 'tcp' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_TCP \ +(rte_net_iavf_dynflag_flex_desc_tcp_mask) + +/** +* The mbuf dynamic flag for the extraction metadata of OVS flexible +* descriptor, it is valid when dev_args 'flex_desc' has 'ovs' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_OVS \ +(rte_net_iavf_dynflag_flex_desc_ovs_mask) + +/** +* The mbuf dynamic flag for IP_OFFSET extraction metadata, it is +valid +* when dev_args 'flex_desc' has 'ip_offset' specified. +*/ +#define RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IP_OFFSET \ +(rte_net_iavf_dynflag_flex_desc_ip_offset_mask) + +/** +* Check if mbuf dynamic field for flexible descriptor's extraction +metadata +* is registered. +* +* @return +* True if registered, false otherwise. +*/ +__rte_experimental +static __rte_always_inline int +rte_net_iavf_dynf_flex_desc_metadata_avail (void ) +{ +return rte_net_iavf_dynfield_flex_desc_metadata_offs !=-1 ; } + +/** drivers/net/iavf/rte_pmd_iavf.h line 178
Quoted 10 lines
drivers/net/iavf/rte_pmd_iavf.h new file +10
-0+* Get the mbuf dynamic field for flexible descriptor's extraction metadata. +* +* @param m +* The pointer to the mbuf. +* @return +* The saved protocol extraction metadata. +*/ +__rte_experimental +static __rte_always_inline uint32_t +rte_net_iavf_dynf_flex_desc_metadata_get (struct rte_mbuf *m){ return
drivers/net/iavf/rte_pmd_iavf.h line 188
Quoted 5 lines
drivers/net/iavf/rte_pmd_iavf.h new file +5
-0+*RTE_NET_IAVF_DYNF_FLEX_DESC_METADATA (m); +} + +/** +* Dump the mbuf dynamic field for flexible descriptor's extraction metadata.
Quoted 67 lines
drivers/net/iavf/rte_pmd_iavf.h new file +67
-0+* +* @param m +* The pointer to the mbuf. +*/ +__rte_experimental +static inline void +rte_net_iavf_dump_flex_desc_metadata (struct rte_mbuf *m) {union +rte_net_iavf_flex_desc_metadata data; + +if (!rte_net_iavf_dynf_flex_desc_metadata_avail ()) +return ; + +data.metadata =rte_net_iavf_dynf_flex_desc_metadata_get (m); + +if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_VLAN ) +printf (" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," +"vlan,stag=%u:%u:%u,ctag=%u:%u:%u" , + data.raw.data0, data.raw.data1, + data.vlan.stag_pcp, + data.vlan.stag_dei, + data.vlan.stag_vid, + data.vlan.ctag_pcp, + data.vlan.ctag_dei, + data.vlan.ctag_vid); +else if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV4 ) +printf (" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," +"ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u" , + data.raw.data0, data.raw.data1, + data.ipv4.version, + data.ipv4.ihl, + data.ipv4.tos, + data.ipv4.ttl, + data.ipv4.protocol); +else if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6 ) +printf (" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," +"ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u" , + data.raw.data0, data.raw.data1, + data.ipv6.version, + data.ipv6.tc, + data.ipv6.flowhi4, + data.ipv6.nexthdr, + data.ipv6.hoplimit); +else if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IPV6_FLOW ) +printf (" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," +"ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x" , + data.raw.data0, data.raw.data1, + data.ipv6_flow.version, + data.ipv6_flow.tc, + data.ipv6_flow.flowhi4, + data.ipv6_flow.flowlo16); +else if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_TCP ) +printf (" - Flexible descriptor's Metadata: [0x%04x:0x%04x]," +"tcp,doff=%u,flags=%s%s%s%s%s%s%s%s" , + data.raw.data0, data.raw.data1, + data.tcp.doff, + data.tcp.cwr ?"C" :"" , + data.tcp.ece ?"E" :"" , + data.tcp.urg ?"U" :"" , + data.tcp.ack ?"A" :"" , + data.tcp.psh ?"P" :"" , + data.tcp.rst ?"R" :"" , + data.tcp.syn ?"S" :"" , + data.tcp.fin ?"F" :"" ); +else if (m->ol_flags &RTE_IAVF_PKT_RX_DYNF_FLEX_DESC_IP_OFFSET ) +printf (" - Flexible descriptor's Extraction: ip_offset=%u" , + data.ip_ofs); +}
Quoted 9 lines
drivers/net/iavf/rte_pmd_iavf.h line 258
Quoted 6 lines
drivers/net/iavf/rte_pmd_iavf.h new file +6
-0+ +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_PMD_IAVF_H_ */ You need to export these global symbols into rte_pmd_iavf_version.map like:
Ok.
Quoted 10 lines
EXPERIMENTAL { global: rte_net_iavf_dynfield_proto_xtr_metadata_offs; ... };Quoted 2 lines
--
2.20.1
PATCH v2 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---v2->v1:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 395 +++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 282 ++++++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 233 ++++++++------- drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++++ 8 files changed, 1068 insertions(+), 147 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -62,6 +62,12 @@ New Features * Added support for non-zero priorities for group 0 flows * Added support for VXLAN decap combined with VLAN pop +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +24 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *flex_desc;/* flexible descriptor type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,28 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_flex_desc_type { +IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , +IAVF_FLEX_DESC_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t flex_desc_dflt; +uint8_t flex_desc[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +188,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +395 -0
419 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +250 -32
358 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +129 -104
263 lines not on this page · raw message
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v3 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 395 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 282 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 233 +++++++------ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 9 files changed, 1081 insertions(+), 147 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -62,6 +62,12 @@ New Features * Added support for non-zero priorities for group 0 flows * Added support for VXLAN decap combined with VLAN pop +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +24 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *flex_desc;/* flexible descriptor type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,28 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_flex_desc_type { +IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , +IAVF_FLEX_DESC_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t flex_desc_dflt; +uint8_t flex_desc[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +188,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +395 -0
419 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +250 -32
358 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +129 -104
263 lines not on this page · raw message
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_flex_desc_metadata_offs; + rte_net_iavf_dynflag_flex_desc_vlan_mask; + rte_net_iavf_dynflag_flex_desc_ipv4_mask; + rte_net_iavf_dynflag_flex_desc_ipv6_mask; + rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask; + rte_net_iavf_dynflag_flex_desc_tcp_mask; + rte_net_iavf_dynflag_flex_desc_ip_offset_mask; +};
Signature · 1 line
2.20.1
Quoted 39 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Wednesday, September 23, 2020 15:53
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v3] net/iavf: support flex desc metadata extractionEnable 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 <[email protected]>---
v3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 395 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 282 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 233 +++++++------ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 9 files changed, 1081 insertions(+), 147 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.hdrivers/net/iavf/iavf.h +1
-0+enum iavf_flex_desc_type {
drivers/net/iavf/iavf.h struct iavf_info { · line 168
Quoted 10 lines
drivers/net/iavf/iavf.h +10
-0+IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , + IAVF_FLEX_DESC_MAX, +};
The vector PMD will also support extract the above data type ? Take ice as an example, if user specifies the 'proto_xtr', the vector Rx path will be disabled, it will be handled in C function.
enum proto_xtr_type {
PROTO_XTR_NONE,
PROTO_XTR_VLAN,
PROTO_XTR_IPV4,
PROTO_XTR_IPV6,
PROTO_XTR_IPV6_FLOW,
PROTO_XTR_TCP,
PROTO_XTR_IP_OFFSET,
PROTO_XTR_MAX /* The last one */
};static inline int ice_rx_vec_queue_default(struct ice_rx_queue *rxq)
{
...
if (rxq->proto_xtr != PROTO_XTR_NONE)
return -1;
return 0;
}Quoted 2 lines
--
2.20.1
Quoted 76 lines
-----Original Message-----
From: Wang, Haiyue <[email protected]>
Sent: Wednesday, September 23, 2020 4:11 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH v3] net/iavf: support flex desc metadata extractionQuoted 9 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Wednesday, September 23, 2020 15:53
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v3] net/iavf: support flex desc metadata extractionQuoted 4 lines
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
Quoted 27 lines
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 <[email protected]>---
v3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 395 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 282 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 233 +++++++------ drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 9 files changed, 1081 insertions(+), 147 deletions(-) create mode100644
drivers/net/iavf/rte_pmd_iavf.hdrivers/net/iavf/iavf.h +1
-0+enum iavf_flex_desc_type {drivers/net/iavf/iavf.h struct iavf_info { · line 168
Quoted 10 lines
drivers/net/iavf/iavf.h +10
-0+IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , +IAVF_FLEX_DESC_MAX, +};The vector PMD will also support extract the above data type ? Take ice as an example, if user specifies the '
proto_xtr', the vector Rx path will be disabled, it will be handled in C function.enum
proto_xtr_type{PROTO_XTR_NONE,PROTO_XTR_VLAN,PROTO_XTR_IPV4,PROTO_XTR_IPV6,PROTO_XTR_IPV6_FLOW,PROTO_XTR_TCP,PROTO_XTR_IP_OFFSET,PROTO_XTR_MAX/* The last one */
};
Quoted 9 lines
static inline int
ice_rx_vec_queue_default(struct ice_rx_queue *rxq){ ...if (
rxq->proto_xtr!=PROTO_XTR_NONE)
return -1;return 0;
}
You are right, vector will not support extraction, the version lack of handling for that.
Quoted 4 lines
Quoted 3 lines
--
2.20.1
PATCH v4 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 25 +- drivers/net/iavf/iavf_ethdev.c | 399 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 284 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 234 +++++++------ drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 10 files changed, 1091 insertions(+), 147 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -62,6 +62,12 @@ New Features * Added support for non-zero priorities for group 0 flows * Added support for VXLAN decap combined with VLAN pop +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +24 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *flex_desc;/* flexible descriptor type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,28 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_flex_desc_type { +IAVF_FLEX_DESC_NONE , +IAVF_FLEX_DESC_VLAN , +IAVF_FLEX_DESC_IPV4 , +IAVF_FLEX_DESC_IPV6 , +IAVF_FLEX_DESC_IPV6_FLOW , +IAVF_FLEX_DESC_TCP , +IAVF_FLEX_DESC_OVS , +IAVF_FLEX_DESC_IP_OFFSET , +IAVF_FLEX_DESC_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t flex_desc_dflt; +uint8_t flex_desc[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +188,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +399 -0
423 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +252 -32
360 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +130 -104
264 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->flex_desc !=IAVF_FLEX_DESC_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_flex_desc_metadata_offs; + rte_net_iavf_dynflag_flex_desc_vlan_mask; + rte_net_iavf_dynflag_flex_desc_ipv4_mask; + rte_net_iavf_dynflag_flex_desc_ipv6_mask; + rte_net_iavf_dynflag_flex_desc_ipv6_flow_mask; + rte_net_iavf_dynflag_flex_desc_tcp_mask; + rte_net_iavf_dynflag_flex_desc_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v5 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 283 ++++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 10 files changed, 1051 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -78,6 +78,12 @@ New Features ``--portmask=N`` where N represents the hexadecimal bitmask of ports used. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +251 -32
359 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
Quoted 30 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Friday, September 25, 2020 14:23
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v5] net/iavf: support flex desc metadata extractionEnable 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 <[email protected]>---
v5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling
Quoted 13 lines
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 283 ++++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 10 files changed, 1051 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
LGTM
Quoted 1 line
2.20.1
PATCH v6 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 283 ++++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 10 files changed, 1051 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -84,6 +84,12 @@ New Features * Added support for 200G PAM4 link speed. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +251 -32
359 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
Zhang, Qi Z
AppliedQuoted 16 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Sunday, September 27, 2020 10:09 AM
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v6] net/iavf: support flex desc metadata extractionEnable 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.
Quoted 2 lines
Signed-off-by Jeff Guo <[email protected]>Acked-by Haiyue Wang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>
<...>
Quoted 20 lines
drivers/net/iavf/iavf_rxtx.c +20
-0+/* 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 ; +
drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev) · line 943
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +10
-0+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?
Quoted 13 lines
drivers/net/iavf/iavf_rxtx.c +6
-0+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 |
drivers/net/iavf/iavf_rxtx.c iavf_flex_rxd_to_vlan_tci(struct rte_mbuf *mb, · line 984
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +10
-0+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?
+ Bruce
Quoted 46 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, September 29, 2020 00:00
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extractionQuoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]><...>
Quoted 24 lines
drivers/net/iavf/iavf_rxtx.c +24
-0+/* 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 ;
Quoted 9 lines
drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev) · line 943
Quoted 6 lines
drivers/net/iavf/iavf_rxtx.c +6
-0+ +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?
The same function as iavf_flex_rxd_error_to_pkt_flags.
Looks like meson/gcc missed this [-Werror,-Wunused-function] capturing.
http://mails.dpdk.org/archives/test-report/2020-September/154839.html
Quoted 58 lines · Haiyue
+ Bruce
Quoted 46 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, September 29, 2020 00:00
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extractionQuoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]><...>
Quoted 24 lines
drivers/net/iavf/iavf_rxtx.c +24
-0+/* 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 ;Quoted 9 lines
drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev) · line 943
Quoted 6 lines
drivers/net/iavf/iavf_rxtx.c +6
-0+ +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?
Quoted 5 lines
The same function as
iavf_flex_rxd_error_to_pkt_flags.Looks like meson/gcc missed this [-Werror,-Wunused-function] capturing.
http://mails.dpdk.org/archives/test-report/2020-September/154839.html
AFAIK, unused static functions get a warning about being unused, static inline functions don't. Unless you are defining a function in a header files, I'd recommend omitting the "inline" part so you do get unused function errors.
/Bruce
Quoted 68 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, September 29, 2020 00:22
To: Wang, Haiyue <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extractionQuoted 58 lines · Haiyue
+ Bruce
Quoted 55 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, September 29, 2020 00:00
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extractionQuoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]><...>
Quoted 20 lines
drivers/net/iavf/iavf_rxtx.c +20
-0+/* 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 ; +drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev) · line 943
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +10
-0+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?
Quoted 9 lines
Quoted 5 lines
The same function as
iavf_flex_rxd_error_to_pkt_flags.Looks like meson/gcc missed this [-Werror,-Wunused-function] capturing.
http://mails.dpdk.org/archives/test-report/2020-September/154839.htmlAFAIK, unused static functions get a warning about being unused, static inline functions don't. Unless you are defining a function in a header files, I'd recommend omitting the "inline" part so you do get unused function errors.
Thanks, Bruce
Yes, after removing the 'inline' keyword, got the warning message:
[1315/2332] Compiling C object 'drivers/drivers@@tmp_rte_pmd_iavf@sta/net_iavf_iavf_rxtx.c.o'. ../drivers/net/iavf/iavf_rxtx.c:916:1: warning: 'iavf_rxd_error_to_pkt_flags' defined but not used [-Wunused-function]
916 | iavf_rxd_error_to_pkt_flags(uint16_t stat_err0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Not sure how does clang handle 'static inline' as 'static'. Anyway, code review needs to be enhanced.;-)
Quoted 1 line
/Bruce
Quoted 55 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, September 29, 2020 12:00 AM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v6] net/iavf: support flex desc metadata extractionQuoted 4 lines · Jeff Guo
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
Quoted 6 lines
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 <[email protected]>Acked-by Haiyue Wang <[email protected]><...>
drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev)
Quoted 7 lines
drivers/net/iavf/iavf_rxtx.c +7
-0+/* 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))))drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev)
Quoted 4 lines
drivers/net/iavf/iavf_rxtx.c +4
-0+return 0 ; + +if (likely (!(stat_err0 &IAVF_RX_FLEX_ERR0_BITS ))) { + flags |= (PKT_RX_IP_CKSUM_GOOD |
PKT_RX_L4_CKSUM_GOOD);drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev)
Quoted 4 lines
drivers/net/iavf/iavf_rxtx.c +4
-0+return flags; + } + + if (unlikely(stat_err0 & (1 <<
IAVF_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev)
Quoted 5 lines
drivers/net/iavf/iavf_rxtx.c +5
-0+ 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)))drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev)
Quoted 5 lines
drivers/net/iavf/iavf_rxtx.c +5
-0+ 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 7 lines
drivers/net/iavf/iavf_rxtx.c iavf_stop_queues(struct rte_eth_dev *dev) · line 943
Quoted 4 lines
drivers/net/iavf/iavf_rxtx.c +4
-0+ 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 19 lines
Quoted 3 lines
+
static inline void
iavf_rxd_to_vlan_tci(structrte_mbuf*mb, volatile unioniavf_rx_desc*rxdp)
Quoted 4 lines
{drivers/net/iavf/iavf_rxtx.c +0
-0@@ -740,6 +967,21 @@ iavf_flex_rxd_to_vlan_tci(struct rte_mbuf *mb, }else { mb->vlan_tci =0 ;drivers/net/iavf/iavf_rxtx.c iavf_flex_rxd_to_vlan_tci(struct rte_mbuf *mb, · line 978
Quoted 10 lines
drivers/net/iavf/iavf_rxtx.c +9
-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 9 lines
drivers/net/iavf/iavf_rxtx.c iavf_flex_rxd_to_vlan_tci(struct rte_mbuf *mb, · line 984
Quoted 6 lines
drivers/net/iavf/iavf_rxtx.c +6
-0+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.
PATCH v7 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
config/rte_config.h +3 -0
@@ -124,6 +124,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16
doc/guides/nics/intel_vf.rst +16 -0
@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``) + + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. + Configure to 16-byte Rx descriptor may cause a negotiation failure during VF driver initialization + if the PF driver doesn't support.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -84,6 +84,12 @@ New Features * Added support for 200G PAM4 link speed. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v7 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
config/rte_config.h +3 -0
@@ -124,6 +124,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16
doc/guides/nics/intel_vf.rst +16 -0
@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``) + + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. + Configure to 16-byte Rx descriptor may cause a negotiation failure during VF driver initialization + if the PF driver doesn't support.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -84,6 +84,12 @@ New Features * Added support for 200G PAM4 link speed. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -647,25 +647,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v8 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
config/rte_config.h +3 -0
@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16
doc/guides/nics/intel_vf.rst +16 -0
@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``) + + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. + Configure to 16-byte Rx descriptor may cause a negotiation failure during VF driver initialization + if the PF driver doesn't support.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -160,6 +160,12 @@ New Features packets with specified ratio, and apply with own set of actions with a fate action. When the ratio is set to 1 then the packets will be 100% mirrored. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -648,25 +648,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
Zhang, Qi Z
AppliedQuoted 18 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Tuesday, October 13, 2020 4:18 PM
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v8] net/iavf: support flex desc metadata extractionEnable 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.
Quoted 2 lines
Signed-off-by Jeff Guo <[email protected]>Acked-by Haiyue Wang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 53 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-)create mode 100644
drivers/net/iavf/rte_pmd_iavf.hconfig/rte_config.h +0
-0
config/rte_config.h line 132
Quoted 6 lines
config/rte_config.h +3
-0@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +
Hi Jeff,
The 'RTE_LIBRTE_IAVF_16BYTE_RX_DESC' was already there, not introduced with this patch, so I think better to add this change as different patch.
Also not sure if we want to add more config options to the 'rte_config.h', indeed otherway around and we are trying to get rid of as much as compile time optios. cc'ed Bruce too.
Quoted 13 lines
config/rte_config.h +0
-0/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16doc/guides/nics/intel_vf.rst +2
-0@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + +
doc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 629
Quoted 10 lines
doc/guides/nics/intel_vf.rst +10
-0+Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``)
There is no 'CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC' anymore, this is from make days naming.
Instead, what do you think not adding the 'RTE_LIBRTE_IAVF_16BYTE_RX_DESC' to the 'rte_config.h', but document how this flag can be provided by meson during build:
meson -Dc_args="-DRTE_LIBRTE_IAVF_16BYTE_RX_DESC"
And we should plan for long term to convert this compile time flag to runtime devargs.
What do you think?
Quoted 9 lines
doc/guides/nics/intel_vf.rst +4
-0+ + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. + Configure to 16-byte Rx descriptor may cause a negotiation failure during VF driver initialization + if the PF driver doesn't support.doc/guides/rel_notes/release_20_11.rst +0
-0
doc/guides/rel_notes/release_20_11.rst New Features · line 168
Quoted 9 lines
doc/guides/rel_notes/release_20_11.rst +6
-0@@ -160,6 +160,12 @@ New Features packets with specified ratio, and apply with own set of actions with a fate action. When the ratio is set to 1 then the packets will be 100% mirrored. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. +
Can you please move the update to the net drivers block, instead of very bottom. There is an order in the release notes (as commented in section header) like:
- core libs
- ethdev lib related changes
- ethdev PMDS change
- ...
<...>
doc/guides/rel_notes/release_20_11.rst New Features
Quoted 12 lines
doc/guides/rel_notes/release_20_11.rst +12
-0+ +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask;
As a namespace previously "rte_pmd_xxx" was used for PMD specific APIs, can you please switch to that? 'rte_net_' is used by the 'librte_net' library.
Above list is the dynfield values, what is the correct usage for dynfields,
1- Put dynfileds names in to the header, and application does a lookup ('rte_mbuf_dynfield_lookup()') to get the dynfield values. or
2- Expose dynfield values to be accessed directly from application, as done above.
@Oliver, can you please support.
I can see (1) has advantage of portability if more than one PMD supports same dynfield names, but that sees not a case for above ones.
Quoted 62 lines · Ferruh Yigit
Quoted 53 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-)create mode 100644
drivers/net/iavf/rte_pmd_iavf.hconfig/rte_config.h +0
-0config/rte_config.h line 131
Quoted 5 lines
config/rte_config.h +3
-0@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +Hi Jeff,
Quoted 8 lines
The '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' was already there, not introduced with this patch, so I think better to add this change as different patch.Also not sure if we want to add more config options to the '
rte_config.h', indeed otherway around and we are trying to get rid of as much as compile time optios.
cc'ed Bruce too.
Actually, there is also patchset [1] to consider, which changes the format of these values in the header file. It's better to not "undef" the not set values, as that prevents someone from setting them via cflags/c_args when building.
/Bruce
Quoted 83 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Wednesday, October 14, 2020 10:04 PM
To: Yigit, Ferruh <[email protected]>
Cc: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; Wang, Haiyue <[email protected]>; Olivier Matz <[email protected]>
Subject: Re: [PATCH v8] net/iavf: support flex desc metadata extractionQuoted 62 lines · Ferruh Yigit
Quoted 53 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-)create mode 100644
drivers/net/iavf/rte_pmd_iavf.hconfig/rte_config.h index renamed from config/rte_config.h +0
-0
03d90d78bc..2c53072c3d100644config/rte_config.h line 131
Quoted 5 lines
config/rte_config.h +3
-0@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +Hi Jeff,
Quoted 1 line
The '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' was already there, notintroduced
Quoted 7 lines
with this patch, so I think better to add this change as different patch.
Also not sure if we want to add more config options to the '
rte_config.h', indeed otherway around and we are trying to get rid of as much as compile time optios.
cc'ed Bruce too.
Quoted 7 lines
Actually, there is also patchset [1] to consider, which changes the format of these values in the header file. It's better to not "undef" the not set values, as that prevents someone from setting them via cflags/c_args when building.
/Bruce
Ok, make sense, and I will flow the new policy when I update the new version.
Quoted 116 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, October 14, 2020 8:32 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Olivier Matz <[email protected]>
Subject: Re: [PATCH v8] net/iavf: support flex desc metadata extractionQuoted 4 lines · Jeff Guo
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
Quoted 49 lines
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-)create mode 100644
drivers/net/iavf/rte_pmd_iavf.hconfig/rte_config.h index renamed from config/rte_config.h +0
-0
03d90d78bc..2c53072c3d100644config/rte_config.h line 132
Quoted 6 lines
config/rte_config.h +3
-0@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +Hi Jeff,
The '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' was already there, not introduced with this patch, so I think better to add this change as different patch.Also not sure if we want to add more config options to the '
rte_config.h', indeed otherway around and we are trying to get rid of as much as compile time optios.
cc'ed Bruce too.Quoted 11 lines
config/rte_config.h +0
-0/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16 diff --git
a/doc/guides/nics/intel_vf.rstb/doc/guides/nics/intel_vf.rstindexade5152595..207f456143100644doc/guides/nics/intel_vf.rst +0
-0@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communicationdoc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 627
Quoted 10 lines
doc/guides/nics/intel_vf.rst +10
-0+ + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect systemperformance.
doc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 629
Quoted 2 lines
doc/guides/nics/intel_vf.rst +2
-0+ +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``)There is no '
CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC' anymore, this is from make days naming.Instead, what do you think not adding the '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' to the 'rte_config.h', but document how this flag can be provided by meson during
build:
meson -Dc_args="-DRTE_LIBRTE_IAVF_16BYTE_RX_DESC"
Quoted 5 lines
And we should plan for long term to convert this compile time flag to runtime devargs.
What do you think?
Sorry, I miss this comment. And, I agree on. Too more compile time flag is not friendly to use. Do you agree to do the runtime devargs on next separate patch set?
Quoted 14 lines
doc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 631
Quoted 2 lines
doc/guides/nics/intel_vf.rst +2
-0+ + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32byte.
Quoted 11 lines
doc/guides/nics/intel_vf.rst +2
-0+ Configure to 16-byte Rx descriptor may cause a negotiation failure + during VF driver initialization if the PF driver doesn't support.doc/guides/rel_notes/release_20_11.rst +0
-0@@ -160,6 +160,12 @@ New Features packets with specified ratio, and apply with own set of actions with a fate action. When the ratio is set to 1 then the packets will be 100% mirrored.
Quoted 15 lines
doc/guides/rel_notes/release_20_11.rst New Features · line 168
Quoted 6 lines
doc/guides/rel_notes/release_20_11.rst +6
-0+* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. +Can you please move the update to the net drivers block, instead of very bottom.
There is an order in the release notes (as commented in section header) like:
- core libs
- ethdev lib related changes
- ethdev PMDS change
- ...
Sure, will update it in v10.
Quoted 19 lines
<...>
doc/guides/rel_notes/release_20_11.rst
Quoted 12 lines
doc/guides/rel_notes/release_20_11.rst +12
-0+ +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask;As a namespace previously "
rte_pmd_xxx" was used for PMD specific APIs, can you please switch to that?
'rte_net_' is used by the 'librte_net' library.
Make sense.
Quoted 11 lines
Above list is the dynfield values, what is the correct usage for dynfields, 1- Put dynfileds names in to the header, and application does a lookup ('
rte_mbuf_dynfield_lookup()') to get the dynfield values.
or
2- Expose dynfield values to be accessed directly from application, as done above.@Oliver, can you please support.
I can see (1) has advantage of portability if more than one PMD supports same dynfield names, but that sees not a case for above ones.
Quoted 116 lines · Jia
Quoted 116 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Wednesday, October 14, 2020 8:32 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Olivier Matz <[email protected]>
Subject: Re: [PATCH v8] net/iavf: support flex desc metadata extractionQuoted 4 lines · Jeff Guo
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
Quoted 49 lines
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-)create mode 100644
drivers/net/iavf/rte_pmd_iavf.hconfig/rte_config.h index renamed from config/rte_config.h +0
-0
03d90d78bc..2c53072c3d100644config/rte_config.h line 132
Quoted 6 lines
config/rte_config.h +3
-0@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +#undef RTE_LIBRTE_IAVF_16BYTE_RX_DESC +Hi Jeff,
The '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' was already there, not introduced with this patch, so I think better to add this change as different patch.Also not sure if we want to add more config options to the '
rte_config.h', indeed otherway around and we are trying to get rid of as much as compile time optios.
cc'ed Bruce too.Quoted 11 lines
config/rte_config.h +0
-0/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16 diff --git
a/doc/guides/nics/intel_vf.rstb/doc/guides/nics/intel_vf.rstindexade5152595..207f456143100644doc/guides/nics/intel_vf.rst +0
-0@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communicationdoc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 627
Quoted 10 lines
doc/guides/nics/intel_vf.rst +10
-0+ + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect systemperformance.
doc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 629
Quoted 2 lines
doc/guides/nics/intel_vf.rst +2
-0+ +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``)There is no '
CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC' anymore, this is from make days naming.Instead, what do you think not adding the '
RTE_LIBRTE_IAVF_16BYTE_RX_DESC' to the 'rte_config.h', but document how this flag can be provided by meson during
build:
meson -Dc_args="-DRTE_LIBRTE_IAVF_16BYTE_RX_DESC"
Quoted 8 lines
Quoted 5 lines
And we should plan for long term to convert this compile time flag to runtime devargs.
What do you think?
Sorry, I miss this comment. And, I agree on. Too more compile time flag is not friendly to use. Do you agree to do the runtime devargs on next separate patch set?
Sure, OK to have it as separate patchset.
Quoted 65 lines
Quoted 14 lines
doc/guides/nics/intel_vf.rst which belongs to the destination VF on the VM. · line 631
Quoted 2 lines
doc/guides/nics/intel_vf.rst +2
-0+ + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32byte.
Quoted 11 lines
doc/guides/nics/intel_vf.rst +2
-0+ Configure to 16-byte Rx descriptor may cause a negotiation failure + during VF driver initialization if the PF driver doesn't support.doc/guides/rel_notes/release_20_11.rst +0
-0@@ -160,6 +160,12 @@ New Features packets with specified ratio, and apply with own set of actions with a fate action. When the ratio is set to 1 then the packets will be 100% mirrored.Quoted 15 lines
doc/guides/rel_notes/release_20_11.rst New Features · line 168
Quoted 6 lines
doc/guides/rel_notes/release_20_11.rst +6
-0+* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. +Can you please move the update to the net drivers block, instead of very bottom.
There is an order in the release notes (as commented in section header) like:
- core libs
- ethdev lib related changes
- ethdev PMDS change
- ...Sure, will update it in v10.
Quoted 19 lines
<...>
doc/guides/rel_notes/release_20_11.rst
Quoted 12 lines
doc/guides/rel_notes/release_20_11.rst +12
-0+ +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask;As a namespace previously "
rte_pmd_xxx" was used for PMD specific APIs, can you please switch to that?
'rte_net_' is used by the 'librte_net' library.Make sense.
Quoted 11 lines
Above list is the dynfield values, what is the correct usage for dynfields, 1- Put dynfileds names in to the header, and application does a lookup ('
rte_mbuf_dynfield_lookup()') to get the dynfield values.
or
2- Expose dynfield values to be accessed directly from application, as done above.@Oliver, can you please support.
I can see (1) has advantage of portability if more than one PMD supports same dynfield names, but that sees not a case for above ones.
Hi,
Quoted 11 lines · Ferruh Yigit
Quoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>
[...]
Quoted 22 lines
drivers/net/iavf/rte_pmd_iavf_version.map line 15
Quoted 11 lines
drivers/net/iavf/rte_pmd_iavf_version.map +11
-0+EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask;As a namespace previously "
rte_pmd_xxx" was used for PMD specific APIs, can you please switch to that?
'rte_net_' is used by the 'librte_net' library.Above list is the dynfield values, what is the correct usage for dynfields, 1- Put dynfileds names in to the header, and application does a lookup ('
rte_mbuf_dynfield_lookup()') to get the dynfield values.
or
2- Expose dynfield values to be accessed directly from application, as done above.
Quoted 4 lines
@Oliver, can you please support.
I can see (1) has advantage of portability if more than one PMD supports same dynfield names, but that sees not a case for above ones.
If I understand the question correctly, this is the same that was discussed here:
http://inbox.dpdk.org/dev/20191030165626.w3flq5wdpitpsv2v@platinum/
To me, exporting the variables containing the dynfield offsets is easier to use: we don't need to have additional private variables to store them in each API users (usually one static variable per file, which can be heavy).
Olivier
Hi Olivier,
Quoted 56 lines
-----Original Message-----
From: Olivier Matz <[email protected]>
Sent: Monday, October 26, 2020 17:37
To: Yigit, Ferruh <[email protected]>
Cc: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v8] net/iavf: support flex desc metadata extractionHi,
Quoted 11 lines · Ferruh Yigit
Quoted 10 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>[...]
Quoted 22 lines
drivers/net/iavf/rte_pmd_iavf_version.map line 15
Quoted 11 lines
drivers/net/iavf/rte_pmd_iavf_version.map +11
-0+EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask;As a namespace previously "
rte_pmd_xxx" was used for PMD specific APIs, can you please switch to that?
'rte_net_' is used by the 'librte_net' library.Above list is the dynfield values, what is the correct usage for dynfields, 1- Put dynfileds names in to the header, and application does a lookup ('
rte_mbuf_dynfield_lookup()') to get the dynfield values.
or
2- Expose dynfield values to be accessed directly from application, as done above.Quoted 4 lines
@Oliver, can you please support.
I can see (1) has advantage of portability if more than one PMD supports same dynfield names, but that sees not a case for above ones.
If I understand the question correctly, this is the same that was discussed here:
Quoted 6 lines
http://inbox.dpdk.org/dev/20191030165626.w3flq5wdpitpsv2v@platinum/
To me, exporting the variables containing the dynfield offsets is easier to use: we don't need to have additional private variables to store them in each API users (usually one static variable per file, which can be heavy).
No issue for one PMD, but if two PMDs share the same dynfields, the application has to use two namespace variables to access the same value, like:
if (mb->ol_flags & PMD_A_DYNFIELD_B_MASK)
else if (mb->ol_flags & PMD_B_DYNFIELD_B_MASK)
This make the application code a little duplicated. ;-)
Quoted 2 lines
Olivier
PATCH v9 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v9:
change the undef config
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- config/rte_config.h | 3 + doc/guides/nics/intel_vf.rst | 16 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 ++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 168 +++++---- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 ++++++++++++++ drivers/net/iavf/rte_pmd_iavf_version.map | 13 + 12 files changed, 1039 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
config/rte_config.h +3 -0
@@ -127,6 +127,9 @@#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 +/* iavf defines */ +// RTE_LIBRTE_IAVF_16BYTE_RX_DESC is not set +/* Ring net PMD settings */ #define RTE_PMD_RING_MAX_RX_RINGS 16#define RTE_PMD_RING_MAX_TX_RINGS 16
doc/guides/nics/intel_vf.rst +16 -0
@@ -615,3 +615,19 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file. +Please note that enabling debugging options may affect system performance. + +- ``CONFIG_RTE_LIBRTE_IAVF_16BYTE_RX_DESC`` (default ``n``) + + Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. + Configure to 16-byte Rx descriptor may cause a negotiation failure during VF driver initialization + if the PF driver doesn't support.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -183,6 +183,12 @@ New Features packets with specified ratio, and apply with own set of actions with a fate action. When the ratio is set to 1 then the packets will be 100% mirrored. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + Removed Items -------------
drivers/net/iavf/iavf.h +23 -1
@@ -119,7 +119,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -153,6 +153,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -166,6 +187,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +97 -71
210 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -648,25 +648,27 @@ iavf_configure_queues(struct iavf_adapter *adapter)#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/rte_pmd_iavf_version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_net_iavf_dynfield_proto_xtr_metadata_offs; + rte_net_iavf_dynflag_proto_xtr_vlan_mask; + rte_net_iavf_dynflag_proto_xtr_ipv4_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_mask; + rte_net_iavf_dynflag_proto_xtr_ipv6_flow_mask; + rte_net_iavf_dynflag_proto_xtr_tcp_mask; + rte_net_iavf_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v10 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v10:
delete the makefile configure and rename the dynamic mbuf name
v9:
change the undef config
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ 9 files changed, 1008 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -190,6 +190,12 @@ New Features Updated the Intel qat driver to use write combining stores. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + * **Updated Memif PMD.** * Added support for abstract socket address.
drivers/net/iavf/iavf.h +23 -1
@@ -133,7 +133,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -169,6 +169,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -182,6 +203,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +98 -71
211 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -850,25 +850,27 @@ iavf_configure_queues(struct iavf_adapter *adapter,#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
Signature · 1 line
2.20.1
Quoted 63 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Tuesday, October 27, 2020 13:05
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v10] net/iavf: support flex desc metadata extractionEnable 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 <[email protected]>---
v10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ 9 files changed, 1008 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
drivers/net/iavf/meson.build if arch_subdir == 'x86' · line 39
Quoted 5 lines
drivers/net/iavf/meson.build +2
-0@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')
One issue: headers = files('rte_pmd_iavf.h')
Please refer to:
commit 30105f664f8ebbecd878deff7f0733a3f92edd17
Author: David Marchand <[email protected]> Date: Thu Oct 22 09:55:45 2020 +0200
drivers: add headers install helper
A lot of drivers export headers, reproduce the same facility than for libraries.
Others, LGTM.
Quoted 2 lines
--
2.20.1
Quoted 85 lines
-----Original Message-----
From: Wang, Haiyue <[email protected]>
Sent: Tuesday, October 27, 2020 1:22 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>
Subject: RE: [PATCH v10] net/iavf: support flex desc metadata extractionQuoted 10 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Tuesday, October 27, 2020 13:05
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v10] net/iavf: support flex desc metadata extractionQuoted 4 lines
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
Quoted 50 lines
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 <[email protected]>---
v10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ 9 files changed, 1008 insertions(+), 114 deletions(-) create mode100644
drivers/net/iavf/rte_pmd_iavf.hdrivers/net/iavf/meson.build if arch_subdir == 'x86' · line 39
Quoted 5 lines
drivers/net/iavf/meson.build +2
-0@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')One issue: headers =
files('rte_pmd_iavf.h')Please refer to:
Quoted 9 lines
commit
30105f664f8ebbecd878deff7f0733a3f92edd17Author: David Marchand <[email protected]> Date: Thu Oct 22 09:55:45 2020 +0200drivers: add headers install helper
A lot of drivers export headers, reproduce the same facility than for libraries.
Oh, thank for your notify, will update it later.
Quoted 8 lines
Others, LGTM.
Acked-by Haiyue Wang <[email protected]>Quoted 2 lines
--
2.20.1
Zhang, Qi Z
AppliedQuoted 73 lines
-----Original Message-----
From: Wang, Haiyue <[email protected]>
Sent: Tuesday, October 27, 2020 1:22 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>
Subject: RE: [PATCH v10] net/iavf: support flex desc metadata extractionQuoted 45 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Tuesday, October 27, 2020 13:05
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v10] net/iavf: support flex desc metadata extractionEnable 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 <[email protected]>---
v10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapQuoted 6 lines
v2:
remove makefile change and modify the rxdid handling--- doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394++++++++++++++++++++++++
Quoted 8 lines
drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ 9 files changed, 1008 insertions(+), 114 deletions(-) create mode100644
drivers/net/iavf/rte_pmd_iavf.h
Quoted 10 lines
drivers/net/iavf/meson.build if arch_subdir == 'x86' · line 39
Quoted 8 lines
drivers/net/iavf/meson.build +2
-0@@ -35,3 +35,5 @@ if arch_subdir == 'x86' objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c') endif endif + +install_headers('rte_pmd_iavf.h')One issue: headers =
files('rte_pmd_iavf.h')
Will fix when apply the patch.
Quoted 9 lines
Please refer to:
commit
30105f664f8ebbecd878deff7f0733a3f92edd17Author: David Marchand <[email protected]> Date: Thu Oct 22 09:55:45 2020 +0200drivers: add headers install helper
Quoted 7 lines
A lot of drivers export headers, reproduce the same facility than for libraries.
Others, LGTM.
Acked-by Haiyue Wang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 1 line
PATCH v11 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v11:
update doc in .map and .rst
v10:
delete the makefile configure and rename the dynamic mbuf name
v9:
change the undef config
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/nics/intel_vf.rst | 122 ++++++++ doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ drivers/net/iavf/version.map | 13 + 11 files changed, 1143 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/nics/intel_vf.rst +122 -0
@@ -606,3 +606,125 @@ which belongs to the destination VF on the VM. .. figure:: img/inter_vm_comms.* Inter-VM Communication + + +Pre-Installation Configuration +------------------------------ + +Runtime Config Options +~~~~~~~~~~~~~~~~~~~~~~ + +- ``Protocol extraction for per queue`` + + Configure the RX queues to do protocol extraction into mbuf for protocol + handling acceleration, like checking the TCP SYN packets quickly. + + The argument format is:: + + -w 18:00.0,proto_xtr=<queues:protocol>[<queues:protocol>...] + -w 18:00.0,proto_xtr=<protocol> + + Queues are grouped by ``(`` and ``)`` within the group. The ``-`` character + is used as a range separator and ``,`` is used as a single number separator. + The grouping ``()`` can be omitted for single element group. If no queues are + specified, PMD will use this protocol extraction type for all queues. + + Protocol is : ``vlan, ipv4, ipv6, ipv6_flow, tcp, ip_offset``. + + .. code-block:: console + + dpdk-testpmd -w 18:00.0,proto_xtr='[(1,2-3,8-9):tcp,10-13:vlan]' + + This setting means queues 1, 2-3, 8-9 are TCP extraction, queues 10-13 are + VLAN extraction, other queues run with no protocol extraction. + + .. code-block:: console + + dpdk-testpmd -w 18:00.0,proto_xtr=vlan,proto_xtr='[(1,2-3,8-9):tcp,10-23:ipv6]' + + This setting means queues 1, 2-3, 8-9 are TCP extraction, queues 10-23 are + IPv6 extraction, other queues use the default VLAN extraction. + + The extraction metadata is copied into the registered dynamic mbuf field, and + the related dynamic mbuf flags is set. + + .. table:: Protocol extraction : ``vlan`` + + +----------------------------+----------------------------+ + | VLAN2 | VLAN1 | + +======+===+=================+======+===+=================+ + | PCP | D | VID | PCP | D | VID | + +------+---+-----------------+------+---+-----------------+ + + VLAN1 - single or EVLAN (first for QinQ). + + VLAN2 - C-VLAN (second for QinQ). + + .. table:: Protocol extraction : ``ipv4`` + + +----------------------------+----------------------------+ + | IPHDR2 | IPHDR1 | + +======+=======+=============+==============+=============+ + | Ver |Hdr Len| ToS | TTL | Protocol | + +------+-------+-------------+--------------+-------------+ + + IPHDR1 - IPv4 header word 4, "TTL" and "Protocol" fields. + + IPHDR2 - IPv4 header word 0, "Ver", "Hdr Len" and "Type of Service" fields. + + .. table:: Protocol extraction : ``ipv6`` + + +----------------------------+----------------------------+ + | IPHDR2 | IPHDR1 | + +=====+=============+========+=============+==============+ + | Ver |Traffic class| Flow | Next Header | Hop Limit | + +-----+-------------+--------+-------------+--------------+ + + IPHDR1 - IPv6 header word 3, "Next Header" and "Hop Limit" fields. + + IPHDR2 - IPv6 header word 0, "Ver", "Traffic class" and high 4 bits of + "Flow Label" fields. + + .. table:: Protocol extraction : ``ipv6_flow`` + + +----------------------------+----------------------------+ + | IPHDR2 | IPHDR1 | + +=====+=============+========+============================+ + | Ver |Traffic class| Flow Label | + +-----+-------------+-------------------------------------+ + + IPHDR1 - IPv6 header word 1, 16 low bits of the "Flow Label" field. + + IPHDR2 - IPv6 header word 0, "Ver", "Traffic class" and high 4 bits of + "Flow Label" fields. + + .. table:: Protocol extraction : ``tcp`` + + +----------------------------+----------------------------+ + | TCPHDR2 | TCPHDR1 | + +============================+======+======+==============+ + | Reserved |Offset| RSV | Flags | + +----------------------------+------+------+--------------+ + + TCPHDR1 - TCP header word 6, "Data Offset" and "Flags" fields. + + TCPHDR2 - Reserved + + .. table:: Protocol extraction : ``ip_offset`` + + +----------------------------+----------------------------+ + | IPHDR2 | IPHDR1 | + +============================+============================+ + | IPv6 HDR Offset | IPv4 HDR Offset | + +----------------------------+----------------------------+ + + IPHDR1 - Outer/Single IPv4 Header offset. + + IPHDR2 - Outer/Single IPv6 Header offset. + + Use ``rte_pmd_ifd_dynf_proto_xtr_metadata_get`` to access the protocol + extraction metadata, and use ``RTE_PKT_RX_DYNF_PROTO_XTR_*`` to get the + metadata type of ``struct rte_mbuf::ol_flags``. + + The ``rte_pmd_ifd_dump_proto_xtr_metadata`` routine shows how to + access the protocol extraction result in ``struct rte_mbuf``.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -205,6 +205,12 @@ New Features Updated the Intel qat driver to use write combining stores. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + * **Updated Memif PMD.** * Added support for abstract socket address.
drivers/net/iavf/iavf.h +23 -1
@@ -133,7 +133,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -169,6 +169,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -182,6 +203,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +98 -71
211 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -850,25 +850,27 @@ iavf_configure_queues(struct iavf_adapter *adapter,#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -55,3 +55,5 @@ if arch_subdir == 'x86' objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif + +headers = files('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_pmd_ifd_dynfield_proto_xtr_metadata_offs; + rte_pmd_ifd_dynflag_proto_xtr_vlan_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask; + rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; + rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v12 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v12:
refine doc to be briefly
v11:
update doc in .map and .rst
v10:
delete the makefile configure and rename the dynamic mbuf name
v9:
change the undef config
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/nics/intel_vf.rst | 4 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ drivers/net/iavf/version.map | 13 + 11 files changed, 1025 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/nics/intel_vf.rst +4 -0
@@ -87,6 +87,10 @@ For more detail on SR-IOV, please refer to the following documents: To use DPDK IAVF PMD on Intel® 700 Series Ethernet Controller, the device id (0x1889) need to specified during device assignment in hypervisor. Take qemu for example, the device assignment should carry the IAVF device id (0x1889) like ``-device vfio-pci,x-pci-device-id=0x1889,host=03:0a.0``. + + When IAVF is backed by an Intel® E810 device, the "Protocol Extraction" feature which is supported by ice PMD is also + available for IAVF PMD. The same devargs with the same parameters can be applied to IAVF PMD, for detail please reference + the section ``Protocol extraction for per queue`` of ice.rst. The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -205,6 +205,12 @@ New Features Updated the Intel qat driver to use write combining stores. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + * **Updated Memif PMD.** * Added support for abstract socket address.
drivers/net/iavf/iavf.h +23 -1
@@ -133,7 +133,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -169,6 +169,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -182,6 +203,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +98 -71
211 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -850,25 +850,27 @@ iavf_configure_queues(struct iavf_adapter *adapter,#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -55,3 +55,5 @@ if arch_subdir == 'x86' objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif + +headers = files('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_pmd_ifd_dynfield_proto_xtr_metadata_offs; + rte_pmd_ifd_dynflag_proto_xtr_vlan_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask; + rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; + rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
PATCH v12 1/1 net/iavf: support flex desc metadata extraction
In reply to Jeff GuoEnable 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.
---
v12:
refine doc to be briefly
v11:
update doc in .map and .rst
v10:
delete the makefile configure and rename the dynamic mbuf name
v9:
change the undef config
v8:
rebase patch for apply issue
v7:
clean some useless and add doc
v6:
rebase patch
v5:
remove ovs configure since ovs is not protocol extraction
v4:
add flex desc type in rx queue for handling vector path handle ovs flex type
v3:
export these global symbols into .map
v2:
remove makefile change and modify the rxdid handling
--- doc/guides/nics/intel_vf.rst | 4 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++ drivers/net/iavf/version.map | 13 + 11 files changed, 1025 insertions(+), 114 deletions(-) create mode 100644 drivers/net/iavf/rte_pmd_iavf.h
doc/guides/nics/intel_vf.rst +4 -0
@@ -88,6 +88,10 @@ For more detail on SR-IOV, please refer to the following documents: assignment in hypervisor. Take qemu for example, the device assignment should carry the IAVF device id (0x1889) like ``-device vfio-pci,x-pci-device-id=0x1889,host=03:0a.0``. + When IAVF is backed by an Intel® E810 device, the "Protocol Extraction" feature which is supported by ice PMD is also + available for IAVF PMD. The same devargs with the same parameters can be applied to IAVF PMD, for detail please reference + the section ``Protocol extraction for per queue`` of ice.rst. + The PCIE host-interface of Intel Ethernet Switch FM10000 Series VF infrastructure ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -205,6 +205,12 @@ New Features Updated the Intel qat driver to use write combining stores. +* **Updated Intel iavf driver.** + + Updated iavf PMD with new features and improvements, including: + + * Added support for flexible descriptor metadata extraction. + * **Updated Memif PMD.** * Added support for abstract socket address.
drivers/net/iavf/iavf.h +23 -1
@@ -133,7 +133,7 @@ struct iavf_info {struct virtchnl_vf_resource *vf_res;/* VF resource */ struct virtchnl_vsi_resource *vsi_res;/* LAN VSI */ uint64_t supported_rxdid; - +uint8_t *proto_xtr;/* proto xtr type for all queues */ volatile enum virtchnl_ops pend_cmd;/* pending command not finished */ uint32_t cmd_retval;/* return value of the cmd response from PF */ uint8_t *aq_resp;/* buffer to store the adminq response from PF */
@@ -169,6 +169,27 @@ struct iavf_info {#define IAVF_MAX_PKT_TYPE 1024 +#define IAVF_MAX_QUEUE_NUM 2048 + +enum iavf_proto_xtr_type { +IAVF_PROTO_XTR_NONE , +IAVF_PROTO_XTR_VLAN , +IAVF_PROTO_XTR_IPV4 , +IAVF_PROTO_XTR_IPV6 , +IAVF_PROTO_XTR_IPV6_FLOW , +IAVF_PROTO_XTR_TCP , +IAVF_PROTO_XTR_IP_OFFSET , +IAVF_PROTO_XTR_MAX , +}; + +/** +* Cache devargs parse result. +*/ +struct iavf_devargs { +uint8_t proto_xtr_dflt; +uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM ]; +}; +/* Structure to store private data for each VF instance. */ struct iavf_adapter {struct iavf_hw hw;
@@ -182,6 +203,7 @@ struct iavf_adapter {const uint32_t *ptype_tbl;bool stopped;uint16_t fdir_ref_cnt; +struct iavf_devargs devargs; };/* IAVF_DEV_PRIVATE_TO */
drivers/net/iavf/iavf_ethdev.c +394 -0
418 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.c +220 -32
328 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx.h +98 -71
211 lines not on this page · raw message
drivers/net/iavf/iavf_rxtx_vec_common.h +3 -0
@@ -224,6 +224,9 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)if (rxq->nb_rx_desc % rxq->rx_free_thresh)return -1 ; +if (rxq->proto_xtr !=IAVF_PROTO_XTR_NONE ) +return -1 ; +return 0 ; }
drivers/net/iavf/iavf_vchnl.c +12 -10
@@ -850,25 +850,27 @@ iavf_configure_queues(struct iavf_adapter *adapter,#ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && - vf->supported_rxdid &BIT (IAVF_RXDID_COMMS_OVS_1 )) { - vc_qp->rxq.rxdid =IAVF_RXDID_COMMS_OVS_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + vf->supported_rxdid &BIT (rxq[i]->rxdid)) { + vc_qp->rxq.rxdid = rxq[i]->rxdid; +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { +PMD_DRV_LOG (NOTICE ,"RXDID[%d] is not supported, " +"request default RXDID[%d] in Queue[%d]" , + rxq[i]->rxdid,IAVF_RXDID_LEGACY_1 , i); vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_1 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); }#else if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && vf->supported_rxdid &BIT (IAVF_RXDID_LEGACY_0 )) { vc_qp->rxq.rxdid =IAVF_RXDID_LEGACY_0 ; -PMD_DRV_LOG (NOTICE ,"request RXDID == %d in " -"Queue[%d]" , vc_qp->rxq.rxdid, i); +PMD_DRV_LOG (NOTICE ,"request RXDID[%d] in Queue[%d]" , + vc_qp->rxq.rxdid, i); }else { -PMD_DRV_LOG (ERR ,"RXDID == 0 is not supported" ); +PMD_DRV_LOG (ERR ,"RXDID[%d] is not supported" , +IAVF_RXDID_LEGACY_0 );return -1 ; }#endif
drivers/net/iavf/meson.build +2 -0
@@ -55,3 +55,5 @@ if arch_subdir == 'x86' objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif + +headers = files('rte_pmd_iavf.h')
drivers/net/iavf/rte_pmd_iavf.h new file +250 -0
250 lines not on this page · raw message
drivers/net/iavf/version.map +13 -0
@@ -1,3 +1,16 @@ DPDK_21 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 20.11 + rte_pmd_ifd_dynfield_proto_xtr_metadata_offs; + rte_pmd_ifd_dynflag_proto_xtr_vlan_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask; + rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask; + rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; + rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; +};
Signature · 1 line
2.20.1
Zhang, Qi Z
AppliedQuoted 18 lines
-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Friday, October 30, 2020 4:41 PM
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v12] net/iavf: support flex desc metadata extractionEnable 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.
Quoted 2 lines
Signed-off-by Jeff Guo <[email protected]>Acked-by Haiyue Wang <[email protected]>
Applied to dpdk-next-net-intel after revert v10
Thanks
Qi
Quoted 44 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v12:
refine doc to be brieflyv11:
update doc in .map and .rstv10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapv2:
remove makefile change and modify the rxdid handling
Quoted 11 lines
--- doc/guides/nics/intel_vf.rst | 4 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394 ++++++++++++++++++++++++ drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++
We should add this public header to the API documentation, if that is the only change I can do while merging. Something like:
diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index a9c12d1a2f..36f8ed7ba8 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -41,6 +41,7 @@ The public API headers are grouped by topics:
[vhost] (@ref rte_vhost.h),
[vdpa] (@ref rte_vdpa.h),
[KNI] (@ref rte_kni.h),
+ [iavf] (@ref rte_pmd_iavf.h),
[ixgbe] (@ref rte_pmd_ixgbe.h),
[i40e] (@ref rte_pmd_i40e.h),
[ice] (@ref rte_pmd_ice.h),Quoted 69 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, October 30, 2020 6:52 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v12] net/iavf: support flex desc metadata extractionQuoted 42 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v12:
refine doc to be brieflyv11:
update doc in .map and .rstv10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapQuoted 7 lines
v2:
remove makefile change and modify the rxdid handling--- doc/guides/nics/intel_vf.rst | 4 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394++++++++++++++++++++++++
Quoted 6 lines
drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++
Quoted 2 lines
We should add this public header to the API documentation, if that is the only change I can do while merging. Something like:
Yes, it think this is the only change, thanks.
Quoted 12 lines
diff --git
a/doc/api/doxy-api-index.mdb/doc/api/doxy-api-index.mdindexa9c12d1a2f..36f8ed7ba8100644
---a/doc/api/doxy-api-index.md
+++b/doc/api/doxy-api-index.md
@@ -41,6 +41,7 @@ The public API headers are grouped by topics:[vhost] (@ref rte_vhost.h), [vdpa] (@ref rte_vdpa.h), [KNI] (@ref rte_kni.h), + [iavf] (@ref rte_pmd_iavf.h), [ixgbe] (@ref rte_pmd_ixgbe.h), [i40e] (@ref rte_pmd_i40e.h), [ice] (@ref rte_pmd_ice.h),
Quoted 69 lines · Qi Z
Quoted 69 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, October 30, 2020 6:52 PM
To: Guo, Jia <[email protected]>; Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v12] net/iavf: support flex desc metadata extractionQuoted 42 lines · Jeff Guo
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 <[email protected]>Acked-by Haiyue Wang <[email protected]>---
v12:
refine doc to be brieflyv11:
update doc in .map and .rstv10:
delete the makefile configure and rename the dynamic mbuf namev9:
change the undef configv8:
rebase patch for apply issuev7:
clean some useless and add docv6:
rebase patchv5:
remove ovs configure since ovs is not protocol extractionv4:
add flex desc type in rx queue for handling vector path handle ovs flex typev3:
export these global symbols into .mapQuoted 7 lines
v2:
remove makefile change and modify the rxdid handling--- doc/guides/nics/intel_vf.rst | 4 + doc/guides/rel_notes/release_20_11.rst | 6 + drivers/net/iavf/iavf.h | 24 +- drivers/net/iavf/iavf_ethdev.c | 394++++++++++++++++++++++++
Quoted 6 lines
drivers/net/iavf/iavf_rxtx.c | 252 +++++++++++++-- drivers/net/iavf/iavf_rxtx.h | 169 +++++----- drivers/net/iavf/iavf_rxtx_vec_common.h | 3 + drivers/net/iavf/iavf_vchnl.c | 22 +- drivers/net/iavf/meson.build | 2 + drivers/net/iavf/rte_pmd_iavf.h | 250 +++++++++++++++
Quoted 5 lines
Quoted 2 lines
We should add this public header to the API documentation, if that is the only change I can do while merging. Something like:
Yes, it think this is the only change, thanks.
Added following while merging:
diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index c629b5fea9..9c9899c45a 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -44,6 +44,7 @@ The public API headers are grouped by topics:
[ixgbe] (@ref rte_pmd_ixgbe.h),
[i40e] (@ref rte_pmd_i40e.h),
[ice] (@ref rte_pmd_ice.h),
+ [iavf] (@ref rte_pmd_iavf.h),
[ioat] (@ref rte_ioat_rawdev.h),
[bnxt] (@ref rte_pmd_bnxt.h),
[dpaa] (@ref rte_pmd_dpaa.h),
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 567fe62f8f..6eeabba9e1 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -13,6 +13,7 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \
@TOPDIR@/drivers/net/dpaa \
@TOPDIR@/drivers/net/dpaa2 \
@TOPDIR@/drivers/net/i40e \
+ @TOPDIR@/drivers/net/iavf \
@TOPDIR@/drivers/net/ice \
@TOPDIR@/drivers/net/ixgbe \
@TOPDIR@/drivers/net/mlx5 \