get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/62408/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 62408,
    "url": "https://patches.dpdk.org/api/patches/62408/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191105012618.85170-1-haiyue.wang@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20191105012618.85170-1-haiyue.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191105012618.85170-1-haiyue.wang@intel.com",
    "date": "2019-11-05T01:26:18",
    "name": "[v7] net/ice: optimize protocol extraction by dynamic mbuf API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f306420aa31c54ba5104c10f6e1458e573285e6e",
    "submitter": {
        "id": 1044,
        "url": "https://patches.dpdk.org/api/people/1044/?format=api",
        "name": "Wang, Haiyue",
        "email": "haiyue.wang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "https://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191105012618.85170-1-haiyue.wang@intel.com/mbox/",
    "series": [
        {
            "id": 7231,
            "url": "https://patches.dpdk.org/api/series/7231/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=7231",
            "date": "2019-11-05T01:26:18",
            "name": "[v7] net/ice: optimize protocol extraction by dynamic mbuf API",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/7231/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/62408/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/62408/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 29E66A0352;\n\tTue,  5 Nov 2019 02:32:32 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 09BF62C27;\n\tTue,  5 Nov 2019 02:32:31 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id AABF12BCE\n for <dev@dpdk.org>; Tue,  5 Nov 2019 02:32:29 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 04 Nov 2019 17:32:28 -0800",
            "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213])\n by orsmga006.jf.intel.com with ESMTP; 04 Nov 2019 17:32:26 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,269,1569308400\"; d=\"scan'208\";a=\"205357536\"",
        "From": "Haiyue Wang <haiyue.wang@intel.com>",
        "To": "dev@dpdk.org,\n\tolivier.matz@6wind.com,\n\txiaolong.ye@intel.com",
        "Cc": "Haiyue Wang <haiyue.wang@intel.com>",
        "Date": "Tue,  5 Nov 2019 09:26:18 +0800",
        "Message-Id": "<20191105012618.85170-1-haiyue.wang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191105011918.53434-1-haiyue.wang@intel.com>",
        "References": "<20191105011918.53434-1-haiyue.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7] net/ice: optimize protocol extraction by\n\tdynamic mbuf API",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The original design is to use rte_mbuf::udata64 to save the metadata of\nprotocol extraction which has network protocol data fields and type, a\nprivate API is used to decode this metadata. It is not so generic.\n\nUse the new dynamic mbuf field and flags to handle protocol extraction.\nThen the metadata is very clean, only network protocol fields extracted\nby defined offset, and its type will be indicated by related ol_flags.\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\nv7: - Change the log level from ERR to DEBUG for a successful registration,\n      ERR is used to develop firstly.\n\nv6: - Don't need to register all flags when if one dev_args is set, register\n      it as required.\n\nv5: - Remove the '_OL/_ol' in dynamic mbuf flag to make the variable clean.\n\nv4: - Include the 'rte_pmd_ice.h' header in ICE source as needed, reduce\n      its compile scope.\n\nv3: - Use the conventions name \"rte_net_<pmd>_dynfield_<name>\" since it\n      is defined in a in PMD.\n    - Add helpers API for easiy access.\n\nv2: - disable the protocol extraction if failed to register some ol_flags\n    - rewrite the commit message\n\n doc/api/doxy-api-index.md               |   1 +\n doc/api/doxy-api.conf.in                |   1 +\n doc/guides/nics/ice.rst                 |  14 +-\n drivers/net/ice/ice_ethdev.c            |  82 +++++-\n drivers/net/ice/ice_ethdev.h            |   9 +\n drivers/net/ice/ice_rxtx.c              |  91 +++++--\n drivers/net/ice/ice_rxtx.h              |   1 -\n drivers/net/ice/rte_pmd_ice.h           | 328 +++++++++++++++---------\n drivers/net/ice/rte_pmd_ice_version.map |  12 +\n 9 files changed, 386 insertions(+), 153 deletions(-)",
    "diff": "diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md\nindex 28a5dd37e..dff496be0 100644\n--- a/doc/api/doxy-api-index.md\n+++ b/doc/api/doxy-api-index.md\n@@ -42,6 +42,7 @@ The public API headers are grouped by topics:\n   [KNI]                (@ref rte_kni.h),\n   [ixgbe]              (@ref rte_pmd_ixgbe.h),\n   [i40e]               (@ref rte_pmd_i40e.h),\n+  [ice]                (@ref rte_pmd_ice.h),\n   [bnxt]               (@ref rte_pmd_bnxt.h),\n   [dpaa]               (@ref rte_pmd_dpaa.h),\n   [dpaa2]              (@ref rte_pmd_dpaa2.h),\ndiff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in\nindex d8dafb289..faa3b1593 100644\n--- a/doc/api/doxy-api.conf.in\n+++ b/doc/api/doxy-api.conf.in\n@@ -12,6 +12,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \\\n                           @TOPDIR@/drivers/net/dpaa \\\n                           @TOPDIR@/drivers/net/dpaa2 \\\n                           @TOPDIR@/drivers/net/i40e \\\n+                          @TOPDIR@/drivers/net/ice \\\n                           @TOPDIR@/drivers/net/ixgbe \\\n                           @TOPDIR@/drivers/net/softnic \\\n                           @TOPDIR@/drivers/raw/dpaa2_cmdif \\\ndiff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst\nindex 933f63480..04af80545 100644\n--- a/doc/guides/nics/ice.rst\n+++ b/doc/guides/nics/ice.rst\n@@ -82,8 +82,8 @@ Runtime Config Options\n \n - ``Protocol extraction for per queue``\n \n-  Configure the RX queues to do protocol extraction into ``rte_mbuf::udata64``\n-  for protocol handling acceleration, like checking the TCP SYN packets quickly.\n+  Configure the RX queues to do protocol extraction into mbuf for protocol\n+  handling acceleration, like checking the TCP SYN packets quickly.\n \n   The argument format is::\n \n@@ -111,7 +111,8 @@ Runtime Config Options\n   This setting means queues 1, 2-3, 8-9 are TCP extraction, queues 10-23 are\n   IPv6 extraction, other queues use the default VLAN extraction.\n \n-  The extraction will be copied into the lower 32 bit of ``rte_mbuf::udata64``.\n+  The extraction metadata will be copied into the registered dynamic mbuf field\n+  with, and the related dynamic mbuf flags is set.\n \n   .. table:: Protocol extraction : ``vlan``\n \n@@ -175,10 +176,11 @@ Runtime Config Options\n \n   TCPHDR2 - Reserved\n \n-  Use ``get_proto_xtr_flds(struct rte_mbuf *mb)`` to access the protocol\n-  extraction, do not use ``rte_mbuf::udata64`` directly.\n+  Use ``rte_net_ice_dynf_proto_xtr_metadata_get`` to access the protocol\n+  extraction metadata, and use ``PKT_RX_DYNF_PROTO_XTR_*`` to get the\n+  metadata type of ``struct rte_mbuf::ol_flags``.\n \n-  The ``dump_proto_xtr_flds(struct rte_mbuf *mb)`` routine shows how to\n+  The ``rte_net_ice_dump_proto_xtr_metadata`` routine shows how to\n   access the protocol extraction result in ``struct rte_mbuf``.\n \n Driver compilation and testing\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex d74675842..6b0870c2e 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -14,6 +14,8 @@\n #include \"base/ice_flow.h\"\n #include \"base/ice_dcb.h\"\n #include \"base/ice_common.h\"\n+\n+#include \"rte_pmd_ice.h\"\n #include \"ice_ethdev.h\"\n #include \"ice_rxtx.h\"\n #include \"ice_generic_flow.h\"\n@@ -30,6 +32,35 @@ static const char * const ice_valid_args[] = {\n \tNULL\n };\n \n+static const struct rte_mbuf_dynfield ice_proto_xtr_metadata_param = {\n+\t.name = RTE_STR(rte_net_ice_dynfield_proto_xtr_metadata),\n+\t.size = sizeof(uint32_t),\n+\t.align = __alignof__(uint32_t),\n+\t.flags = 0,\n+};\n+\n+struct proto_xtr_ol_flag {\n+\tconst struct rte_mbuf_dynflag param;\n+\tuint64_t *flag;\n+\tbool required;\n+};\n+\n+#define MAP_TYPE_TO_DYNF(type, flag) \\\n+\t[type] = { { RTE_STR(flag), 0 }, &(flag), false }\n+\n+static struct proto_xtr_ol_flag ice_proto_xtr_ol_flag_params[] = {\n+\tMAP_TYPE_TO_DYNF(PROTO_XTR_VLAN,\n+\t\t\t rte_net_ice_dynflag_proto_xtr_vlan),\n+\tMAP_TYPE_TO_DYNF(PROTO_XTR_IPV4,\n+\t\t\t rte_net_ice_dynflag_proto_xtr_ipv4),\n+\tMAP_TYPE_TO_DYNF(PROTO_XTR_IPV6,\n+\t\t\t rte_net_ice_dynflag_proto_xtr_ipv6),\n+\tMAP_TYPE_TO_DYNF(PROTO_XTR_IPV6_FLOW,\n+\t\t\t rte_net_ice_dynflag_proto_xtr_ipv6_flow),\n+\tMAP_TYPE_TO_DYNF(PROTO_XTR_TCP,\n+\t\t\t rte_net_ice_dynflag_proto_xtr_tcp),\n+};\n+\n #define ICE_DFLT_OUTER_TAG_TYPE ICE_AQ_VSI_OUTER_TAG_VLAN_9100\n \n /* DDP package search path */\n@@ -1385,6 +1416,9 @@ ice_init_proto_xtr(struct rte_eth_dev *dev)\n \t\t\tICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tstruct ice_hw *hw = ICE_PF_TO_HW(pf);\n+\tconst struct proto_xtr_ol_flag *ol_flag;\n+\tbool proto_xtr_enable = false;\n+\tint offset;\n \tuint16_t i;\n \n \tif (!ice_proto_xtr_support(hw)) {\n@@ -1398,10 +1432,56 @@ ice_init_proto_xtr(struct rte_eth_dev *dev)\n \t\treturn;\n \t}\n \n-\tfor (i = 0; i < pf->lan_nb_qps; i++)\n+\tfor (i = 0; i < pf->lan_nb_qps; i++) {\n \t\tpf->proto_xtr[i] = ad->devargs.proto_xtr[i] != PROTO_XTR_NONE ?\n \t\t\t\t   ad->devargs.proto_xtr[i] :\n \t\t\t\t   ad->devargs.proto_xtr_dflt;\n+\n+\t\tif (pf->proto_xtr[i] != PROTO_XTR_NONE) {\n+\t\t\tuint8_t type = pf->proto_xtr[i];\n+\n+\t\t\tice_proto_xtr_ol_flag_params[type].required = true;\n+\t\t\tproto_xtr_enable = true;\n+\t\t}\n+\t}\n+\n+\tif (likely(!proto_xtr_enable))\n+\t\treturn;\n+\n+\toffset = rte_mbuf_dynfield_register(&ice_proto_xtr_metadata_param);\n+\tif (unlikely(offset == -1)) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Protocol extraction metadata is disabled in mbuf with error %d\",\n+\t\t\t    -rte_errno);\n+\t\treturn;\n+\t}\n+\n+\tPMD_DRV_LOG(DEBUG,\n+\t\t    \"Protocol extraction metadata offset in mbuf is : %d\",\n+\t\t    offset);\n+\trte_net_ice_dynfield_proto_xtr_metadata = offset;\n+\n+\tfor (i = 0; i < RTE_DIM(ice_proto_xtr_ol_flag_params); i++) {\n+\t\tol_flag = &ice_proto_xtr_ol_flag_params[i];\n+\n+\t\tif (!ol_flag->required)\n+\t\t\tcontinue;\n+\n+\t\toffset = rte_mbuf_dynflag_register(&ol_flag->param);\n+\t\tif (unlikely(offset == -1)) {\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t    \"Protocol extraction offload '%s' failed to register with error %d\",\n+\t\t\t\t    ol_flag->param.name, -rte_errno);\n+\n+\t\t\trte_net_ice_dynfield_proto_xtr_metadata = -1;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tPMD_DRV_LOG(DEBUG,\n+\t\t\t    \"Protocol extraction offload '%s' offset in mbuf is : %d\",\n+\t\t\t    ol_flag->param.name, offset);\n+\t\t*ol_flag->flag = 1ULL << offset;\n+\t}\n }\n \n /*  Initialize SW parameters of PF */\ndiff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex de67e5934..c55713cc1 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -241,6 +241,15 @@ struct ice_vsi {\n \tbool offset_loaded;\n };\n \n+enum proto_xtr_type {\n+\tPROTO_XTR_NONE,\n+\tPROTO_XTR_VLAN,\n+\tPROTO_XTR_IPV4,\n+\tPROTO_XTR_IPV6,\n+\tPROTO_XTR_IPV6_FLOW,\n+\tPROTO_XTR_TCP,\n+};\n+\n enum ice_fdir_tunnel_type {\n \tICE_FDIR_TUNNEL_TYPE_NONE = 0,\n \tICE_FDIR_TUNNEL_TYPE_VXLAN,\ndiff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c\nindex 47a654a73..581ad1b1e 100644\n--- a/drivers/net/ice/ice_rxtx.c\n+++ b/drivers/net/ice/ice_rxtx.c\n@@ -5,6 +5,7 @@\n #include <rte_ethdev_driver.h>\n #include <rte_net.h>\n \n+#include \"rte_pmd_ice.h\"\n #include \"ice_rxtx.h\"\n \n #define ICE_TX_CKSUM_OFFLOAD_MASK (\t\t \\\n@@ -13,18 +14,39 @@\n \t\tPKT_TX_TCP_SEG |\t\t \\\n \t\tPKT_TX_OUTER_IP_CKSUM)\n \n-static inline uint8_t\n-ice_rxdid_to_proto_xtr_type(uint8_t rxdid)\n-{\n-\tstatic uint8_t xtr_map[] = {\n-\t\t[ICE_RXDID_COMMS_AUX_VLAN]      = PROTO_XTR_VLAN,\n-\t\t[ICE_RXDID_COMMS_AUX_IPV4]      = PROTO_XTR_IPV4,\n-\t\t[ICE_RXDID_COMMS_AUX_IPV6]      = PROTO_XTR_IPV6,\n-\t\t[ICE_RXDID_COMMS_AUX_IPV6_FLOW] = PROTO_XTR_IPV6_FLOW,\n-\t\t[ICE_RXDID_COMMS_AUX_TCP]       = PROTO_XTR_TCP,\n+/* Offset of mbuf dynamic field for protocol extraction data */\n+int rte_net_ice_dynfield_proto_xtr_metadata = -1;\n+\n+/* Mask of mbuf dynamic flags for protocol extraction type */\n+uint64_t rte_net_ice_dynflag_proto_xtr_vlan;\n+uint64_t rte_net_ice_dynflag_proto_xtr_ipv4;\n+uint64_t rte_net_ice_dynflag_proto_xtr_ipv6;\n+uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow;\n+uint64_t rte_net_ice_dynflag_proto_xtr_tcp;\n+\n+#define MAP_RXDID_TO_FLAG(rxdid, flag) \\\n+\t[rxdid] = &(flag)\n+\n+static inline uint64_t\n+ice_rxdid_to_proto_xtr_ol_flag(uint8_t rxdid)\n+{\n+\tstatic uint64_t *ol_flag_map[] = {\n+\t\tMAP_RXDID_TO_FLAG(ICE_RXDID_COMMS_AUX_VLAN,\n+\t\t\t\t  rte_net_ice_dynflag_proto_xtr_vlan),\n+\t\tMAP_RXDID_TO_FLAG(ICE_RXDID_COMMS_AUX_IPV4,\n+\t\t\t\t  rte_net_ice_dynflag_proto_xtr_ipv4),\n+\t\tMAP_RXDID_TO_FLAG(ICE_RXDID_COMMS_AUX_IPV6,\n+\t\t\t\t  rte_net_ice_dynflag_proto_xtr_ipv6),\n+\t\tMAP_RXDID_TO_FLAG(ICE_RXDID_COMMS_AUX_IPV6_FLOW,\n+\t\t\t\t  rte_net_ice_dynflag_proto_xtr_ipv6_flow),\n+\t\tMAP_RXDID_TO_FLAG(ICE_RXDID_COMMS_AUX_TCP,\n+\t\t\t\t  rte_net_ice_dynflag_proto_xtr_tcp),\n \t};\n+\tuint64_t *ol_flag;\n+\n+\tol_flag = rxdid < RTE_DIM(ol_flag_map) ? ol_flag_map[rxdid] : NULL;\n \n-\treturn rxdid < RTE_DIM(xtr_map) ? xtr_map[rxdid] : PROTO_XTR_NONE;\n+\treturn ol_flag != NULL ? *ol_flag : 0;\n }\n \n static inline uint8_t\n@@ -1325,10 +1347,38 @@ ice_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union ice_rx_flex_desc *rxdp)\n \t\t   mb->vlan_tci, mb->vlan_tci_outer);\n }\n \n+#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC\n #define ICE_RX_PROTO_XTR_VALID \\\n \t((1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S) | \\\n \t (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S))\n \n+static void\n+ice_rxd_to_proto_xtr(struct rte_mbuf *mb,\n+\t\t     volatile struct ice_32b_rx_flex_desc_comms *desc)\n+{\n+\tuint16_t stat_err = rte_le_to_cpu_16(desc->status_error1);\n+\tuint32_t metadata;\n+\tuint64_t ol_flag;\n+\n+\tif (unlikely(!(stat_err & ICE_RX_PROTO_XTR_VALID)))\n+\t\treturn;\n+\n+\tol_flag = ice_rxdid_to_proto_xtr_ol_flag(desc->rxdid);\n+\tif (unlikely(!ol_flag))\n+\t\treturn;\n+\n+\tmb->ol_flags |= ol_flag;\n+\n+\tmetadata = stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S) ?\n+\t\t\t\trte_le_to_cpu_16(desc->flex_ts.flex.aux0) : 0;\n+\n+\tif (likely(stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S)))\n+\t\tmetadata |= rte_le_to_cpu_16(desc->flex_ts.flex.aux1) << 16;\n+\n+\t*RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) = metadata;\n+}\n+#endif\n+\n static inline void\n ice_rxd_to_pkt_fields(struct rte_mbuf *mb,\n \t\t      volatile union ice_rx_flex_desc *rxdp)\n@@ -1344,28 +1394,13 @@ ice_rxd_to_pkt_fields(struct rte_mbuf *mb,\n \t}\n \n #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC\n-\tinit_proto_xtr_flds(mb);\n-\n-\tstat_err = rte_le_to_cpu_16(desc->status_error1);\n-\tif (stat_err & ICE_RX_PROTO_XTR_VALID) {\n-\t\tstruct proto_xtr_flds *xtr = get_proto_xtr_flds(mb);\n-\n-\t\tif (stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD4_VALID_S))\n-\t\t\txtr->u.raw.data0 =\n-\t\t\t\trte_le_to_cpu_16(desc->flex_ts.flex.aux0);\n-\n-\t\tif (stat_err & (1 << ICE_RX_FLEX_DESC_STATUS1_XTRMD5_VALID_S))\n-\t\t\txtr->u.raw.data1 =\n-\t\t\t\trte_le_to_cpu_16(desc->flex_ts.flex.aux1);\n-\n-\t\txtr->type = ice_rxdid_to_proto_xtr_type(desc->rxdid);\n-\t\txtr->magic = PROTO_XTR_MAGIC_ID;\n-\t}\n-\n \tif (desc->flow_id != 0xFFFFFFFF) {\n \t\tmb->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;\n \t\tmb->hash.fdir.hi = rte_le_to_cpu_32(desc->flow_id);\n \t}\n+\n+\tif (unlikely(rte_net_ice_dynf_proto_xtr_metadata_avail()))\n+\t\tice_rxd_to_proto_xtr(mb, desc);\n #endif\n }\n \ndiff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h\nindex 5de618976..9e3d2cd07 100644\n--- a/drivers/net/ice/ice_rxtx.h\n+++ b/drivers/net/ice/ice_rxtx.h\n@@ -5,7 +5,6 @@\n #ifndef _ICE_RXTX_H_\n #define _ICE_RXTX_H_\n \n-#include \"rte_pmd_ice.h\"\n #include \"ice_ethdev.h\"\n \n #define ICE_ALIGN_RING_DESC  32\ndiff --git a/drivers/net/ice/rte_pmd_ice.h b/drivers/net/ice/rte_pmd_ice.h\nindex 719487e1e..1f1b75e85 100644\n--- a/drivers/net/ice/rte_pmd_ice.h\n+++ b/drivers/net/ice/rte_pmd_ice.h\n@@ -5,144 +5,238 @@\n #ifndef _RTE_PMD_ICE_H_\n #define _RTE_PMD_ICE_H_\n \n+/**\n+ * @file rte_pmd_ice.h\n+ *\n+ * ice PMD specific functions.\n+ *\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ */\n+\n #include <stdio.h>\n #include <rte_mbuf.h>\n-#include <rte_ethdev.h>\n+#include <rte_mbuf_dyn.h>\n \n #ifdef __cplusplus\n extern \"C\" {\n #endif\n \n-enum proto_xtr_type {\n-\tPROTO_XTR_NONE,\n-\tPROTO_XTR_VLAN,\n-\tPROTO_XTR_IPV4,\n-\tPROTO_XTR_IPV6,\n-\tPROTO_XTR_IPV6_FLOW,\n-\tPROTO_XTR_TCP,\n+/**\n+ * The supported network protocol extraction metadata format definition.\n+ */\n+union proto_xtr_metadata {\n+\tuint32_t metadata;\n+\n+\tstruct {\n+\t\tuint16_t data0;\n+\t\tuint16_t data1;\n+\t} raw;\n+\n+\tstruct {\n+\t\tuint16_t stag_vid:12,\n+\t\t\t stag_dei:1,\n+\t\t\t stag_pcp:3;\n+\t\tuint16_t ctag_vid:12,\n+\t\t\t ctag_dei:1,\n+\t\t\t ctag_pcp:3;\n+\t} vlan;\n+\n+\tstruct {\n+\t\tuint16_t protocol:8,\n+\t\t\t ttl:8;\n+\t\tuint16_t tos:8,\n+\t\t\t ihl:4,\n+\t\t\t version:4;\n+\t} ipv4;\n+\n+\tstruct {\n+\t\tuint16_t hoplimit:8,\n+\t\t\t nexthdr:8;\n+\t\tuint16_t flowhi4:4,\n+\t\t\t tc:8,\n+\t\t\t version:4;\n+\t} ipv6;\n+\n+\tstruct {\n+\t\tuint16_t flowlo16;\n+\t\tuint16_t flowhi4:4,\n+\t\t\t tc:8,\n+\t\t\t version:4;\n+\t} ipv6_flow;\n+\n+\tstruct {\n+\t\tuint16_t fin:1,\n+\t\t\t syn:1,\n+\t\t\t rst:1,\n+\t\t\t psh:1,\n+\t\t\t ack:1,\n+\t\t\t urg:1,\n+\t\t\t ece:1,\n+\t\t\t cwr:1,\n+\t\t\t res1:4,\n+\t\t\t doff:4;\n+\t\tuint16_t rsvd;\n+\t} tcp;\n };\n \n-struct proto_xtr_flds {\n-\tunion {\n-\t\tstruct {\n-\t\t\tuint16_t data0;\n-\t\t\tuint16_t data1;\n-\t\t} raw;\n-\t\tstruct {\n-\t\t\tuint16_t stag_vid:12,\n-\t\t\t\t stag_dei:1,\n-\t\t\t\t stag_pcp:3;\n-\t\t\tuint16_t ctag_vid:12,\n-\t\t\t\t ctag_dei:1,\n-\t\t\t\t ctag_pcp:3;\n-\t\t} vlan;\n-\t\tstruct {\n-\t\t\tuint16_t protocol:8,\n-\t\t\t\t ttl:8;\n-\t\t\tuint16_t tos:8,\n-\t\t\t\t ihl:4,\n-\t\t\t\t version:4;\n-\t\t} ipv4;\n-\t\tstruct {\n-\t\t\tuint16_t hoplimit:8,\n-\t\t\t\t nexthdr:8;\n-\t\t\tuint16_t flowhi4:4,\n-\t\t\t\t tc:8,\n-\t\t\t\t version:4;\n-\t\t} ipv6;\n-\t\tstruct {\n-\t\t\tuint16_t flowlo16;\n-\t\t\tuint16_t flowhi4:4,\n-\t\t\t\t tc:8,\n-\t\t\t\t version:4;\n-\t\t} ipv6_flow;\n-\t\tstruct {\n-\t\t\tuint16_t fin:1,\n-\t\t\t\t syn:1,\n-\t\t\t\t rst:1,\n-\t\t\t\t psh:1,\n-\t\t\t\t ack:1,\n-\t\t\t\t urg:1,\n-\t\t\t\t ece:1,\n-\t\t\t\t cwr:1,\n-\t\t\t\t res1:4,\n-\t\t\t\t doff:4;\n-\t\t\tuint16_t rsvd;\n-\t\t} tcp;\n-\t} u;\n-\n-\tuint16_t rsvd;\n-\n-\tuint8_t type;\n-\n-#define PROTO_XTR_MAGIC_ID\t0xCE\n-\tuint8_t magic;\n-};\n+/**\n+ * The offset of mbuf dynamic field for protocol extraction metadata, it is\n+ * registered when dev_args 'proto_xtr' is set.\n+ */\n+extern int rte_net_ice_dynfield_proto_xtr_metadata;\n \n-static inline void\n-init_proto_xtr_flds(struct rte_mbuf *mb)\n+/**\n+ * The mask of mbuf dynamic flags for VLAN protocol extraction type.\n+ */\n+extern uint64_t rte_net_ice_dynflag_proto_xtr_vlan;\n+\n+/**\n+ * The mask of mbuf dynamic flags for IPv4 protocol extraction type.\n+ */\n+extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv4;\n+\n+/**\n+ * The mask of mbuf dynamic flags for IPv6 protocol extraction type.\n+ */\n+extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6;\n+\n+/**\n+ * The mask of mbuf dynamic flags for IPv6 with flow protocol extraction type.\n+ */\n+extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow;\n+\n+/**\n+ * The mask of mbuf dynamic flags for TCP protocol extraction type.\n+ */\n+extern uint64_t rte_net_ice_dynflag_proto_xtr_tcp;\n+\n+/**\n+ * The mbuf dynamic field pointer for protocol extraction metadata.\n+ */\n+#define RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m) \\\n+\tRTE_MBUF_DYNFIELD((m), \\\n+\t\t\t  rte_net_ice_dynfield_proto_xtr_metadata, uint32_t *)\n+\n+/**\n+ * The mbuf dynamic flag for VLAN protocol extraction metadata.\n+ */\n+#define PKT_RX_DYNF_PROTO_XTR_VLAN \\\n+\t(rte_net_ice_dynflag_proto_xtr_vlan)\n+\n+/**\n+ * The mbuf dynamic flag for IPv4 protocol extraction metadata.\n+ */\n+#define PKT_RX_DYNF_PROTO_XTR_IPV4 \\\n+\t(rte_net_ice_dynflag_proto_xtr_ipv4)\n+\n+/**\n+ * The mbuf dynamic flag for IPv6 protocol extraction metadata.\n+ */\n+#define PKT_RX_DYNF_PROTO_XTR_IPV6 \\\n+\t(rte_net_ice_dynflag_proto_xtr_ipv6)\n+\n+/**\n+ * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata.\n+ */\n+#define PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW \\\n+\t(rte_net_ice_dynflag_proto_xtr_ipv6_flow)\n+\n+/**\n+ * The mbuf dynamic flag for TCP protocol extraction metadata.\n+ */\n+#define PKT_RX_DYNF_PROTO_XTR_TCP \\\n+\t(rte_net_ice_dynflag_proto_xtr_tcp)\n+\n+/**\n+ * Check if mbuf dynamic field for protocol extraction metadata is registered.\n+ *\n+ * @return\n+ *   True if registered, false otherwise.\n+ */\n+__rte_experimental\n+static __rte_always_inline int\n+rte_net_ice_dynf_proto_xtr_metadata_avail(void)\n {\n-\tmb->udata64 = 0;\n+\treturn rte_net_ice_dynfield_proto_xtr_metadata != -1;\n }\n \n-static inline struct proto_xtr_flds *\n-get_proto_xtr_flds(struct rte_mbuf *mb)\n+/**\n+ * Get the mbuf dynamic field for protocol extraction metadata.\n+ *\n+ * @param m\n+ *    The pointer to the mbuf.\n+ * @return\n+ *   The saved protocol extraction metadata.\n+ */\n+__rte_experimental\n+static __rte_always_inline uint32_t\n+rte_net_ice_dynf_proto_xtr_metadata_get(struct rte_mbuf *m)\n {\n-\tRTE_BUILD_BUG_ON(sizeof(struct proto_xtr_flds) > sizeof(mb->udata64));\n-\n-\treturn (struct proto_xtr_flds *)&mb->udata64;\n+\treturn *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m);\n }\n \n+/**\n+ * Dump the mbuf dynamic field for protocol extraction metadata.\n+ *\n+ * @param m\n+ *    The pointer to the mbuf.\n+ */\n+__rte_experimental\n static inline void\n-dump_proto_xtr_flds(struct rte_mbuf *mb)\n+rte_net_ice_dump_proto_xtr_metadata(struct rte_mbuf *m)\n {\n-\tstruct proto_xtr_flds *xtr = get_proto_xtr_flds(mb);\n+\tunion proto_xtr_metadata data;\n \n-\tif (xtr->magic != PROTO_XTR_MAGIC_ID || xtr->type == PROTO_XTR_NONE)\n+\tif (!rte_net_ice_dynf_proto_xtr_metadata_avail())\n \t\treturn;\n \n-\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],\",\n-\t       xtr->u.raw.data0, xtr->u.raw.data1);\n-\n-\tif (xtr->type == PROTO_XTR_VLAN)\n-\t\tprintf(\"vlan,stag=%u:%u:%u,ctag=%u:%u:%u \",\n-\t\t       xtr->u.vlan.stag_pcp,\n-\t\t       xtr->u.vlan.stag_dei,\n-\t\t       xtr->u.vlan.stag_vid,\n-\t\t       xtr->u.vlan.ctag_pcp,\n-\t\t       xtr->u.vlan.ctag_dei,\n-\t\t       xtr->u.vlan.ctag_vid);\n-\telse if (xtr->type == PROTO_XTR_IPV4)\n-\t\tprintf(\"ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u \",\n-\t\t       xtr->u.ipv4.version,\n-\t\t       xtr->u.ipv4.ihl,\n-\t\t       xtr->u.ipv4.tos,\n-\t\t       xtr->u.ipv4.ttl,\n-\t\t       xtr->u.ipv4.protocol);\n-\telse if (xtr->type == PROTO_XTR_IPV6)\n-\t\tprintf(\"ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u \",\n-\t\t       xtr->u.ipv6.version,\n-\t\t       xtr->u.ipv6.tc,\n-\t\t       xtr->u.ipv6.flowhi4,\n-\t\t       xtr->u.ipv6.nexthdr,\n-\t\t       xtr->u.ipv6.hoplimit);\n-\telse if (xtr->type == PROTO_XTR_IPV6_FLOW)\n-\t\tprintf(\"ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x \",\n-\t\t       xtr->u.ipv6_flow.version,\n-\t\t       xtr->u.ipv6_flow.tc,\n-\t\t       xtr->u.ipv6_flow.flowhi4,\n-\t\t       xtr->u.ipv6_flow.flowlo16);\n-\telse if (xtr->type == PROTO_XTR_TCP)\n-\t\tprintf(\"tcp,doff=%u,flags=%s%s%s%s%s%s%s%s \",\n-\t\t       xtr->u.tcp.doff,\n-\t\t       xtr->u.tcp.cwr ? \"C\" : \"\",\n-\t\t       xtr->u.tcp.ece ? \"E\" : \"\",\n-\t\t       xtr->u.tcp.urg ? \"U\" : \"\",\n-\t\t       xtr->u.tcp.ack ? \"A\" : \"\",\n-\t\t       xtr->u.tcp.psh ? \"P\" : \"\",\n-\t\t       xtr->u.tcp.rst ? \"R\" : \"\",\n-\t\t       xtr->u.tcp.syn ? \"S\" : \"\",\n-\t\t       xtr->u.tcp.fin ? \"F\" : \"\");\n+\tdata.metadata = rte_net_ice_dynf_proto_xtr_metadata_get(m);\n+\n+\tif (m->ol_flags & PKT_RX_DYNF_PROTO_XTR_VLAN)\n+\t\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],vlan,stag=%u:%u:%u,ctag=%u:%u:%u\",\n+\t\t       data.raw.data0, data.raw.data1,\n+\t\t       data.vlan.stag_pcp,\n+\t\t       data.vlan.stag_dei,\n+\t\t       data.vlan.stag_vid,\n+\t\t       data.vlan.ctag_pcp,\n+\t\t       data.vlan.ctag_dei,\n+\t\t       data.vlan.ctag_vid);\n+\telse if (m->ol_flags & PKT_RX_DYNF_PROTO_XTR_IPV4)\n+\t\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u\",\n+\t\t       data.raw.data0, data.raw.data1,\n+\t\t       data.ipv4.version,\n+\t\t       data.ipv4.ihl,\n+\t\t       data.ipv4.tos,\n+\t\t       data.ipv4.ttl,\n+\t\t       data.ipv4.protocol);\n+\telse if (m->ol_flags & PKT_RX_DYNF_PROTO_XTR_IPV6)\n+\t\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u\",\n+\t\t       data.raw.data0, data.raw.data1,\n+\t\t       data.ipv6.version,\n+\t\t       data.ipv6.tc,\n+\t\t       data.ipv6.flowhi4,\n+\t\t       data.ipv6.nexthdr,\n+\t\t       data.ipv6.hoplimit);\n+\telse if (m->ol_flags & PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW)\n+\t\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x\",\n+\t\t       data.raw.data0, data.raw.data1,\n+\t\t       data.ipv6_flow.version,\n+\t\t       data.ipv6_flow.tc,\n+\t\t       data.ipv6_flow.flowhi4,\n+\t\t       data.ipv6_flow.flowlo16);\n+\telse if (m->ol_flags & PKT_RX_DYNF_PROTO_XTR_TCP)\n+\t\tprintf(\" - Protocol Extraction:[0x%04x:0x%04x],tcp,doff=%u,flags=%s%s%s%s%s%s%s%s\",\n+\t\t       data.raw.data0, data.raw.data1,\n+\t\t       data.tcp.doff,\n+\t\t       data.tcp.cwr ? \"C\" : \"\",\n+\t\t       data.tcp.ece ? \"E\" : \"\",\n+\t\t       data.tcp.urg ? \"U\" : \"\",\n+\t\t       data.tcp.ack ? \"A\" : \"\",\n+\t\t       data.tcp.psh ? \"P\" : \"\",\n+\t\t       data.tcp.rst ? \"R\" : \"\",\n+\t\t       data.tcp.syn ? \"S\" : \"\",\n+\t\t       data.tcp.fin ? \"F\" : \"\");\n }\n \n #ifdef __cplusplus\ndiff --git a/drivers/net/ice/rte_pmd_ice_version.map b/drivers/net/ice/rte_pmd_ice_version.map\nindex 7b23b609d..7e70974d5 100644\n--- a/drivers/net/ice/rte_pmd_ice_version.map\n+++ b/drivers/net/ice/rte_pmd_ice_version.map\n@@ -2,3 +2,15 @@ DPDK_19.02 {\n \n \tlocal: *;\n };\n+\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\t# added in 19.11\n+\trte_net_ice_dynfield_proto_xtr_metadata;\n+\trte_net_ice_dynflag_proto_xtr_vlan;\n+\trte_net_ice_dynflag_proto_xtr_ipv4;\n+\trte_net_ice_dynflag_proto_xtr_ipv6;\n+\trte_net_ice_dynflag_proto_xtr_ipv6_flow;\n+\trte_net_ice_dynflag_proto_xtr_tcp;\n+};\n",
    "prefixes": [
        "v7"
    ]
}