get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74386,
    "url": "http://patches.dpdk.org/api/patches/74386/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200717141451.11705-6-somnath.kotur@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": "<20200717141451.11705-6-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200717141451.11705-6-somnath.kotur@broadcom.com",
    "date": "2020-07-17T14:14:42",
    "name": "[05/14] net/bnxt: add protocol header info based on proto field data",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "543f593f31e50dd71f563a6ec55d9f328e8ddd78",
    "submitter": {
        "id": 908,
        "url": "http://patches.dpdk.org/api/people/908/?format=api",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@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/20200717141451.11705-6-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 11136,
            "url": "http://patches.dpdk.org/api/series/11136/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11136",
            "date": "2020-07-17T14:14:37",
            "name": "bnxt patches",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/11136/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74386/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74386/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 84ACEA053B;\n\tFri, 17 Jul 2020 16:21:12 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3D67D1C069;\n\tFri, 17 Jul 2020 16:20:16 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.211.62])\n by dpdk.org (Postfix) with ESMTP id D85591BF67\n for <dev@dpdk.org>; Fri, 17 Jul 2020 16:20:07 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 1B45E299BC0;\n Fri, 17 Jul 2020 07:20:07 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 1B45E299BC0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1594995607;\n bh=LvKZepKw8uId0JoAFhXKAJfBBv52gBLj/DBNfhLOKPs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=J3Pjlic//X1G872YoD5cpUlk9HsPGU9ZBYwfSDQ2wmRXfj7kc9MAXqEdhd/k09l1K\n 1MFFAHP6Cn5zW8ljH4SdNsFKgxLwl6PPqeUlTMPzn2aPu+kYHtt+rLXDFOXiO1Fk9t\n 2xdvWAP381omoH/F1aj/3rEIfcIGzfOCvVMcMuOc=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Fri, 17 Jul 2020 19:44:42 +0530",
        "Message-Id": "<20200717141451.11705-6-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200717141451.11705-1-somnath.kotur@broadcom.com>",
        "References": "<20200717094935.9337-1-somnath.kotur@broadcom.com>\n <20200717141451.11705-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 05/14] net/bnxt: add protocol header info based\n\ton 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>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c       | 180 +++++++++++++++++++------\n drivers/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 4c1221a..3891bcd 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 6b68b95..a9295e0 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 2f2f9a2..b9a25b0 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": [
        "05/14"
    ]
}