get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74406,
    "url": "http://patches.dpdk.org/api/patches/74406/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200718072515.62969-6-ajit.khaparde@broadcom.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": "<20200718072515.62969-6-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200718072515.62969-6-ajit.khaparde@broadcom.com",
    "date": "2020-07-18T07:25:06",
    "name": "[v3,05/14] net/bnxt: add protocol header info based on proto field data",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "543f593f31e50dd71f563a6ec55d9f328e8ddd78",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200718072515.62969-6-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 11142,
            "url": "http://patches.dpdk.org/api/series/11142/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11142",
            "date": "2020-07-18T07:25:01",
            "name": "bnxt patches",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/11142/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74406/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74406/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 AA96BA052A;\n\tSat, 18 Jul 2020 09:26:37 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B050B1BFD4;\n\tSat, 18 Jul 2020 09:25:41 +0200 (CEST)",
            "from mail-wr1-f99.google.com (mail-wr1-f99.google.com\n [209.85.221.99]) by dpdk.org (Postfix) with ESMTP id 02FDD1BFC6\n for <dev@dpdk.org>; Sat, 18 Jul 2020 09:25:37 +0200 (CEST)",
            "by mail-wr1-f99.google.com with SMTP id f7so13298465wrw.1\n for <dev@dpdk.org>; Sat, 18 Jul 2020 00:25:36 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id g14sm34554wrb.16.2020.07.18.00.25.34\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Sat, 18 Jul 2020 00:25:36 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=9aNqM6jlgDrcxWq+dkaWPR2rbpJoBH7ZvoNOZFbyzns=;\n b=b81X8nXy6PfqgOV2lQ4ywyn7X0ycxDj21Pc6rE/KFhHA2xrwk0SvVcWwkxU2eJXjtw\n xhy/f3rdtqSq7KrjEXRad+q6T5TrtdxBKle1L0a4iveJy9YI54wCN1BB3OaGW2VTx5/P\n QgqCZp1NvxQHbQ9TruiT8thCR586abxsD+G8g=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=9aNqM6jlgDrcxWq+dkaWPR2rbpJoBH7ZvoNOZFbyzns=;\n b=dibkRNxbD2vkbH7/eimOBtQrqD2f7jzP/4eWKkNv4AdGoYBI6pM43050qU44N5Xs4N\n 6veRwfpFDt3HuUKNHaMPJxRDLCAieHjwVc62W7yKop5NZ+YoqFrVGsIHStw4VXVhXLwV\n ez64diGk2jStfnQyiz1fh/wmLvPGh4onhjBQDVTiLosgkex26LdPt7NnN7Hhgf4JXzq4\n R6LvF3tJDRcqCjLtmAym3F9lLla9PHzW42Ng8pKpjWKLbPY0UHD2KE001SHJNiGS+PqZ\n unWri1JonBzQheH1NXSLrm/of7EdLQpwhmH9N3QHL9J3p/PuP7VAlekwrlJ3qRxmr033\n OlwQ==",
        "X-Gm-Message-State": "AOAM530EmMc4DXviJOetHOxgKwYp7p75z7cUpUXl8mZQFK3jY68GP0Lm\n W/vLWGM25VOTakRvx9vSqns3lMc4ajXifNspGxVpjgc8RczdaysjIuXvzhiTO4xwqhRYSL0rxa3\n aOXTp310BEXPY7G96pR16rGJesMU92dkXcDfs/rgHNV4hp/yeR/YlK8CicoqUZki5+yx5giXAyz\n OZlQ==",
        "X-Google-Smtp-Source": "\n ABdhPJxoX52wYD43YzKy+SVFu7+7CzvUj9raEQphwJHADgKC7bBA5e/Ap6+MIPH+2w2h0DDi1lttjZB3Xzyc",
        "X-Received": "by 2002:adf:9f12:: with SMTP id l18mr1239654wrf.35.1595057136382;\n Sat, 18 Jul 2020 00:25:36 -0700 (PDT)",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Somnath Kotur <somnath.kotur@broadcom.com>,\n Michael Baucom <michael.baucom@broadcom.com>",
        "Date": "Sat, 18 Jul 2020 00:25:06 -0700",
        "Message-Id": "<20200718072515.62969-6-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20200718072515.62969-1-ajit.khaparde@broadcom.com>",
        "References": "<20200717141451.11705-1-somnath.kotur@broadcom.com>\n <20200718072515.62969-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 05/14] net/bnxt: add protocol header info\n\tbased on proto field data",
        "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": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nThe protocol header are implicitly matched based on the proto\nfield data. For instance, if ether type is set as 0x800 in the\nether header then ipv4 protocol header is assumed to be present\nfor template matching even if ipv4 header is not present in the\ngiven flow pattern.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 180 +++++++++++++-----\n .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   4 +-\n drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   1 +\n 3 files changed, 140 insertions(+), 45 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\nindex 4c1221aed..3891bcdc1 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n@@ -16,6 +16,7 @@\n #define ULP_VLAN_PRIORITY_SHIFT\t\t13 /* First 3 bits */\n #define ULP_VLAN_PRIORITY_MASK\t\t0x700\n #define ULP_VLAN_TAG_MASK\t\t0xFFF /* Last 12 bits*/\n+#define ULP_UDP_PORT_VXLAN\t\t4789\n \n /* Utility function to skip the void items. */\n static inline int32_t\n@@ -209,6 +210,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)\n \t\t}\n \t}\n \n+\t/* Merge the hdr_fp_bit into the proto header bit */\n+\tparams->hdr_bitmap.bits |= params->hdr_fp_bit.bits;\n+\n \t/* TBD: Handle the flow rejection scenarios */\n \treturn 0;\n }\n@@ -493,6 +497,34 @@ ulp_rte_phy_port_hdr_handler(const struct rte_flow_item *item,\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n+/* Function to handle the update of proto header based on field values */\n+static void\n+ulp_rte_l2_proto_type_update(struct ulp_rte_parser_params *param,\n+\t\t\t     uint16_t type, uint32_t in_flag)\n+{\n+\tif (type == tfp_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) {\n+\t\tif (in_flag) {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_I_IPV4);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L3, 1);\n+\t\t} else {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_O_IPV4);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L3, 1);\n+\t\t}\n+\t} else if (type == tfp_cpu_to_be_16(RTE_ETHER_TYPE_IPV6))  {\n+\t\tif (in_flag) {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_I_IPV6);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L3, 1);\n+\t\t} else {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_O_IPV6);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L3, 1);\n+\t\t}\n+\t}\n+}\n+\n /* Function to handle the parsing of RTE Flow item Ethernet Header. */\n int32_t\n ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,\n@@ -502,8 +534,9 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,\n \tconst struct rte_flow_item_eth *eth_mask = item->mask;\n \tstruct ulp_rte_hdr_field *field;\n \tuint32_t idx = params->field_idx;\n-\tuint64_t set_flag = 0;\n \tuint32_t size;\n+\tuint16_t eth_type = 0;\n+\tuint32_t inner_flag = 0;\n \n \t/*\n \t * Copy the rte_flow_item for eth into hdr_field using ethernet\n@@ -521,6 +554,7 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&eth_spec->type,\n \t\t\t\t\t\tsizeof(eth_spec->type));\n+\t\teth_type = eth_spec->type;\n \t}\n \tif (eth_mask) {\n \t\tulp_rte_prsr_mask_copy(params, &idx, eth_mask->dst.addr_bytes,\n@@ -535,17 +569,15 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,\n \tparams->vlan_idx = params->field_idx;\n \tparams->field_idx += BNXT_ULP_PROTO_HDR_VLAN_NUM;\n \n-\t/* Update the hdr_bitmap with BNXT_ULP_HDR_PROTO_I_ETH */\n-\tset_flag = ULP_BITMAP_ISSET(params->hdr_bitmap.bits,\n-\t\t\t\t    BNXT_ULP_HDR_BIT_O_ETH);\n-\tif (set_flag)\n+\t/* Update the protocol hdr bitmap */\n+\tif (ULP_BITMAP_ISSET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH)) {\n \t\tULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_I_ETH);\n-\telse\n-\t\tULP_BITMAP_RESET(params->hdr_bitmap.bits,\n-\t\t\t\t BNXT_ULP_HDR_BIT_I_ETH);\n-\n-\t/* update the hdr_bitmap with BNXT_ULP_HDR_PROTO_O_ETH */\n-\tULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH);\n+\t\tinner_flag = 1;\n+\t} else {\n+\t\tULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH);\n+\t}\n+\t/* Update the field protocol hdr bitmap */\n+\tulp_rte_l2_proto_type_update(params, eth_type, inner_flag);\n \n \treturn BNXT_TF_RC_SUCCESS;\n }\n@@ -563,6 +595,8 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \tuint16_t vlan_tag, priority;\n \tuint32_t outer_vtag_num;\n \tuint32_t inner_vtag_num;\n+\tuint16_t eth_type = 0;\n+\tuint32_t inner_flag = 0;\n \n \t/*\n \t * Copy the rte_flow_item for vlan into hdr_field using Vlan\n@@ -583,6 +617,7 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&vlan_spec->inner_type,\n \t\t\t\t\t\tsizeof(vlan_spec->inner_type));\n+\t\teth_type = vlan_spec->inner_type;\n \t}\n \n \tif (vlan_mask) {\n@@ -653,6 +688,7 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_ONE_VTAG, 1);\n \t\tULP_BITMAP_SET(params->hdr_bitmap.bits,\n \t\t\t       BNXT_ULP_HDR_BIT_IO_VLAN);\n+\t\tinner_flag = 1;\n \t} else if (ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_O_ETH) &&\n \t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_I_ETH) &&\n \t\t   inner_vtag_num == 1) {\n@@ -664,13 +700,44 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_ONE_VTAG, 0);\n \t\tULP_BITMAP_SET(params->hdr_bitmap.bits,\n \t\t\t       BNXT_ULP_HDR_BIT_II_VLAN);\n+\t\tinner_flag = 1;\n \t} else {\n \t\tBNXT_TF_DBG(ERR, \"Error Parsing:Vlan hdr found withtout eth\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n+\t/* Update the field protocol hdr bitmap */\n+\tulp_rte_l2_proto_type_update(params, eth_type, inner_flag);\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n+/* Function to handle the update of proto header based on field values */\n+static void\n+ulp_rte_l3_proto_type_update(struct ulp_rte_parser_params *param,\n+\t\t\t     uint8_t proto, uint32_t in_flag)\n+{\n+\tif (proto == IPPROTO_UDP) {\n+\t\tif (in_flag) {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_I_UDP);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L4, 1);\n+\t\t} else {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_O_UDP);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L4, 1);\n+\t\t}\n+\t} else if (proto == IPPROTO_TCP) {\n+\t\tif (in_flag) {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_I_TCP);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L4, 1);\n+\t\t} else {\n+\t\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t\t       BNXT_ULP_HDR_BIT_O_TCP);\n+\t\t\tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L4, 1);\n+\t\t}\n+\t}\n+}\n+\n /* Function to handle the parsing of RTE Flow item IPV4 Header. */\n int32_t\n ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,\n@@ -682,11 +749,14 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,\n \tstruct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;\n \tuint32_t idx = params->field_idx;\n \tuint32_t size;\n-\tuint32_t inner_l3, outer_l3;\n-\n-\tinner_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L3);\n-\tif (inner_l3) {\n-\t\tBNXT_TF_DBG(ERR, \"Parse Error:Third L3 header not supported\\n\");\n+\tuint8_t proto = 0;\n+\tuint32_t inner_flag = 0;\n+\tuint32_t cnt;\n+\n+\t/* validate there are no 3rd L3 header */\n+\tcnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_HDR_CNT);\n+\tif (cnt == 2) {\n+\t\tBNXT_TF_DBG(ERR, \"Parse Err:Third L3 header not supported\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n \n@@ -723,6 +793,7 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&ipv4_spec->hdr.next_proto_id,\n \t\t\t\t\t\tsize);\n+\t\tproto = ipv4_spec->hdr.next_proto_id;\n \t\tsize = sizeof(ipv4_spec->hdr.hdr_checksum);\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&ipv4_spec->hdr.hdr_checksum,\n@@ -782,18 +853,19 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,\n \tparams->field_idx += BNXT_ULP_PROTO_HDR_IPV4_NUM;\n \n \t/* Set the ipv4 header bitmap and computed l3 header bitmaps */\n-\touter_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L3);\n-\tif (outer_l3 ||\n-\t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||\n+\tif (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||\n \t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6)) {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_IPV4);\n-\t\tinner_l3++;\n-\t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, inner_l3);\n+\t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, 1);\n+\t\tinner_flag = 1;\n \t} else {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4);\n-\t\touter_l3++;\n-\t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, outer_l3);\n+\t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, 1);\n \t}\n+\n+\t/* Update the field protocol hdr bitmap */\n+\tulp_rte_l3_proto_type_update(params, proto, inner_flag);\n+\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_HDR_CNT, ++cnt);\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n@@ -808,12 +880,15 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,\n \tstruct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;\n \tuint32_t idx = params->field_idx;\n \tuint32_t size;\n-\tuint32_t inner_l3, outer_l3;\n \tuint32_t vtcf, vtcf_mask;\n-\n-\tinner_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L3);\n-\tif (inner_l3) {\n-\t\tBNXT_TF_DBG(ERR, \"Parse Error: 3'rd L3 header not supported\\n\");\n+\tuint8_t proto = 0;\n+\tuint32_t inner_flag = 0;\n+\tuint32_t cnt;\n+\n+\t/* validate there are no 3rd L3 header */\n+\tcnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_HDR_CNT);\n+\tif (cnt == 2) {\n+\t\tBNXT_TF_DBG(ERR, \"Parse Err:Third L3 header not supported\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n \n@@ -847,6 +922,7 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&ipv6_spec->hdr.proto,\n \t\t\t\t\t\tsize);\n+\t\tproto = ipv6_spec->hdr.proto;\n \t\tsize = sizeof(ipv6_spec->hdr.hop_limits);\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&ipv6_spec->hdr.hop_limits,\n@@ -899,19 +975,33 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,\n \tparams->field_idx += BNXT_ULP_PROTO_HDR_IPV6_NUM;\n \n \t/* Set the ipv6 header bitmap and computed l3 header bitmaps */\n-\touter_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L3);\n-\tif (outer_l3 ||\n-\t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||\n+\tif (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||\n \t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6)) {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_IPV6);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, 1);\n+\t\tinner_flag = 1;\n \t} else {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, 1);\n \t}\n+\n+\t/* Update the field protocol hdr bitmap */\n+\tulp_rte_l3_proto_type_update(params, proto, inner_flag);\n+\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_HDR_CNT, ++cnt);\n+\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n+/* Function to handle the update of proto header based on field values */\n+static void\n+ulp_rte_l4_proto_type_update(struct ulp_rte_parser_params *param,\n+\t\t\t     uint16_t dst_port)\n+{\n+\tif (dst_port == tfp_cpu_to_be_16(ULP_UDP_PORT_VXLAN))\n+\t\tULP_BITMAP_SET(param->hdr_fp_bit.bits,\n+\t\t\t       BNXT_ULP_HDR_BIT_T_VXLAN);\n+}\n+\n /* Function to handle the parsing of RTE Flow item UDP Header. */\n int32_t\n ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,\n@@ -923,10 +1013,11 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,\n \tstruct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;\n \tuint32_t idx = params->field_idx;\n \tuint32_t size;\n-\tuint32_t inner_l4, outer_l4;\n+\tuint16_t dst_port = 0;\n+\tuint32_t cnt;\n \n-\tinner_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L4);\n-\tif (inner_l4) {\n+\tcnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L4_HDR_CNT);\n+\tif (cnt == 2) {\n \t\tBNXT_TF_DBG(ERR, \"Parse Err:Third L4 header not supported\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n@@ -944,6 +1035,7 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&udp_spec->hdr.dst_port,\n \t\t\t\t\t\tsize);\n+\t\tdst_port = udp_spec->hdr.dst_port;\n \t\tsize = sizeof(udp_spec->hdr.dgram_len);\n \t\tfield = ulp_rte_parser_fld_copy(field,\n \t\t\t\t\t\t&udp_spec->hdr.dgram_len,\n@@ -972,16 +1064,17 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,\n \tparams->field_idx += BNXT_ULP_PROTO_HDR_UDP_NUM;\n \n \t/* Set the udp header bitmap and computed l4 header bitmaps */\n-\touter_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L4);\n-\tif (outer_l4 ||\n-\t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) ||\n+\tif (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) ||\n \t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_UDP);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1);\n \t} else {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1);\n+\t\t/* Update the field protocol hdr bitmap */\n+\t\tulp_rte_l4_proto_type_update(params, dst_port);\n \t}\n+\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt);\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n@@ -996,11 +1089,11 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,\n \tstruct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;\n \tuint32_t idx = params->field_idx;\n \tuint32_t size;\n-\tuint32_t inner_l4, outer_l4;\n+\tuint32_t cnt;\n \n-\tinner_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L4);\n-\tif (inner_l4) {\n-\t\tBNXT_TF_DBG(ERR, \"Parse Error:Third L4 header not supported\\n\");\n+\tcnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L4_HDR_CNT);\n+\tif (cnt == 2) {\n+\t\tBNXT_TF_DBG(ERR, \"Parse Err:Third L4 header not supported\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n \n@@ -1082,9 +1175,7 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,\n \tparams->field_idx += BNXT_ULP_PROTO_HDR_TCP_NUM;\n \n \t/* Set the udp header bitmap and computed l4 header bitmaps */\n-\touter_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L4);\n-\tif (outer_l4 ||\n-\t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) ||\n+\tif (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) ||\n \t    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) {\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_TCP);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1);\n@@ -1092,6 +1183,7 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,\n \t\tULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP);\n \t\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1);\n \t}\n+\tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt);\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\nindex 6b68b9576..a9295e006 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h\n@@ -132,7 +132,9 @@ enum bnxt_ulp_cf_idx {\n \tBNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36,\n \tBNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37,\n \tBNXT_ULP_CF_IDX_VF_TO_VF = 38,\n-\tBNXT_ULP_CF_IDX_LAST = 39\n+\tBNXT_ULP_CF_IDX_L3_HDR_CNT = 39,\n+\tBNXT_ULP_CF_IDX_L4_HDR_CNT = 40,\n+\tBNXT_ULP_CF_IDX_LAST = 41\n };\n \n enum bnxt_ulp_cond_opcode {\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\nindex 2f2f9a2d1..b9a25b064 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n@@ -63,6 +63,7 @@ struct ulp_rte_act_prop {\n /* Structure to be used for passing all the parser functions */\n struct ulp_rte_parser_params {\n \tstruct ulp_rte_hdr_bitmap\thdr_bitmap;\n+\tstruct ulp_rte_hdr_bitmap\thdr_fp_bit;\n \tstruct ulp_rte_field_bitmap\tfld_bitmap;\n \tstruct ulp_rte_hdr_field\thdr_field[BNXT_ULP_PROTO_HDR_MAX];\n \tuint32_t\t\t\tcomp_fld[BNXT_ULP_CF_IDX_LAST];\n",
    "prefixes": [
        "v3",
        "05/14"
    ]
}