From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D599AA04B5; Mon, 26 Oct 2020 08:03:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35BEB1E2B; Mon, 26 Oct 2020 08:03:12 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF8ED100C for ; Mon, 26 Oct 2020 08:03:09 +0100 (CET) IronPort-SDR: BXuQSf0VHzHgQZA3ZKs3L6AUDjwhrjncLqj9uByrXiz/gQvPhwA9LaSwlzcmAs0nHU+GZBPsxk dRmTqTxXlrhw== X-IronPort-AV: E=McAfee;i="6000,8403,9785"; a="167102993" X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="167102993" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 00:03:06 -0700 IronPort-SDR: 0mcRwBZU7Zdw99fAfZzg3nf6utmCV7676j/tLFRzZRrof1cAYNCMBjoWZfjcGFlnJrwViLVivA U3AKpG861wgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="525401507" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.151]) by fmsmga005.fm.intel.com with ESMTP; 26 Oct 2020 00:03:03 -0700 From: Haiyue Wang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, jia.guo@intel.com, qi.z.zhang@intel.com, zhaoyan.chen@intel.com, Haiyue Wang , Qiming Yang , Ray Kinsella , Neil Horman Date: Mon, 26 Oct 2020 14:50:01 +0800 Message-Id: <20201026065001.632139-1-haiyue.wang@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20201025071352.221953-1-haiyue.wang@intel.com> References: <20201025071352.221953-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/ice: refactor the protocol extraction design X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Change the protocol extraction dynamic mbuf usage from regiser API to lookup API, so the application can decide to read the metadata or not at the run time, in other words, PMD will check this at Rx queue start time. This design makes the API simple now: it just needs to export the name string, not the whole dynamic mbuf data objects. Signed-off-by: Haiyue Wang --- v2: update the commit message, doc; and add the error handling for dynamic mbuf lookup. Also keep the metadata format defination. --- doc/guides/nics/ice.rst | 16 ++-- drivers/net/ice/ice_ethdev.c | 117 +++++------------------ drivers/net/ice/ice_ethdev.h | 1 + drivers/net/ice/ice_rxtx.c | 62 ++++++++---- drivers/net/ice/ice_rxtx.h | 1 + drivers/net/ice/rte_pmd_ice.h | 171 +++++++--------------------------- drivers/net/ice/version.map | 13 --- 7 files changed, 106 insertions(+), 275 deletions(-) diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst index a2aea12333..9878b665b3 100644 --- a/doc/guides/nics/ice.rst +++ b/doc/guides/nics/ice.rst @@ -156,19 +156,17 @@ Runtime Config Options +----------------------------+----------------------------+ | IPHDR2 | IPHDR1 | +============================+============================+ - | IPv6 HDR Offset | IPv4 HDR Offset | + | Reserved | IP Header Offset | +----------------------------+----------------------------+ - IPHDR1 - Outer/Single IPv4 Header offset. + IPHDR1 - Outer/Single IPv4/IPv6 Header offset. - IPHDR2 - Outer/Single IPv6 Header offset. + IPHDR2 - Reserved. - Use ``rte_net_ice_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_net_ice_dump_proto_xtr_metadata`` routine shows how to - access the protocol extraction result in ``struct rte_mbuf``. + The dynamic mbuf field for metadata uses "rte_pmd_dynfield_proto_xtr_metadata" + name with 4 byte size. And the related dynamic mbuf flag uses the name format + "rte_pmd_dynflag_proto_xtr_*" which ends with the protocol extraction devargs + name such as "ip_offset". Driver compilation and testing ------------------------------ diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 51b99c6506..9e7d71ae4d 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -32,42 +32,6 @@ static const char * const ice_valid_args[] = { NULL }; -static const struct rte_mbuf_dynfield ice_proto_xtr_metadata_param = { - .name = "ice_dynfield_proto_xtr_metadata", - .size = sizeof(uint32_t), - .align = __alignof__(uint32_t), - .flags = 0, -}; - -struct proto_xtr_ol_flag { - const struct rte_mbuf_dynflag param; - uint64_t *ol_flag; - bool required; -}; - -static bool ice_proto_xtr_hw_support[PROTO_XTR_MAX]; - -static struct proto_xtr_ol_flag ice_proto_xtr_ol_flag_params[] = { - [PROTO_XTR_VLAN] = { - .param = { .name = "ice_dynflag_proto_xtr_vlan" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_vlan_mask }, - [PROTO_XTR_IPV4] = { - .param = { .name = "ice_dynflag_proto_xtr_ipv4" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_ipv4_mask }, - [PROTO_XTR_IPV6] = { - .param = { .name = "ice_dynflag_proto_xtr_ipv6" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_ipv6_mask }, - [PROTO_XTR_IPV6_FLOW] = { - .param = { .name = "ice_dynflag_proto_xtr_ipv6_flow" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask }, - [PROTO_XTR_TCP] = { - .param = { .name = "ice_dynflag_proto_xtr_tcp" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_tcp_mask }, - [PROTO_XTR_IP_OFFSET] = { - .param = { .name = "ice_dynflag_proto_xtr_ip_offset" }, - .ol_flag = &rte_net_ice_dynflag_proto_xtr_ip_offset_mask }, -}; - #define ICE_DFLT_OUTER_TAG_TYPE ICE_AQ_VSI_OUTER_TAG_VLAN_9100 #define ICE_OS_DEFAULT_PKG_NAME "ICE OS Default Package" @@ -542,7 +506,7 @@ handle_proto_xtr_arg(__rte_unused const char *key, const char *value, } static void -ice_check_proto_xtr_support(struct ice_hw *hw) +ice_check_proto_xtr_support(struct ice_pf *pf, struct ice_hw *hw) { #define FLX_REG(val, fld, idx) \ (((val) & GLFLXP_RXDID_FLX_WRD_##idx##_##fld##_M) >> \ @@ -587,7 +551,7 @@ ice_check_proto_xtr_support(struct ice_hw *hw) if (FLX_REG(v, PROT_MDID, 4) == xtr_sets[i].protid_0 && FLX_REG(v, RXDID_OPCODE, 4) == xtr_sets[i].opcode) - ice_proto_xtr_hw_support[i] = true; + pf->hw_proto_xtr_ena[i] = 1; } if (xtr_sets[i].protid_1 != ICE_PROT_ID_INVAL) { @@ -595,7 +559,7 @@ ice_check_proto_xtr_support(struct ice_hw *hw) if (FLX_REG(v, PROT_MDID, 5) == xtr_sets[i].protid_1 && FLX_REG(v, RXDID_OPCODE, 5) == xtr_sets[i].opcode) - ice_proto_xtr_hw_support[i] = true; + pf->hw_proto_xtr_ena[i] = 1; } } } @@ -1429,9 +1393,8 @@ ice_init_proto_xtr(struct rte_eth_dev *dev) ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_hw *hw = ICE_PF_TO_HW(pf); - const struct proto_xtr_ol_flag *ol_flag; - bool proto_xtr_enable = false; - int offset; + uint8_t err_msgs[PROTO_XTR_MAX]; + uint8_t proto_xtr_type; uint16_t i; pf->proto_xtr = rte_zmalloc(NULL, pf->lan_nb_qps, 0); @@ -1440,65 +1403,27 @@ ice_init_proto_xtr(struct rte_eth_dev *dev) return; } - for (i = 0; i < pf->lan_nb_qps; i++) { - pf->proto_xtr[i] = ad->devargs.proto_xtr[i] != PROTO_XTR_NONE ? - ad->devargs.proto_xtr[i] : - ad->devargs.proto_xtr_dflt; - - if (pf->proto_xtr[i] != PROTO_XTR_NONE) { - uint8_t type = pf->proto_xtr[i]; - - ice_proto_xtr_ol_flag_params[type].required = true; - proto_xtr_enable = true; - } - } - - if (likely(!proto_xtr_enable)) - return; - - ice_check_proto_xtr_support(hw); - - offset = rte_mbuf_dynfield_register(&ice_proto_xtr_metadata_param); - if (unlikely(offset == -1)) { - PMD_DRV_LOG(ERR, - "Protocol extraction metadata is disabled in mbuf with error %d", - -rte_errno); - return; - } - - PMD_DRV_LOG(DEBUG, - "Protocol extraction metadata offset in mbuf is : %d", - offset); - rte_net_ice_dynfield_proto_xtr_metadata_offs = offset; - - for (i = 0; i < RTE_DIM(ice_proto_xtr_ol_flag_params); i++) { - ol_flag = &ice_proto_xtr_ol_flag_params[i]; - - if (!ol_flag->required) - continue; + ice_check_proto_xtr_support(pf, hw); - if (!ice_proto_xtr_hw_support[i]) { - PMD_DRV_LOG(ERR, - "Protocol extraction type %u is not supported in hardware", - i); - rte_net_ice_dynfield_proto_xtr_metadata_offs = -1; - break; - } + memset(err_msgs, 0, sizeof(err_msgs)); - offset = rte_mbuf_dynflag_register(&ol_flag->param); - if (unlikely(offset == -1)) { - PMD_DRV_LOG(ERR, - "Protocol extraction offload '%s' failed to register with error %d", - ol_flag->param.name, -rte_errno); + for (i = 0; i < pf->lan_nb_qps; i++) { + proto_xtr_type = ad->devargs.proto_xtr[i] != PROTO_XTR_NONE ? + ad->devargs.proto_xtr[i] : + ad->devargs.proto_xtr_dflt; + + if (proto_xtr_type != PROTO_XTR_NONE && + !pf->hw_proto_xtr_ena[proto_xtr_type]) { + if (!err_msgs[proto_xtr_type]) { + PMD_DRV_LOG(ERR, "protocol extraction type %u is not supported in hardware\n", + proto_xtr_type); + err_msgs[proto_xtr_type] = 1; + } - rte_net_ice_dynfield_proto_xtr_metadata_offs = -1; - break; + proto_xtr_type = PROTO_XTR_NONE; } - PMD_DRV_LOG(DEBUG, - "Protocol extraction offload '%s' offset in mbuf is : %d", - ol_flag->param.name, offset); - *ol_flag->ol_flag = 1ULL << offset; + pf->proto_xtr[i] = proto_xtr_type; } } diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index 05218af05e..a675eac209 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -457,6 +457,7 @@ struct ice_pf { uint64_t old_rx_bytes; uint64_t old_tx_bytes; uint64_t supported_rxdid; /* bitmap for supported RXDID */ + uint8_t hw_proto_xtr_ena[PROTO_XTR_MAX]; }; #define ICE_MAX_QUEUE_NUM 2048 diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index f6291894cd..4063aabfeb 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -15,16 +15,8 @@ PKT_TX_TCP_SEG | \ PKT_TX_OUTER_IP_CKSUM) -/* Offset of mbuf dynamic field for protocol extraction data */ -int rte_net_ice_dynfield_proto_xtr_metadata_offs = -1; - -/* Mask of mbuf dynamic flags for protocol extraction type */ -uint64_t rte_net_ice_dynflag_proto_xtr_vlan_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv4_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask; +#define ICE_DYNF_PROTO_XTR_METADATA(m) \ + RTE_MBUF_DYNFIELD((m), rxq->xtr_metadata_off, uint32_t *) static inline uint8_t ice_proto_xtr_type_to_rxdid(uint8_t xtr_type) @@ -104,7 +96,7 @@ ice_rxd_to_pkt_fields_by_comms_aux_v1(struct ice_rx_queue *rxq, if (metadata) { mb->ol_flags |= rxq->xtr_ol_flag; - *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata; + *ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata; } } #endif @@ -142,7 +134,7 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq, if (metadata) { mb->ol_flags |= rxq->xtr_ol_flag; - *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata; + *ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata; } } #endif @@ -151,34 +143,38 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq, static void ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queue *rxq, uint32_t rxdid) { + struct rte_mbuf_dynfield metadata_param; + const char *flag_name = NULL; + int flag_off, metadata_off; + switch (rxdid) { case ICE_RXDID_COMMS_AUX_VLAN: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_vlan_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_VLAN_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV4: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv4_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_IPV4_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV6: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv6_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_IPV6_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV6_FLOW: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_IPV6_FLOW_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_TCP: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_tcp_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_TCP_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IP_OFFSET: - rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ip_offset_mask; + flag_name = RTE_PMD_DYNFLAG_PROTO_XTR_IP_OFFSET_NAME; rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v2; break; @@ -192,8 +188,34 @@ ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queue *rxq, uint32_t rxdid) break; } - if (!rte_net_ice_dynf_proto_xtr_metadata_avail()) - rxq->xtr_ol_flag = 0; + if (!flag_name) + return; + + flag_off = rte_mbuf_dynflag_lookup(flag_name, NULL); + if (flag_off == -1) { + PMD_DRV_LOG(WARNING, "failed to lookup the dynamic flag '%s' for Rx queue %u : %d", + flag_name, rxq->queue_id, -rte_errno); + return; + } + + metadata_off = rte_mbuf_dynfield_lookup + (RTE_PMD_DYNFIELD_PROTO_XTR_METADATA_NAME, + &metadata_param); + if (metadata_off == -1) { + PMD_DRV_LOG(WARNING, "failed to lookup the dynamic field '%s' for Rx queue %u : %d", + RTE_PMD_DYNFIELD_PROTO_XTR_METADATA_NAME, + rxq->queue_id, -rte_errno); + return; + } + if (metadata_param.size != sizeof(uint32_t)) { + PMD_DRV_LOG(WARNING, "the dynamic field '%s' data size is not matched for Rx queue %u", + RTE_PMD_DYNFIELD_PROTO_XTR_METADATA_NAME, + rxq->queue_id); + return; + } + + rxq->xtr_metadata_off = metadata_off; + rxq->xtr_ol_flag = 1ULL << flag_off; } static enum ice_status diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index 23409d479a..53d0a609f3 100644 --- a/drivers/net/ice/ice_rxtx.h +++ b/drivers/net/ice/ice_rxtx.h @@ -85,6 +85,7 @@ struct ice_rx_queue { bool q_set; /* indicate if rx queue has been configured */ bool rx_deferred_start; /* don't start this queue in dev start */ uint8_t proto_xtr; /* Protocol extraction from flexible descriptor */ + int xtr_metadata_off; /* Protocol extraction offload metadata offset */ uint64_t xtr_ol_flag; /* Protocol extraction offload flag */ ice_rxd_to_pkt_fields_t rxd_to_pkt_fields; /* handle FlexiMD by RXDID */ ice_rx_release_mbufs_t rx_rel_mbufs; diff --git a/drivers/net/ice/rte_pmd_ice.h b/drivers/net/ice/rte_pmd_ice.h index 9a436a140b..f7304add40 100644 --- a/drivers/net/ice/rte_pmd_ice.h +++ b/drivers/net/ice/rte_pmd_ice.h @@ -14,18 +14,19 @@ * */ -#include -#include -#include +#include #ifdef __cplusplus extern "C" { #endif +#ifndef __INTEL_RX_FLEX_DESC_METADATA__ +#define __INTEL_RX_FLEX_DESC_METADATA__ + /** * The supported network protocol extraction metadata format. */ -union rte_net_ice_proto_xtr_metadata { +union rte_pmd_proto_xtr_metadata { uint32_t metadata; struct { @@ -82,160 +83,56 @@ union rte_net_ice_proto_xtr_metadata { uint32_t ip_ofs; }; -/* Offset of mbuf dynamic field for protocol extraction data */ -extern int rte_net_ice_dynfield_proto_xtr_metadata_offs; - -/* Mask of mbuf dynamic flags for protocol extraction type */ -extern uint64_t rte_net_ice_dynflag_proto_xtr_vlan_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv4_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask; - -/** - * The mbuf dynamic field pointer for protocol extraction metadata. - */ -#define RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m) \ - RTE_MBUF_DYNFIELD((m), \ - rte_net_ice_dynfield_proto_xtr_metadata_offs, \ - uint32_t *) - /** - * The mbuf dynamic flag for VLAN protocol extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'vlan' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_VLAN \ - (rte_net_ice_dynflag_proto_xtr_vlan_mask) - -/** - * The mbuf dynamic flag for IPv4 protocol extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'ipv4' specified. + * The mbuf dynamic field metadata for protocol extraction from hardware: + * + * a). Extract one word from the defined location of the specified + * protocol in the packet. + * b). Report the offset to the selected protocol type. + * + * And the metadata can hold two of the above defined fields (in word), these + * words are in host endian order. */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV4 \ - (rte_net_ice_dynflag_proto_xtr_ipv4_mask) +#define RTE_PMD_DYNFIELD_PROTO_XTR_METADATA_NAME \ + "rte_pmd_dynfield_proto_xtr_metadata" /** - * The mbuf dynamic flag for IPv6 protocol extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'ipv6' specified. + * The mbuf dynamic flag for VLAN protocol extraction metadata type. */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV6 \ - (rte_net_ice_dynflag_proto_xtr_ipv6_mask) +#define RTE_PMD_DYNFLAG_PROTO_XTR_VLAN_NAME \ + "rte_pmd_dynflag_proto_xtr_vlan" /** - * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata, it is - * valid when dev_args 'proto_xtr' has 'ipv6_flow' specified. + * The mbuf dynamic flag for IPv4 protocol extraction metadata type. */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW \ - (rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask) +#define RTE_PMD_DYNFLAG_PROTO_XTR_IPV4_NAME \ + "rte_pmd_dynflag_proto_xtr_ipv4" /** - * The mbuf dynamic flag for TCP protocol extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'tcp' specified. + * The mbuf dynamic flag for IPv6 protocol extraction metadata type. */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_TCP \ - (rte_net_ice_dynflag_proto_xtr_tcp_mask) +#define RTE_PMD_DYNFLAG_PROTO_XTR_IPV6_NAME \ + "rte_pmd_dynflag_proto_xtr_ipv6" /** - * The mbuf dynamic flag for IP_OFFSET extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'ip_offset' specified. + * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata type. */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET \ - (rte_net_ice_dynflag_proto_xtr_ip_offset_mask) +#define RTE_PMD_DYNFLAG_PROTO_XTR_IPV6_FLOW_NAME \ + "rte_pmd_dynflag_proto_xtr_ipv6_flow" /** - * Check if mbuf dynamic field for protocol extraction metadata is registered. - * - * @return - * True if registered, false otherwise. + * The mbuf dynamic flag for TCP protocol extraction metadata type. */ -__rte_experimental -static __rte_always_inline int -rte_net_ice_dynf_proto_xtr_metadata_avail(void) -{ - return rte_net_ice_dynfield_proto_xtr_metadata_offs != -1; -} +#define RTE_PMD_DYNFLAG_PROTO_XTR_TCP_NAME \ + "rte_pmd_dynflag_proto_xtr_tcp" /** - * Get the mbuf dynamic field for protocol extraction metadata. - * - * @param m - * The pointer to the mbuf. - * @return - * The saved protocol extraction metadata. + * The mbuf dynamic flag for IPv4 or IPv6 header offset report metadata type. */ -__rte_experimental -static __rte_always_inline uint32_t -rte_net_ice_dynf_proto_xtr_metadata_get(struct rte_mbuf *m) -{ - return *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m); -} +#define RTE_PMD_DYNFLAG_PROTO_XTR_IP_OFFSET_NAME \ + "rte_pmd_dynflag_proto_xtr_ip_offset" -/** - * Dump the mbuf dynamic field for protocol extraction metadata. - * - * @param m - * The pointer to the mbuf. - */ -__rte_experimental -static inline void -rte_net_ice_dump_proto_xtr_metadata(struct rte_mbuf *m) -{ - union rte_net_ice_proto_xtr_metadata data; - - if (!rte_net_ice_dynf_proto_xtr_metadata_avail()) - return; - - data.metadata = rte_net_ice_dynf_proto_xtr_metadata_get(m); - - if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_VLAN) - printf(" - Protocol Extraction:[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_PKT_RX_DYNF_PROTO_XTR_IPV4) - printf(" - Protocol Extraction:[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_PKT_RX_DYNF_PROTO_XTR_IPV6) - printf(" - Protocol Extraction:[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_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW) - printf(" - Protocol Extraction:[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_PKT_RX_DYNF_PROTO_XTR_TCP) - printf(" - Protocol Extraction:[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_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET) - printf(" - Protocol Offset:ip_offset=%u", - data.ip_ofs); -} +#endif /* __INTEL_RX_FLEX_DESC_METADATA__ */ #ifdef __cplusplus } diff --git a/drivers/net/ice/version.map b/drivers/net/ice/version.map index 632a296a0c..4a76d1d52d 100644 --- a/drivers/net/ice/version.map +++ b/drivers/net/ice/version.map @@ -1,16 +1,3 @@ DPDK_21 { local: *; }; - -EXPERIMENTAL { - global: - - # added in 19.11 - rte_net_ice_dynfield_proto_xtr_metadata_offs; - rte_net_ice_dynflag_proto_xtr_vlan_mask; - rte_net_ice_dynflag_proto_xtr_ipv4_mask; - rte_net_ice_dynflag_proto_xtr_ipv6_mask; - rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; - rte_net_ice_dynflag_proto_xtr_tcp_mask; - rte_net_ice_dynflag_proto_xtr_ip_offset_mask; -}; -- 2.29.0