get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 137834,
    "url": "http://patches.dpdk.org/api/patches/137834/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240303173833.100039-21-hkalra@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20240303173833.100039-21-hkalra@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240303173833.100039-21-hkalra@marvell.com",
    "date": "2024-03-03T17:38:30",
    "name": "[v6,20/23] net/cnxk: add representor port pattern and action",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7f276c71d372979d674f0a69f7078c464ed8b838",
    "submitter": {
        "id": 1182,
        "url": "http://patches.dpdk.org/api/people/1182/?format=api",
        "name": "Harman Kalra",
        "email": "hkalra@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240303173833.100039-21-hkalra@marvell.com/mbox/",
    "series": [
        {
            "id": 31353,
            "url": "http://patches.dpdk.org/api/series/31353/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31353",
            "date": "2024-03-03T17:38:10",
            "name": "net/cnxk: support for port representors",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/31353/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/137834/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/137834/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 D726B43C3E;\n\tSun,  3 Mar 2024 18:41:13 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AA18543668;\n\tSun,  3 Mar 2024 18:39:42 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id C9A4243668\n for <dev@dpdk.org>; Sun,  3 Mar 2024 18:39:40 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 423GWjXN019709 for <dev@dpdk.org>; Sun, 3 Mar 2024 09:39:40 -0800",
            "from dc6wp-exch02.marvell.com ([4.21.29.225])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3wm2bptrvg-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Sun, 03 Mar 2024 09:39:39 -0800 (PST)",
            "from DC6WP-EXCH02.marvell.com (10.76.176.209) by\n DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1258.12; Sun, 3 Mar 2024 09:39:38 -0800",
            "from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com\n (10.76.176.209) with Microsoft SMTP Server id 15.2.1258.12 via Frontend\n Transport; Sun, 3 Mar 2024 09:39:38 -0800",
            "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id 2EF3F3F71A8;\n Sun,  3 Mar 2024 09:39:35 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-type; s=pfpt0220; bh=pcrcv2I7Kbutgh0GRKAUS\n VZ72NHY2uAJW52EQf9viFo=; b=hvrQvJoxG9uzi6out4gwTi8on73U+ZEblvmHQ\n 4bbdUFwUTIhiI+5OYZ9ps3RfiD9bhKxz5h6WQj/4fS2Z44K8GG+9NzOqPsmOGp43\n NkosfaRFS73lCp/UVCdDI3cAYRGNcHZv0PoI22eiWtGy0NVMh5zDb9Q5V0l8bcEI\n dkhKeOvSLxVBnp1ihZ3w7Ss7b7Q38uTagHQwCbDJ55ib1mTGrjiIENyUtA6RBKrI\n 0IUr+InH4ytJbr359M30o2j9HDrwo6LcuTpURTgGnUyqxrO9oXpxdBu86Wok8GIq\n hQqt7nO81fDuIVTtZnFIdacrdVyQdNkAPNEI/QHH1t3zvHZqA==",
        "From": "Harman Kalra <hkalra@marvell.com>",
        "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>, Harman Kalra <hkalra@marvell.com>",
        "CC": "<dev@dpdk.org>",
        "Subject": "[PATCH v6 20/23] net/cnxk: add representor port pattern and action",
        "Date": "Sun, 3 Mar 2024 23:08:30 +0530",
        "Message-ID": "<20240303173833.100039-21-hkalra@marvell.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20240303173833.100039-1-hkalra@marvell.com>",
        "References": "<20230811163419.165790-1-hkalra@marvell.com>\n <20240303173833.100039-1-hkalra@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "jxhkkBRkpLT0HoGRRwmQ8thDumwX_zeO",
        "X-Proofpoint-ORIG-GUID": "jxhkkBRkpLT0HoGRRwmQ8thDumwX_zeO",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2024-03-03_08,2024-03-01_03,2023-05-22_02",
        "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": "Adding support for representor port as item matching and action.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n doc/guides/nics/cnxk.rst              |   1 +\n doc/guides/nics/features/cnxk.ini     |   2 +\n doc/guides/nics/features/cnxk_vec.ini |   2 +\n doc/guides/nics/features/cnxk_vf.ini  |   2 +\n drivers/net/cnxk/cnxk_flow.c          | 219 +++++++++++++++++++++++---\n drivers/net/cnxk/cnxk_rep.h           |  14 ++\n 6 files changed, 214 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst\nindex e156340cf0..e8c64ef34c 100644\n--- a/doc/guides/nics/cnxk.rst\n+++ b/doc/guides/nics/cnxk.rst\n@@ -39,6 +39,7 @@ Features of the CNXK Ethdev PMD are:\n - Queue based priority flow control support\n - Port representors\n - Represented port pattern matching and action\n+- Port representor pattern matching and action\n \n Prerequisites\n -------------\ndiff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini\nindex 8957eba46b..9603d2566e 100644\n--- a/doc/guides/nics/features/cnxk.ini\n+++ b/doc/guides/nics/features/cnxk.ini\n@@ -95,6 +95,7 @@ of_set_vlan_pcp      = Y\n of_set_vlan_vid      = Y\n pf                   = Y\n port_id              = Y\n+port_representor     = Y\n queue                = Y\n represented_port     = Y\n rss                  = Y\n@@ -102,3 +103,4 @@ sample               = Y\n security             = Y\n skip_cman            = Y\n vf                   = Y\n+vxlan_decap          = I\ndiff --git a/doc/guides/nics/features/cnxk_vec.ini b/doc/guides/nics/features/cnxk_vec.ini\nindex 193fd14fbb..96289059ec 100644\n--- a/doc/guides/nics/features/cnxk_vec.ini\n+++ b/doc/guides/nics/features/cnxk_vec.ini\n@@ -86,8 +86,10 @@ of_push_vlan         = Y\n of_set_vlan_pcp      = Y\n of_set_vlan_vid      = Y\n pf                   = Y\n+port_representor     = Y\n queue                = Y\n represented_port     = Y\n rss                  = Y\n security             = Y\n vf                   = Y\n+vxlan_decap          = I\ndiff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini\nindex 7ae49b8107..850c49c5be 100644\n--- a/doc/guides/nics/features/cnxk_vf.ini\n+++ b/doc/guides/nics/features/cnxk_vf.ini\n@@ -85,9 +85,11 @@ of_push_vlan         = Y\n of_set_vlan_pcp      = Y\n of_set_vlan_vid      = Y\n pf                   = Y\n+port_representor     = Y\n queue                = Y\n represented_port     = Y\n rss                  = Y\n security             = Y\n skip_cman            = Y\n vf                   = Y\n+vxlan_decap          = I\ndiff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c\nindex 7b684eb759..2cd88f0334 100644\n--- a/drivers/net/cnxk/cnxk_flow.c\n+++ b/drivers/net/cnxk/cnxk_flow.c\n@@ -2,6 +2,7 @@\n  * Copyright(C) 2021 Marvell.\n  */\n #include <cnxk_flow.h>\n+#include <cnxk_rep.h>\n \n const struct cnxk_rte_flow_term_info term[] = {\n \t[RTE_FLOW_ITEM_TYPE_ETH] = {ROC_NPC_ITEM_TYPE_ETH, sizeof(struct rte_flow_item_eth)},\n@@ -185,11 +186,44 @@ roc_npc_parse_sample_subaction(struct rte_eth_dev *eth_dev, const struct rte_flo\n \treturn 0;\n }\n \n+static int\n+representor_portid_action(struct roc_npc_action *in_actions, struct rte_eth_dev *portid_eth_dev,\n+\t\t\t  uint16_t *dst_pf_func, uint8_t has_tunnel_pattern, int *act_cnt)\n+{\n+\tstruct rte_eth_dev *rep_eth_dev = portid_eth_dev;\n+\tstruct rte_flow_action_mark *act_mark;\n+\tstruct cnxk_rep_dev *rep_dev;\n+\t/* For inserting an action in the list */\n+\tint i = *act_cnt;\n+\n+\trep_dev = cnxk_rep_pmd_priv(rep_eth_dev);\n+\t*dst_pf_func = rep_dev->hw_func;\n+\n+\t/* Add Mark action */\n+\ti++;\n+\tact_mark = plt_zmalloc(sizeof(struct rte_flow_action_mark), 0);\n+\tif (!act_mark) {\n+\t\tplt_err(\"Error allocation memory\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Mark ID format: (tunnel type - VxLAN, Geneve << 6) | Tunnel decap */\n+\tact_mark->id = has_tunnel_pattern ? ((has_tunnel_pattern << 6) | 5) : 1;\n+\tin_actions[i].type = ROC_NPC_ACTION_TYPE_MARK;\n+\tin_actions[i].conf = (struct rte_flow_action_mark *)act_mark;\n+\n+\t*act_cnt = i;\n+\tplt_rep_dbg(\"Rep port %d ID %d mark ID is %d rep_dev->hw_func 0x%x\", rep_dev->port_id,\n+\t\t    rep_dev->rep_id, act_mark->id, rep_dev->hw_func);\n+\n+\treturn 0;\n+}\n+\n static int\n cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \t\t const struct rte_flow_action actions[], struct roc_npc_action in_actions[],\n \t\t struct roc_npc_action_sample *in_sample_actions, uint32_t *flowkey_cfg,\n-\t\t uint16_t *dst_pf_func)\n+\t\t uint16_t *dst_pf_func, uint8_t has_tunnel_pattern)\n {\n \tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n \tconst struct rte_flow_action_queue *act_q = NULL;\n@@ -238,6 +272,7 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \t\t\tbreak;\n \n \t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n+\t\tcase RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:\n \t\tcase RTE_FLOW_ACTION_TYPE_PORT_ID:\n \t\t\tin_actions[i].type = ROC_NPC_ACTION_TYPE_PORT_ID;\n \t\t\tin_actions[i].conf = actions->conf;\n@@ -256,14 +291,27 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \t\t\t\tplt_err(\"eth_dev not found for output port id\");\n \t\t\t\tgoto err_exit;\n \t\t\t}\n-\t\t\tif (strcmp(portid_eth_dev->device->driver->name,\n-\t\t\t\t   eth_dev->device->driver->name) != 0) {\n-\t\t\t\tplt_err(\"Output port not under same driver\");\n-\t\t\t\tgoto err_exit;\n+\n+\t\t\tif (cnxk_ethdev_is_representor(if_name)) {\n+\t\t\t\tplt_rep_dbg(\"Representor port %d act port %d\", port_act->id,\n+\t\t\t\t\t    act_ethdev->port_id);\n+\t\t\t\tif (representor_portid_action(in_actions, portid_eth_dev,\n+\t\t\t\t\t\t\t      dst_pf_func, has_tunnel_pattern,\n+\t\t\t\t\t\t\t      &i)) {\n+\t\t\t\t\tplt_err(\"Representor port action set failed\");\n+\t\t\t\t\tgoto err_exit;\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tif (strcmp(portid_eth_dev->device->driver->name,\n+\t\t\t\t\t   eth_dev->device->driver->name) != 0) {\n+\t\t\t\t\tplt_err(\"Output port not under same driver\");\n+\t\t\t\t\tgoto err_exit;\n+\t\t\t\t}\n+\n+\t\t\t\thw_dst = portid_eth_dev->data->dev_private;\n+\t\t\t\troc_npc_dst = &hw_dst->npc;\n+\t\t\t\t*dst_pf_func = roc_npc_dst->pf_func;\n \t\t\t}\n-\t\t\thw_dst = portid_eth_dev->data->dev_private;\n-\t\t\troc_npc_dst = &hw_dst->npc;\n-\t\t\t*dst_pf_func = roc_npc_dst->pf_func;\n \t\t\tbreak;\n \n \t\tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n@@ -324,6 +372,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \t\t\tin_actions[i].type = ROC_NPC_ACTION_TYPE_SAMPLE;\n \t\t\tin_actions[i].conf = in_sample_actions;\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\n+\t\t\tcontinue;\n \t\tdefault:\n \t\t\tplt_npc_dbg(\"Action is not supported = %d\", actions->type);\n \t\t\tgoto err_exit;\n@@ -346,12 +396,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n }\n \n static int\n-cnxk_map_flow_data(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n-\t\t   const struct rte_flow_item pattern[], const struct rte_flow_action actions[],\n-\t\t   struct roc_npc_attr *in_attr, struct roc_npc_item_info in_pattern[],\n-\t\t   struct roc_npc_action in_actions[],\n-\t\t   struct roc_npc_action_sample *in_sample_actions, uint32_t *flowkey_cfg,\n-\t\t   uint16_t *dst_pf_func)\n+cnxk_map_pattern(struct rte_eth_dev *eth_dev, const struct rte_flow_item pattern[],\n+\t\t struct roc_npc_item_info in_pattern[], uint8_t *has_tunnel_pattern)\n {\n \tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n \tconst struct rte_flow_item_ethdev *rep_eth_dev;\n@@ -360,10 +406,6 @@ cnxk_map_flow_data(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr\n \tstruct cnxk_eth_dev *hw_dst;\n \tint i = 0;\n \n-\tin_attr->priority = attr->priority;\n-\tin_attr->ingress = attr->ingress;\n-\tin_attr->egress = attr->egress;\n-\n \twhile (pattern->type != RTE_FLOW_ITEM_TYPE_END) {\n \t\tin_pattern[i].spec = pattern->spec;\n \t\tin_pattern[i].last = pattern->last;\n@@ -374,30 +416,81 @@ cnxk_map_flow_data(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr\n \t\t\trep_eth_dev = (const struct rte_flow_item_ethdev *)pattern->spec;\n \t\t\tif (rte_eth_dev_get_name_by_port(rep_eth_dev->port_id, if_name)) {\n \t\t\t\tplt_err(\"Name not found for output port id\");\n-\t\t\t\treturn -EINVAL;\n+\t\t\t\tgoto fail;\n \t\t\t}\n \t\t\tportid_eth_dev = rte_eth_dev_allocated(if_name);\n \t\t\tif (!portid_eth_dev) {\n \t\t\t\tplt_err(\"eth_dev not found for output port id\");\n-\t\t\t\treturn -EINVAL;\n+\t\t\t\tgoto fail;\n \t\t\t}\n \t\t\tif (strcmp(portid_eth_dev->device->driver->name,\n \t\t\t\t   eth_dev->device->driver->name) != 0) {\n \t\t\t\tplt_err(\"Output port not under same driver\");\n-\t\t\t\treturn -EINVAL;\n+\t\t\t\tgoto fail;\n+\t\t\t}\n+\t\t\tif (cnxk_ethdev_is_representor(if_name)) {\n+\t\t\t\t/* Case where represented port not part of same\n+\t\t\t\t * app and represented by a representor port.\n+\t\t\t\t */\n+\t\t\t\tstruct cnxk_rep_dev *rep_dev;\n+\t\t\t\tstruct cnxk_eswitch_dev *eswitch_dev;\n+\n+\t\t\t\trep_dev = cnxk_rep_pmd_priv(portid_eth_dev);\n+\t\t\t\teswitch_dev = rep_dev->parent_dev;\n+\t\t\t\tdev->npc.rep_npc = &eswitch_dev->npc;\n+\t\t\t\tdev->npc.rep_port_id = rep_eth_dev->port_id;\n+\t\t\t\tdev->npc.rep_pf_func = rep_dev->hw_func;\n+\t\t\t\tplt_rep_dbg(\"Represented port %d act port %d rep_dev->hw_func 0x%x\",\n+\t\t\t\t\t    rep_eth_dev->port_id, eth_dev->data->port_id,\n+\t\t\t\t\t    rep_dev->hw_func);\n+\t\t\t} else {\n+\t\t\t\t/* Case where represented port part of same app\n+\t\t\t\t * as PF.\n+\t\t\t\t */\n+\t\t\t\thw_dst = portid_eth_dev->data->dev_private;\n+\t\t\t\tdev->npc.rep_npc = &hw_dst->npc;\n+\t\t\t\tdev->npc.rep_port_id = rep_eth_dev->port_id;\n+\t\t\t\tdev->npc.rep_pf_func = hw_dst->npc.pf_func;\n \t\t\t}\n-\t\t\thw_dst = portid_eth_dev->data->dev_private;\n-\t\t\tdev->npc.rep_npc = &hw_dst->npc;\n-\t\t\tdev->npc.rep_port_id = rep_eth_dev->port_id;\n-\t\t\tdev->npc.rep_pf_func = hw_dst->npc.pf_func;\n \t\t}\n+\n+\t\tif (pattern->type == RTE_FLOW_ITEM_TYPE_VXLAN ||\n+\t\t    pattern->type == RTE_FLOW_ITEM_TYPE_VXLAN_GPE ||\n+\t\t    pattern->type == RTE_FLOW_ITEM_TYPE_GRE)\n+\t\t\t*has_tunnel_pattern = pattern->type;\n+\n \t\tpattern++;\n \t\ti++;\n \t}\n \tin_pattern[i].type = ROC_NPC_ITEM_TYPE_END;\n+\treturn 0;\n+fail:\n+\treturn -EINVAL;\n+}\n+\n+static int\n+cnxk_map_flow_data(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n+\t\t   const struct rte_flow_item pattern[], const struct rte_flow_action actions[],\n+\t\t   struct roc_npc_attr *in_attr, struct roc_npc_item_info in_pattern[],\n+\t\t   struct roc_npc_action in_actions[],\n+\t\t   struct roc_npc_action_sample *in_sample_actions, uint32_t *flowkey_cfg,\n+\t\t   uint16_t *dst_pf_func)\n+{\n+\tuint8_t has_tunnel_pattern = 0;\n+\tint rc;\n+\n+\tin_attr->priority = attr->priority;\n+\tin_attr->ingress = attr->ingress;\n+\tin_attr->egress = attr->egress;\n+\n+\trc = cnxk_map_pattern(eth_dev, pattern, in_pattern, &has_tunnel_pattern);\n+\tif (rc) {\n+\t\tplt_err(\"Failed to map pattern list\");\n+\t\treturn rc;\n+\t}\n \n \treturn cnxk_map_actions(eth_dev, attr, actions, in_actions, in_sample_actions, flowkey_cfg,\n-\t\t\t\tdst_pf_func);\n+\t\t\t\tdst_pf_func, has_tunnel_pattern);\n }\n \n static int\n@@ -461,6 +554,7 @@ cnxk_flow_create(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \tint rc;\n \n \tmemset(&in_sample_action, 0, sizeof(in_sample_action));\n+\tmemset(&in_attr, 0, sizeof(struct roc_npc_attr));\n \trc = cnxk_map_flow_data(eth_dev, attr, pattern, actions, &in_attr, in_pattern, in_actions,\n \t\t\t\t&in_sample_action, &npc->flowkey_cfg_state, &dst_pf_func);\n \tif (rc) {\n@@ -649,6 +743,75 @@ cnxk_flow_get_aged_flows(struct rte_eth_dev *eth_dev, void **context,\n \treturn cnt;\n }\n \n+static int\n+cnxk_flow_tunnel_decap_set(__rte_unused struct rte_eth_dev *dev, struct rte_flow_tunnel *tunnel,\n+\t\t\t   struct rte_flow_action **pmd_actions, uint32_t *num_of_actions,\n+\t\t\t   __rte_unused struct rte_flow_error *err)\n+{\n+\tstruct rte_flow_action *nfp_action;\n+\n+\tnfp_action = rte_zmalloc(\"nfp_tun_action\", sizeof(struct rte_flow_action), 0);\n+\tif (nfp_action == NULL) {\n+\t\tplt_err(\"Alloc memory for nfp tunnel action failed.\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tif (tunnel->is_ipv6)\n+\t\tnfp_action->conf = (void *)~0;\n+\n+\tswitch (tunnel->type) {\n+\tcase RTE_FLOW_ITEM_TYPE_VXLAN:\n+\t\tnfp_action->type = RTE_FLOW_ACTION_TYPE_VXLAN_DECAP;\n+\t\t*pmd_actions = nfp_action;\n+\t\t*num_of_actions = 1;\n+\t\tbreak;\n+\tdefault:\n+\t\t*pmd_actions = NULL;\n+\t\t*num_of_actions = 0;\n+\t\trte_free(nfp_action);\n+\t\tbreak;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+cnxk_flow_tunnel_action_decap_release(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t\t      struct rte_flow_action *pmd_actions, uint32_t num_of_actions,\n+\t\t\t\t      __rte_unused struct rte_flow_error *err)\n+{\n+\tuint32_t i;\n+\tstruct rte_flow_action *nfp_action;\n+\n+\tfor (i = 0; i < num_of_actions; i++) {\n+\t\tnfp_action = &pmd_actions[i];\n+\t\tnfp_action->conf = NULL;\n+\t\trte_free(nfp_action);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+cnxk_flow_tunnel_match(__rte_unused struct rte_eth_dev *dev,\n+\t\t       __rte_unused struct rte_flow_tunnel *tunnel,\n+\t\t       __rte_unused struct rte_flow_item **pmd_items, uint32_t *num_of_items,\n+\t\t       __rte_unused struct rte_flow_error *err)\n+{\n+\t*num_of_items = 0;\n+\n+\treturn 0;\n+}\n+\n+static int\n+cnxk_flow_tunnel_item_release(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t      __rte_unused struct rte_flow_item *pmd_items,\n+\t\t\t      __rte_unused uint32_t num_of_items,\n+\t\t\t      __rte_unused struct rte_flow_error *err)\n+{\n+\treturn 0;\n+}\n+\n struct rte_flow_ops cnxk_flow_ops = {\n \t.validate = cnxk_flow_validate,\n \t.flush = cnxk_flow_flush,\n@@ -656,4 +819,8 @@ struct rte_flow_ops cnxk_flow_ops = {\n \t.isolate = cnxk_flow_isolate,\n \t.dev_dump = cnxk_flow_dev_dump,\n \t.get_aged_flows = cnxk_flow_get_aged_flows,\n+\t.tunnel_match = cnxk_flow_tunnel_match,\n+\t.tunnel_item_release = cnxk_flow_tunnel_item_release,\n+\t.tunnel_decap_set = cnxk_flow_tunnel_decap_set,\n+\t.tunnel_action_decap_release = cnxk_flow_tunnel_action_decap_release,\n };\ndiff --git a/drivers/net/cnxk/cnxk_rep.h b/drivers/net/cnxk/cnxk_rep.h\nindex 51a2e97624..ab8b3fb152 100644\n--- a/drivers/net/cnxk/cnxk_rep.h\n+++ b/drivers/net/cnxk/cnxk_rep.h\n@@ -1,6 +1,9 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  * Copyright(C) 2024 Marvell.\n  */\n+\n+#include <regex.h>\n+\n #include <cnxk_eswitch.h>\n #include <cnxk_ethdev.h>\n \n@@ -91,6 +94,17 @@ cnxk_rep_pool_buffer_stats(struct rte_mempool *pool)\n \t\t    pool->size, rte_mempool_in_use_count(pool), rte_mempool_avail_count(pool));\n }\n \n+static inline int\n+cnxk_ethdev_is_representor(const char *if_name)\n+{\n+\tregex_t regex;\n+\tint val;\n+\n+\tval = regcomp(&regex, \"net_.*_representor_.*\", 0);\n+\tval = regexec(&regex, if_name, 0, NULL, 0);\n+\treturn (val == 0);\n+}\n+\n /* Prototypes */\n int cnxk_rep_dev_probe(struct rte_pci_device *pci_dev, struct cnxk_eswitch_dev *eswitch_dev);\n int cnxk_rep_dev_remove(struct cnxk_eswitch_dev *eswitch_dev);\n",
    "prefixes": [
        "v6",
        "20/23"
    ]
}