get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126701,
    "url": "https://patches.dpdk.org/api/patches/126701/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230505103102.2912297-1-david.marchand@redhat.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": "<20230505103102.2912297-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230505103102.2912297-1-david.marchand@redhat.com",
    "date": "2023-05-05T10:31:02",
    "name": "[RFC] ethdev: advertise flow restore in mbuf",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "74b3ca1dcb218c3f97d2fe62bbd6496fd634648d",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230505103102.2912297-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 27932,
            "url": "https://patches.dpdk.org/api/series/27932/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27932",
            "date": "2023-05-05T10:31:02",
            "name": "[RFC] ethdev: advertise flow restore in mbuf",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/27932/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/126701/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/126701/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DE23E42A6E;\n\tFri,  5 May 2023 12:31:25 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 65CCF41144;\n\tFri,  5 May 2023 12:31:25 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id D2657410EA\n for <dev@dpdk.org>; Fri,  5 May 2023 12:31:23 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-493-U4RDWaZFMn6E8XuRBL6A4Q-1; Fri, 05 May 2023 06:31:18 -0400",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com\n [10.11.54.1])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BE0885A5A3;\n Fri,  5 May 2023 10:31:17 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.224.233])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 1670040C2063;\n Fri,  5 May 2023 10:31:14 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1683282683;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=pQay/NFclpDRvyFxj5a5lrgzwygHh97B+66qxQW1Dss=;\n b=Xspotysv2PCe1UWVKOkKC9sywSg5Hy+wRWWNiWm1X/j5RwLQJGfigeITRgRLhZ0MdSAa9Z\n D1BMysIxDuaFMybtM6kjv6w3oes56R4/378bGSlH9NpeAfhm5iCjg3Ewah10P0Z81kZvx/\n 8LlJJp1YZSduWdr1/pLWegq/eptobT4=",
        "X-MC-Unique": "U4RDWaZFMn6E8XuRBL6A4Q-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, i.maximets@ovn.org,\n Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>, Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ferruh Yigit <ferruh.yigit@amd.com>, Ori Kam <orika@nvidia.com>",
        "Subject": "[RFC PATCH] ethdev: advertise flow restore in mbuf",
        "Date": "Fri,  5 May 2023 12:31:02 +0200",
        "Message-Id": "<20230505103102.2912297-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.1",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "As reported by Ilya [1], unconditionally calling\nrte_flow_get_restore_info() impacts an application performance for drivers\nthat do not provide this ops.\nIt could also impact processing of packets that require no call to\nrte_flow_get_restore_info() at all.\n\nAdvertise in mbuf (via a dynamic flag) whether the driver has more\nmetadata to provide via rte_flow_get_restore_info().\nThe application can then call it only when required.\n\nLink: http://inbox.dpdk.org/dev/5248c2ca-f2a6-3fb0-38b8-7f659bfa40de@ovn.org/\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nNote: I did not test this RFC patch yet but I hope we can resume and\nmaybe conclude on the discussion for the tunnel offloading API.\n\n---\n app/test-pmd/util.c              |  9 +++++----\n drivers/net/mlx5/linux/mlx5_os.c | 14 ++++++++++----\n drivers/net/mlx5/mlx5.h          |  3 ++-\n drivers/net/mlx5/mlx5_flow.c     | 26 ++++++++++++++++++++------\n drivers/net/mlx5/mlx5_rx.c       |  2 +-\n drivers/net/mlx5/mlx5_rx.h       |  1 +\n drivers/net/mlx5/mlx5_trigger.c  |  4 ++--\n drivers/net/sfc/sfc_dp.c         |  9 ++-------\n lib/ethdev/ethdev_driver.h       |  8 ++++++++\n lib/ethdev/rte_flow.c            | 29 +++++++++++++++++++++++++++++\n lib/ethdev/rte_flow.h            | 19 ++++++++++++++++++-\n lib/ethdev/version.map           |  4 ++++\n 12 files changed, 102 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c\nindex f9df5f69ef..5aa69ed545 100644\n--- a/app/test-pmd/util.c\n+++ b/app/test-pmd/util.c\n@@ -88,18 +88,20 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n \tchar print_buf[MAX_STRING_LEN];\n \tsize_t buf_size = MAX_STRING_LEN;\n \tsize_t cur_len = 0;\n+\tuint64_t restore_info_dynflag;\n \n \tif (!nb_pkts)\n \t\treturn;\n+\trestore_info_dynflag = rte_flow_restore_info_dynflag();\n \tMKDUMPSTR(print_buf, buf_size, cur_len,\n \t\t  \"port %u/queue %u: %s %u packets\\n\", port_id, queue,\n \t\t  is_rx ? \"received\" : \"sent\", (unsigned int) nb_pkts);\n \tfor (i = 0; i < nb_pkts; i++) {\n-\t\tint ret;\n \t\tstruct rte_flow_error error;\n \t\tstruct rte_flow_restore_info info = { 0, };\n \n \t\tmb = pkts[i];\n+\t\tol_flags = mb->ol_flags;\n \t\tif (rxq_share > 0)\n \t\t\tMKDUMPSTR(print_buf, buf_size, cur_len, \"port %u, \",\n \t\t\t\t  mb->port);\n@@ -107,8 +109,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n \t\teth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type);\n \t\tpacket_type = mb->packet_type;\n \t\tis_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type);\n-\t\tret = rte_flow_get_restore_info(port_id, mb, &info, &error);\n-\t\tif (!ret) {\n+\t\tif ((ol_flags & restore_info_dynflag) != 0 &&\n+\t\t\t\trte_flow_get_restore_info(port_id, mb, &info, &error) == 0) {\n \t\t\tMKDUMPSTR(print_buf, buf_size, cur_len,\n \t\t\t\t  \"restore info:\");\n \t\t\tif (info.flags & RTE_FLOW_RESTORE_INFO_TUNNEL) {\n@@ -153,7 +155,6 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n \t\t\t  \" - pool=%s - type=0x%04x - length=%u - nb_segs=%d\",\n \t\t\t  mb->pool->name, eth_type, (unsigned int) mb->pkt_len,\n \t\t\t  (int)mb->nb_segs);\n-\t\tol_flags = mb->ol_flags;\n \t\tif (ol_flags & RTE_MBUF_F_RX_RSS_HASH) {\n \t\t\tMKDUMPSTR(print_buf, buf_size, cur_len,\n \t\t\t\t  \" - RSS hash=0x%x\",\ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex 980234e2ac..e6e3784013 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -575,11 +575,17 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)\n \t\tgoto error;\n \t}\n #endif\n-\tif (!sh->tunnel_hub && sh->config.dv_miss_info)\n+\tif (!sh->tunnel_hub && sh->config.dv_miss_info) {\n+\t\terr = mlx5_flow_restore_info_register();\n+\t\tif (err) {\n+\t\t\tDRV_LOG(ERR, \"Could not register mbuf dynflag for rte_flow_get_restore_info\");\n+\t\t\tgoto error;\n+\t\t}\n \t\terr = mlx5_alloc_tunnel_hub(sh);\n-\tif (err) {\n-\t\tDRV_LOG(ERR, \"mlx5_alloc_tunnel_hub failed err=%d\", err);\n-\t\tgoto error;\n+\t\tif (err) {\n+\t\t\tDRV_LOG(ERR, \"mlx5_alloc_tunnel_hub failed err=%d\", err);\n+\t\t\tgoto error;\n+\t\t}\n \t}\n \tif (sh->config.reclaim_mode == MLX5_RCM_AGGR) {\n \t\tmlx5_glue->dr_reclaim_domain_memory(sh->rx_domain, 1);\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 9eae692037..77cdc802da 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -2116,7 +2116,8 @@ int mlx5_flow_query_counter(struct rte_eth_dev *dev, struct rte_flow *flow,\n int mlx5_flow_dev_dump_ipool(struct rte_eth_dev *dev, struct rte_flow *flow,\n \t\tFILE *file, struct rte_flow_error *error);\n #endif\n-void mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev);\n+int mlx5_flow_restore_info_register(void);\n+void mlx5_flow_rxq_dynf_set(struct rte_eth_dev *dev);\n int mlx5_flow_get_aged_flows(struct rte_eth_dev *dev, void **contexts,\n \t\t\tuint32_t nb_contexts, struct rte_flow_error *error);\n int mlx5_validate_action_ct(struct rte_eth_dev *dev,\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex d0275fdd00..715b7d327d 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -1779,6 +1779,20 @@ flow_rxq_flags_clear(struct rte_eth_dev *dev)\n \tpriv->sh->shared_mark_enabled = 0;\n }\n \n+static uint64_t mlx5_restore_info_dynflag;\n+\n+int\n+mlx5_flow_restore_info_register(void)\n+{\n+\tint err = 0;\n+\n+\tif (mlx5_restore_info_dynflag == 0) {\n+\t\tif (rte_flow_restore_info_dynflag_register(&mlx5_restore_info_dynflag) < 0)\n+\t\t\terr = ENOMEM;\n+\t}\n+\treturn err;\n+}\n+\n /**\n  * Set the Rx queue dynamic metadata (mask and offset) for a flow\n  *\n@@ -1786,7 +1800,7 @@ flow_rxq_flags_clear(struct rte_eth_dev *dev)\n  *   Pointer to the Ethernet device structure.\n  */\n void\n-mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev)\n+mlx5_flow_rxq_dynf_set(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tunsigned int i;\n@@ -1809,6 +1823,9 @@ mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev)\n \t\t\tdata->flow_meta_offset = rte_flow_dynf_metadata_offs;\n \t\t\tdata->flow_meta_port_mask = priv->sh->dv_meta_mask;\n \t\t}\n+\t\tdata->mark_flag = RTE_MBUF_F_RX_FDIR_ID;\n+\t\tif (is_tunnel_offload_active(dev))\n+\t\t\tdata->mark_flag |= mlx5_restore_info_dynflag;\n \t}\n }\n \n@@ -11453,11 +11470,8 @@ mlx5_flow_tunnel_get_restore_info(struct rte_eth_dev *dev,\n \tconst struct mlx5_flow_tbl_data_entry *tble;\n \tconst uint64_t mask = RTE_MBUF_F_RX_FDIR | RTE_MBUF_F_RX_FDIR_ID;\n \n-\tif (!is_tunnel_offload_active(dev)) {\n-\t\tinfo->flags = 0;\n-\t\treturn 0;\n-\t}\n-\n+\tif ((ol_flags & mlx5_restore_info_dynflag) == 0)\n+\t\tgoto err;\n \tif ((ol_flags & mask) != mask)\n \t\tgoto err;\n \ttble = tunnel_mark_decode(dev, m->hash.fdir.hi);\ndiff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c\nindex a2be523e9e..71c4638251 100644\n--- a/drivers/net/mlx5/mlx5_rx.c\n+++ b/drivers/net/mlx5/mlx5_rx.c\n@@ -857,7 +857,7 @@ rxq_cq_to_mbuf(struct mlx5_rxq_data *rxq, struct rte_mbuf *pkt,\n \t\tif (MLX5_FLOW_MARK_IS_VALID(mark)) {\n \t\t\tpkt->ol_flags |= RTE_MBUF_F_RX_FDIR;\n \t\t\tif (mark != RTE_BE32(MLX5_FLOW_MARK_DEFAULT)) {\n-\t\t\t\tpkt->ol_flags |= RTE_MBUF_F_RX_FDIR_ID;\n+\t\t\t\tpkt->ol_flags |= rxq->mark_flag;\n \t\t\t\tpkt->hash.fdir.hi = mlx5_flow_mark_get(mark);\n \t\t\t}\n \t\t}\ndiff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h\nindex 52c35c83f8..3514edd84e 100644\n--- a/drivers/net/mlx5/mlx5_rx.h\n+++ b/drivers/net/mlx5/mlx5_rx.h\n@@ -136,6 +136,7 @@ struct mlx5_rxq_data {\n \tstruct mlx5_uar_data uar_data; /* CQ doorbell. */\n \tuint32_t cqn; /* CQ number. */\n \tuint8_t cq_arm_sn; /* CQ arm seq number. */\n+\tuint64_t mark_flag; /* ol_flags to set with marks. */\n \tuint32_t tunnel; /* Tunnel information. */\n \tint timestamp_offset; /* Dynamic mbuf field for timestamp. */\n \tuint64_t timestamp_rx_flag; /* Dynamic mbuf flag for timestamp. */\ndiff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c\nindex bbaa7d2aa0..7bdb897612 100644\n--- a/drivers/net/mlx5/mlx5_trigger.c\n+++ b/drivers/net/mlx5/mlx5_trigger.c\n@@ -1282,8 +1282,8 @@ mlx5_dev_start(struct rte_eth_dev *dev)\n \t\t\tdev->data->port_id);\n \t\tgoto error;\n \t}\n-\t/* Set a mask and offset of dynamic metadata flows into Rx queues. */\n-\tmlx5_flow_rxq_dynf_metadata_set(dev);\n+\t/* Set dynamic fields and flags into Rx queues. */\n+\tmlx5_flow_rxq_dynf_set(dev);\n \t/* Set flags and context to convert Rx timestamps. */\n \tmlx5_rxq_timestamp_set(dev);\n \t/* Set a mask and offset of scheduling on timestamp into Tx queues. */\ndiff --git a/drivers/net/sfc/sfc_dp.c b/drivers/net/sfc/sfc_dp.c\nindex 9f2093b353..8b2dbea325 100644\n--- a/drivers/net/sfc/sfc_dp.c\n+++ b/drivers/net/sfc/sfc_dp.c\n@@ -11,6 +11,7 @@\n #include <string.h>\n #include <errno.h>\n \n+#include <ethdev_driver.h>\n #include <rte_log.h>\n #include <rte_mbuf_dyn.h>\n \n@@ -135,12 +136,8 @@ sfc_dp_ft_ctx_id_register(void)\n \t\t.size = sizeof(uint8_t),\n \t\t.align = __alignof__(uint8_t),\n \t};\n-\tstatic const struct rte_mbuf_dynflag ft_ctx_id_valid = {\n-\t\t.name = \"rte_net_sfc_dynflag_ft_ctx_id_valid\",\n-\t};\n \n \tint field_offset;\n-\tint flag;\n \n \tSFC_GENERIC_LOG(INFO, \"%s() entry\", __func__);\n \n@@ -156,15 +153,13 @@ sfc_dp_ft_ctx_id_register(void)\n \t\treturn -1;\n \t}\n \n-\tflag = rte_mbuf_dynflag_register(&ft_ctx_id_valid);\n-\tif (flag < 0) {\n+\tif (rte_flow_restore_info_dynflag_register(&sfc_dp_ft_ctx_id_valid) < 0) {\n \t\tSFC_GENERIC_LOG(ERR, \"%s() failed to register ft_ctx_id dynflag\",\n \t\t\t\t__func__);\n \t\treturn -1;\n \t}\n \n \tsfc_dp_ft_ctx_id_offset = field_offset;\n-\tsfc_dp_ft_ctx_id_valid = UINT64_C(1) << flag;\n \n \tSFC_GENERIC_LOG(INFO, \"%s() done\", __func__);\n \ndiff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h\nindex 2c9d615fb5..6c17d84d1b 100644\n--- a/lib/ethdev/ethdev_driver.h\n+++ b/lib/ethdev/ethdev_driver.h\n@@ -1949,6 +1949,14 @@ __rte_internal\n int\n rte_eth_ip_reassembly_dynfield_register(int *field_offset, int *flag);\n \n+/**\n+ * @internal\n+ * Register mbuf dynamic flag for rte_flow_get_restore_info.\n+ */\n+__rte_internal\n+int\n+rte_flow_restore_info_dynflag_register(uint64_t *flag);\n+\n \n /*\n  * Legacy ethdev API used internally by drivers.\ndiff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c\nindex 69e6e749f7..10cd9d12ba 100644\n--- a/lib/ethdev/rte_flow.c\n+++ b/lib/ethdev/rte_flow.c\n@@ -1401,6 +1401,35 @@ rte_flow_get_restore_info(uint16_t port_id,\n \t\t\t\t  NULL, rte_strerror(ENOTSUP));\n }\n \n+static struct {\n+\tconst struct rte_mbuf_dynflag desc;\n+\tuint64_t value;\n+} flow_restore_info_dynflag = {\n+\t.desc = { .name = \"RTE_MBUF_F_RX_RESTORE_INFO\", },\n+};\n+\n+uint64_t\n+rte_flow_restore_info_dynflag(void)\n+{\n+\treturn flow_restore_info_dynflag.value;\n+}\n+\n+int\n+rte_flow_restore_info_dynflag_register(uint64_t *flag)\n+{\n+\tif (flow_restore_info_dynflag.value == 0) {\n+\t\tint offset = rte_mbuf_dynflag_register(&flow_restore_info_dynflag.desc);\n+\n+\t\tif (offset < 0)\n+\t\t\treturn -1;\n+\t\tflow_restore_info_dynflag.value = RTE_BIT64(offset);\n+\t}\n+\tif (*flag)\n+\t\t*flag = rte_flow_restore_info_dynflag();\n+\n+\treturn 0;\n+}\n+\n int\n rte_flow_tunnel_action_decap_release(uint16_t port_id,\n \t\t\t\t     struct rte_flow_action *actions,\ndiff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h\nindex 713ba8b65c..5ce2db4bbd 100644\n--- a/lib/ethdev/rte_flow.h\n+++ b/lib/ethdev/rte_flow.h\n@@ -4918,7 +4918,24 @@ rte_flow_tunnel_match(uint16_t port_id,\n \t\t      struct rte_flow_error *error);\n \n /**\n- * Populate the current packet processing state, if exists, for the given mbuf.\n+ * On reception of a mbuf from HW, a call to rte_flow_get_restore_info() may be\n+ * required to retrieve some metadata.\n+ * This function returns the associated mbuf ol_flags.\n+ *\n+ * Note: the dynamic flag is registered during the probing of the first device\n+ * that requires it. If this function returns a non 0 value, this value won't\n+ * change for the rest of the life of the application.\n+ *\n+ * @return\n+ *   The offload flag indicating rte_flow_get_restore_info() must be called.\n+ */\n+__rte_experimental\n+uint64_t\n+rte_flow_restore_info_dynflag(void);\n+\n+/**\n+ * If a mbuf contains the rte_flow_restore_info_dynflag() flag in ol_flags,\n+ * populate the current packet processing state.\n  *\n  * One should negotiate tunnel metadata delivery from the NIC to the HW.\n  * @see rte_eth_rx_metadata_negotiate()\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 357d1a88c0..bf5668e928 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -299,6 +299,9 @@ EXPERIMENTAL {\n \trte_flow_action_handle_query_update;\n \trte_flow_async_action_handle_query_update;\n \trte_flow_async_create_by_index;\n+\n+\t# added in 23.07\n+\trte_flow_restore_info_dynflag;\n };\n \n INTERNAL {\n@@ -328,4 +331,5 @@ INTERNAL {\n \trte_eth_representor_id_get;\n \trte_eth_switch_domain_alloc;\n \trte_eth_switch_domain_free;\n+\trte_flow_restore_info_dynflag_register;\n };\n",
    "prefixes": [
        "RFC"
    ]
}