get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72320,
    "url": "https://patches.dpdk.org/api/patches/72320/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200627100050.19688-3-ajit.khaparde@broadcom.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": "<20200627100050.19688-3-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200627100050.19688-3-ajit.khaparde@broadcom.com",
    "date": "2020-06-27T10:00:27",
    "name": "[v4,02/25] net/bnxt: remove fields from bitmap and mapper table",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "006bdb624c8eec8977cc9312a7ece67e8374dc6b",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200627100050.19688-3-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 10645,
            "url": "https://patches.dpdk.org/api/series/10645/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10645",
            "date": "2020-06-27T10:00:25",
            "name": "bnxt patches",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/10645/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/72320/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/72320/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 A6197A0520;\n\tSat, 27 Jun 2020 12:01:18 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2FE0C1BFA1;\n\tSat, 27 Jun 2020 12:01:03 +0200 (CEST)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 0129E1BF80\n for <dev@dpdk.org>; Sat, 27 Jun 2020 12:00:57 +0200 (CEST)",
            "from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net\n [10.75.242.48])\n by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id EB05930C0E7;\n Sat, 27 Jun 2020 03:00:56 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.230.185.215])\n by mail-irv-17.broadcom.com (Postfix) with ESMTP id 538AB14008E;\n Sat, 27 Jun 2020 03:00:56 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com EB05930C0E7",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1593252057;\n bh=Jia5dxMME2kIRqvH9qMVIvC8heyaGL0QcIQg5SzbwVU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=ISRZKmYcJpdxi/F9JmuL75eQ3/Cs91a8RB4xr4TmZ3TgIubJfq63XOMu5QJJ8zPM5\n QeI913X2+dc+spvWunG1hweFFOIbKUnapzOCPx1s9KziJXr7jRiU7ZcX6DSXO//vu9\n S7cX/P8O8tJSOtvMWG3d6kXjxSsXvZM+jathK+zA=",
        "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 Mike Baucom <michael.baucom@broadcom.com>",
        "Date": "Sat, 27 Jun 2020 03:00:27 -0700",
        "Message-Id": "<20200627100050.19688-3-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20200627100050.19688-1-ajit.khaparde@broadcom.com>",
        "References": "<20200612125024.15989-1-somnath.kotur@broadcom.com>\n <20200627100050.19688-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 02/25] net/bnxt: remove fields from bitmap and\n\tmapper table",
        "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\nRemove unnecessary fields from bitmap and mapper table.\n\n- remove svif and VLAN info from header bitmap\nThe svif and vlan information are removed from header bitmap\nsignature so that the matching algorithm does not use these\nfields to perform matching. So flows with or without vlan\ntag could use the same flow template.\n- remove mem field from mapper class table\nRemove the unused mem field in the ulp mapper class table structure\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Mike Baucom <michael.baucom@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |  3 ++\n drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 18 ++++++-\n drivers/net/bnxt/tf_ulp/ulp_mapper.h          |  2 +\n drivers/net/bnxt/tf_ulp/ulp_matcher.c         | 25 +---------\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 45 +++++++++--------\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  1 +\n drivers/net/bnxt/tf_ulp/ulp_template_db.c     | 18 +++----\n drivers/net/bnxt/tf_ulp/ulp_template_db.h     | 49 ++++++++-----------\n .../net/bnxt/tf_ulp/ulp_template_field_db.h   |  2 +-\n drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  1 -\n drivers/net/bnxt/tf_ulp/ulp_utils.c           | 34 +++++++++++++\n drivers/net/bnxt/tf_ulp/ulp_utils.h           | 18 +++++++\n 12 files changed, 129 insertions(+), 87 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c\nindex dbec8cecf..1d8d79f59 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c\n@@ -99,6 +99,8 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,\n \tULP_UTIL_CHF_IDX_WR(&params, BNXT_ULP_CHF_IDX_INCOMING_IF,\n \t\t\t    dev->data->port_id);\n \tULP_UTIL_CHF_IDX_WR(&params, BNXT_ULP_CHF_IDX_DIRECTION, params.dir);\n+\tULP_UTIL_CHF_IDX_WR(&params, BNXT_ULP_CHF_IDX_SVIF,\n+\t\t\t    BNXT_ULP_INVALID_SVIF_VAL);\n \n \t/* Parse the rte flow pattern */\n \tret = bnxt_ulp_rte_parser_hdr_parse(pattern, &params);\n@@ -121,6 +123,7 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,\n \tmapper_cparms.app_priority = attr->priority;\n \tmapper_cparms.hdr_bitmap = &params.hdr_bitmap;\n \tmapper_cparms.hdr_field = params.hdr_field;\n+\tmapper_cparms.comp_fld = params.comp_fld;\n \tmapper_cparms.act = &params.act_bitmap;\n \tmapper_cparms.act_prop = &params.act_prop;\n \tmapper_cparms.class_tid = class_id;\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 938b88e22..88b514228 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -743,6 +743,21 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tbreak;\n+\tcase BNXT_ULP_SPEC_OPC_SET_TO_COMP_HDR_FIELD:\n+\t\tif (!ulp_operand_read(operand, (uint8_t *)&idx,\n+\t\t\t\t      sizeof(uint16_t))) {\n+\t\t\tBNXT_TF_DBG(ERR, \"%s key operand read failed.\\n\", name);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tidx = tfp_be_to_cpu_16(idx);\n+\t\tif (idx < BNXT_ULP_CHF_IDX_LAST)\n+\t\t\tval = ulp_blob_push_32(blob, &parms->comp_fld[idx],\n+\t\t\t\t\t       bitlen);\n+\t\tif (!val) {\n+\t\t\tBNXT_TF_DBG(ERR, \"%s push to key blob failed\\n\", name);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tbreak;\n \tcase BNXT_ULP_SPEC_OPC_SET_TO_REGFILE:\n \t\tif (!ulp_operand_read(operand, (uint8_t *)&idx,\n \t\t\t\t      sizeof(uint16_t))) {\n@@ -1278,7 +1293,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t */\n \tiparms.dup_check\t\t= 0;\n \tiparms.dir\t\t\t= tbl->direction;\n-\tiparms.mem\t\t\t= tbl->mem;\n+\tiparms.mem\t\t\t= tbl->table_type;\n \tiparms.key\t\t\t= ulp_blob_data_get(&key, &tmplen);\n \tiparms.key_sz_in_bits\t\t= tbl->key_bit_size;\n \tiparms.em_record\t\t= ulp_blob_data_get(&data, &tmplen);\n@@ -1857,6 +1872,7 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,\n \tparms.act_bitmap = cparms->act;\n \tparms.regfile = &regfile;\n \tparms.hdr_field = cparms->hdr_field;\n+\tparms.comp_fld = cparms->comp_fld;\n \tparms.tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);\n \tparms.ulp_ctx = ulp_ctx;\n \tparms.tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\nindex 162d869c8..e794795c4 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n@@ -67,6 +67,7 @@ struct bnxt_ulp_mapper_parms {\n \tstruct ulp_rte_act_prop\t\t\t*act_prop;\n \tstruct ulp_rte_act_bitmap\t\t*act_bitmap;\n \tstruct ulp_rte_hdr_field\t\t*hdr_field;\n+\tuint32_t\t\t\t\t*comp_fld;\n \tstruct ulp_regfile\t\t\t*regfile;\n \tstruct tf\t\t\t\t*tfp;\n \tstruct bnxt_ulp_context\t\t\t*ulp_ctx;\n@@ -82,6 +83,7 @@ struct bnxt_ulp_mapper_create_parms {\n \tuint32_t\t\t\tapp_priority;\n \tstruct ulp_rte_hdr_bitmap\t*hdr_bitmap;\n \tstruct ulp_rte_hdr_field\t*hdr_field;\n+\tuint32_t\t\t\t*comp_fld;\n \tstruct ulp_rte_act_bitmap\t*act;\n \tstruct ulp_rte_act_prop\t\t*act_prop;\n \tuint32_t\t\t\tclass_tid;\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_matcher.c b/drivers/net/bnxt/tf_ulp/ulp_matcher.c\nindex e5f23ef27..f665700be 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_matcher.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_matcher.c\n@@ -34,22 +34,6 @@ ulp_matcher_action_hash_calculate(uint64_t hi_sig)\n \treturn (uint32_t)hash;\n }\n \n-/* Utility function to mask the computed and internal proto headers. */\n-static void\n-ulp_matcher_hdr_fields_normalize(struct ulp_rte_hdr_bitmap *hdr1,\n-\t\t\t\t struct ulp_rte_hdr_bitmap *hdr2)\n-{\n-\t/* copy the contents first */\n-\trte_memcpy(hdr2, hdr1, sizeof(struct ulp_rte_hdr_bitmap));\n-\n-\t/* reset the computed fields */\n-\tULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_SVIF);\n-\tULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OO_VLAN);\n-\tULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OI_VLAN);\n-\tULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_IO_VLAN);\n-\tULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_II_VLAN);\n-}\n-\n /*\n  * Function to handle the matching of RTE Flows and validating\n  * the pattern masks against the flow templates.\n@@ -58,16 +42,11 @@ int32_t\n ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,\n \t\t\t  uint32_t *class_id)\n {\n-\tstruct ulp_rte_hdr_bitmap hdr_bitmap_masked;\n \tstruct bnxt_ulp_class_match_info *class_match;\n \tuint32_t class_hid;\n \tuint8_t vf_to_vf;\n \tuint16_t tmpl_id;\n \n-\t/* Remove the hdr bit maps that are internal or computed */\n-\tulp_matcher_hdr_fields_normalize(&params->hdr_bitmap,\n-\t\t\t\t\t &hdr_bitmap_masked);\n-\n \t/* determine vf to vf flow */\n \tif (params->dir == ULP_DIR_EGRESS &&\n \t    ULP_BITMAP_ISSET(params->act_bitmap.bits,\n@@ -78,7 +57,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,\n \t}\n \n \t/* calculate the hash of the given flow */\n-\tclass_hid = ulp_matcher_class_hash_calculate(hdr_bitmap_masked.bits,\n+\tclass_hid = ulp_matcher_class_hash_calculate(params->hdr_bitmap.bits,\n \t\t\t\t\t\t     params->fld_bitmap.bits);\n \n \t/* validate the calculate hash values */\n@@ -89,7 +68,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,\n \t\tgoto error;\n \n \tclass_match = &ulp_class_match_list[tmpl_id];\n-\tif (ULP_BITMAP_CMP(&hdr_bitmap_masked, &class_match->hdr_sig)) {\n+\tif (ULP_BITMAP_CMP(&params->hdr_bitmap, &class_match->hdr_sig)) {\n \t\tBNXT_TF_DBG(DEBUG, \"Proto Header does not match\\n\");\n \t\tgoto error;\n \t}\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\nindex ace5fad97..4f7adfc3a 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n@@ -165,15 +165,13 @@ ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params,\n \tuint32_t ifindex;\n \tint32_t rc;\n \n-\tif (ULP_BITMAP_ISSET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_SVIF)) {\n+\tif (ULP_UTIL_CHF_IDX_RD(params, BNXT_ULP_CHF_IDX_SVIF) !=\n+\t    BNXT_ULP_INVALID_SVIF_VAL) {\n \t\tBNXT_TF_DBG(ERR,\n \t\t\t    \"SVIF already set,multiple source not support'd\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n \t}\n \n-\t/*update the hdr_bitmap with BNXT_ULP_HDR_PROTO_SVIF */\n-\tULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_SVIF);\n-\n \tif (proto == RTE_FLOW_ITEM_TYPE_PORT_ID) {\n \t\tdir = ULP_UTIL_CHF_IDX_RD(params,\n \t\t\t\t\t  BNXT_ULP_CHF_IDX_DIRECTION);\n@@ -192,6 +190,8 @@ ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params,\n \tmemcpy(hdr_field->spec, &svif, sizeof(svif));\n \tmemcpy(hdr_field->mask, &mask, sizeof(mask));\n \thdr_field->size = sizeof(svif);\n+\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_SVIF,\n+\t\t\t    rte_be_to_cpu_16(svif));\n \treturn BNXT_TF_RC_SUCCESS;\n }\n \n@@ -202,7 +202,8 @@ ulp_rte_parser_svif_process(struct ulp_rte_parser_params *params)\n \tuint16_t port_id = 0;\n \tuint16_t svif_mask = 0xFFFF;\n \n-\tif (ULP_BITMAP_ISSET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_SVIF))\n+\tif (ULP_UTIL_CHF_IDX_RD(params, BNXT_ULP_CHF_IDX_SVIF) !=\n+\t    BNXT_ULP_INVALID_SVIF_VAL)\n \t\treturn BNXT_TF_RC_SUCCESS;\n \n \t/* SVIF not set. So get the port id */\n@@ -421,41 +422,39 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \t/* Update the hdr_bitmap of the vlans */\n \thdr_bit = &params->hdr_bitmap;\n \tif (ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_O_ETH) &&\n-\t    !ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OO_VLAN)) {\n-\t\t/* Set the outer vlan bit and update the vlan tag num */\n-\t\tULP_BITMAP_SET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OO_VLAN);\n+\t    !outer_vtag_num) {\n+\t\t/* Update the vlan tag num */\n \t\touter_vtag_num++;\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_O_VTAG_NUM,\n \t\t\t\t    outer_vtag_num);\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_O_VTAG_PRESENT, 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_OO_VLAN) &&\n-\t\t   !ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OI_VLAN)) {\n-\t\t/* Set the outer vlan bit and update the vlan tag num */\n-\t\tULP_BITMAP_SET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OI_VLAN);\n+\t\t   ULP_UTIL_CHF_IDX_RD(params,\n+\t\t\t\t       BNXT_ULP_CHF_IDX_O_VTAG_PRESENT) &&\n+\t\t   outer_vtag_num == 1) {\n+\t\t/* update the vlan tag num */\n \t\touter_vtag_num++;\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_O_VTAG_NUM,\n \t\t\t\t    outer_vtag_num);\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_O_TWO_VTAGS, 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_OO_VLAN) &&\n-\t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OI_VLAN) &&\n+\t\t   ULP_UTIL_CHF_IDX_RD(params,\n+\t\t\t\t       BNXT_ULP_CHF_IDX_O_VTAG_PRESENT) &&\n \t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_I_ETH) &&\n-\t\t   !ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_IO_VLAN)) {\n-\t\t/* Set the inner vlan bit and update the vlan tag num */\n-\t\tULP_BITMAP_SET(hdr_bit->bits, BNXT_ULP_HDR_BIT_IO_VLAN);\n+\t\t   !inner_vtag_num) {\n+\t\t/* update the vlan tag num */\n \t\tinner_vtag_num++;\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_I_VTAG_NUM,\n \t\t\t\t    inner_vtag_num);\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_I_VTAG_PRESENT, 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_OO_VLAN) &&\n-\t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_OI_VLAN) &&\n+\t\t   ULP_UTIL_CHF_IDX_RD(params,\n+\t\t\t\t       BNXT_ULP_CHF_IDX_O_VTAG_PRESENT) &&\n \t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_I_ETH) &&\n-\t\t   ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_IO_VLAN) &&\n-\t\t   !ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_II_VLAN)) {\n-\t\t/* Set the inner vlan bit and update the vlan tag num */\n-\t\tULP_BITMAP_SET(hdr_bit->bits, BNXT_ULP_HDR_BIT_II_VLAN);\n+\t\t   ULP_UTIL_CHF_IDX_RD(params,\n+\t\t\t\t       BNXT_ULP_CHF_IDX_O_VTAG_PRESENT) &&\n+\t\t   inner_vtag_num == 1) {\n+\t\t/* update the vlan tag num */\n \t\tinner_vtag_num++;\n \t\tULP_UTIL_CHF_IDX_WR(params, BNXT_ULP_CHF_IDX_I_VTAG_NUM,\n \t\t\t\t    inner_vtag_num);\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\nindex cbc8a43de..868e6dc15 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n@@ -19,6 +19,7 @@\n #define BNXT_ULP_ENCAP_IPV4_SIZE\t\t12\n #define BNXT_ULP_ENCAP_IPV6_SIZE\t\t8\n #define BNXT_ULP_ENCAP_UDP_SIZE\t\t\t4\n+#define BNXT_ULP_INVALID_SVIF_VAL\t\t-1U\n \n /* Function to handle the parsing of the RTE port id. */\n int32_t\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c\nindex e89aefad4..f06fbc0fd 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c\n@@ -3,10 +3,6 @@\n  * All rights reserved.\n  */\n \n-/*\n- * date: Mon Mar  9 02:37:53 2020\n- * version: 0.0\n- */\n \n #include \"ulp_template_db.h\"\n #include \"ulp_template_field_db.h\"\n@@ -538,12 +534,12 @@ uint32_t bnxt_ulp_encap_vtag_map[] = {\n };\n \n uint16_t ulp_class_sig_tbl[BNXT_ULP_CLASS_SIG_TBL_MAX_SZ] = {\n-\t[BNXT_ULP_CLASS_HID_0092] = 1\n+\t[BNXT_ULP_CLASS_HID_0013] = 1\n };\n \n struct bnxt_ulp_class_match_info ulp_class_match_list[] = {\n \t[1] = {\n-\t.class_hid = BNXT_ULP_CLASS_HID_0092,\n+\t.class_hid = BNXT_ULP_CLASS_HID_0013,\n \t.hdr_sig = { .bits =\n \t\tBNXT_ULP_HDR_BIT_O_ETH |\n \t\tBNXT_ULP_HDR_BIT_O_IPV4 |\n@@ -833,15 +829,17 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {\n \t.spec_operand = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n \t},\n-\t/* class template id: 0, wh_plus, table: profile_tcam_cache_0 */\n \t{\n \t.field_bit_size = 1,\n \t.mask_opcode = BNXT_ULP_MASK_OPC_SET_TO_CONSTANT,\n \t.mask_operand = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n \t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n-\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_CONSTANT,\n-\t.spec_operand = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n-\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n+\t.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_COMP_HDR_FIELD,\n+\t.spec_operand = {\n+\t\t(BNXT_ULP_CHF_IDX_O_VTAG_NUM >> 8) & 0xff,\n+\t\tBNXT_ULP_CHF_IDX_O_VTAG_NUM & 0xff,\n+\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n+\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\n \t},\n \t{\n \t.field_bit_size = 7,\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\nindex e6065d2fb..212068fc8 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n@@ -3,10 +3,6 @@\n  * All rights reserved.\n  */\n \n-/*\n- * date: Mon Mar  9 02:37:53 2020\n- * version: 0.0\n- */\n \n #ifndef ULP_TEMPLATE_DB_H_\n #define ULP_TEMPLATE_DB_H_\n@@ -64,24 +60,19 @@ enum bnxt_ulp_action_bit {\n };\n \n enum bnxt_ulp_hdr_bit {\n-\tBNXT_ULP_HDR_BIT_SVIF                = 0x0000000000000001,\n-\tBNXT_ULP_HDR_BIT_O_ETH               = 0x0000000000000002,\n-\tBNXT_ULP_HDR_BIT_OO_VLAN             = 0x0000000000000004,\n-\tBNXT_ULP_HDR_BIT_OI_VLAN             = 0x0000000000000008,\n-\tBNXT_ULP_HDR_BIT_O_IPV4              = 0x0000000000000010,\n-\tBNXT_ULP_HDR_BIT_O_IPV6              = 0x0000000000000020,\n-\tBNXT_ULP_HDR_BIT_O_TCP               = 0x0000000000000040,\n-\tBNXT_ULP_HDR_BIT_O_UDP               = 0x0000000000000080,\n-\tBNXT_ULP_HDR_BIT_T_VXLAN             = 0x0000000000000100,\n-\tBNXT_ULP_HDR_BIT_T_GRE               = 0x0000000000000200,\n-\tBNXT_ULP_HDR_BIT_I_ETH               = 0x0000000000000400,\n-\tBNXT_ULP_HDR_BIT_IO_VLAN             = 0x0000000000000800,\n-\tBNXT_ULP_HDR_BIT_II_VLAN             = 0x0000000000001000,\n-\tBNXT_ULP_HDR_BIT_I_IPV4              = 0x0000000000002000,\n-\tBNXT_ULP_HDR_BIT_I_IPV6              = 0x0000000000004000,\n-\tBNXT_ULP_HDR_BIT_I_TCP               = 0x0000000000008000,\n-\tBNXT_ULP_HDR_BIT_I_UDP               = 0x0000000000010000,\n-\tBNXT_ULP_HDR_BIT_LAST                = 0x0000000000020000\n+\tBNXT_ULP_HDR_BIT_O_ETH               = 0x0000000000000001,\n+\tBNXT_ULP_HDR_BIT_O_IPV4              = 0x0000000000000002,\n+\tBNXT_ULP_HDR_BIT_O_IPV6              = 0x0000000000000004,\n+\tBNXT_ULP_HDR_BIT_O_TCP               = 0x0000000000000008,\n+\tBNXT_ULP_HDR_BIT_O_UDP               = 0x0000000000000010,\n+\tBNXT_ULP_HDR_BIT_T_VXLAN             = 0x0000000000000020,\n+\tBNXT_ULP_HDR_BIT_T_GRE               = 0x0000000000000040,\n+\tBNXT_ULP_HDR_BIT_I_ETH               = 0x0000000000000080,\n+\tBNXT_ULP_HDR_BIT_I_IPV4              = 0x0000000000000100,\n+\tBNXT_ULP_HDR_BIT_I_IPV6              = 0x0000000000000200,\n+\tBNXT_ULP_HDR_BIT_I_TCP               = 0x0000000000000400,\n+\tBNXT_ULP_HDR_BIT_I_UDP               = 0x0000000000000800,\n+\tBNXT_ULP_HDR_BIT_LAST                = 0x0000000000001000\n };\n \n enum bnxt_ulp_act_type {\n@@ -232,10 +223,11 @@ enum bnxt_ulp_search_before_alloc {\n enum bnxt_ulp_spec_opc {\n \tBNXT_ULP_SPEC_OPC_SET_TO_CONSTANT = 0,\n \tBNXT_ULP_SPEC_OPC_SET_TO_HDR_FIELD = 1,\n-\tBNXT_ULP_SPEC_OPC_SET_TO_REGFILE = 2,\n-\tBNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE = 3,\n-\tBNXT_ULP_SPEC_OPC_ADD_PAD = 4,\n-\tBNXT_ULP_SPEC_OPC_LAST = 5\n+\tBNXT_ULP_SPEC_OPC_SET_TO_COMP_HDR_FIELD = 2,\n+\tBNXT_ULP_SPEC_OPC_SET_TO_REGFILE = 3,\n+\tBNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE = 4,\n+\tBNXT_ULP_SPEC_OPC_ADD_PAD = 5,\n+\tBNXT_ULP_SPEC_OPC_LAST = 6\n };\n \n enum bnxt_ulp_encap_vtag_encoding {\n@@ -445,12 +437,13 @@ enum bnxt_ulp_act_prop_idx {\n \tBNXT_ULP_ACT_PROP_IDX_ENCAP_TUN = 236,\n \tBNXT_ULP_ACT_PROP_IDX_LAST = 268\n };\n+\n enum bnxt_ulp_class_hid {\n-\tBNXT_ULP_CLASS_HID_0092 = 0x0092\n+\tBNXT_ULP_CLASS_HID_0013 = 0x0013\n };\n \n enum bnxt_ulp_act_hid {\n \tBNXT_ULP_ACT_HID_0029 = 0x0029\n };\n \n-#endif /* _ULP_TEMPLATE_DB_H_ */\n+#endif\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_field_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_field_db.h\nindex 587de8a83..2655b8307 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_field_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_field_db.h\n@@ -60,4 +60,4 @@ enum bnxt_ulp_hf_bitmask0 {\n \tBNXT_ULP_HF0_BITMASK_O_UDP_CSUM          = 0x0000010000000000\n };\n \n-#endif /* _ULP_HDR_FIELD_ENUMS_H_ */\n+#endif\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\nindex 0e0d02ff4..a85ccf2bf 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h\n@@ -159,7 +159,6 @@ struct bnxt_ulp_mapper_class_tbl_info {\n \tenum bnxt_ulp_resource_func\tresource_func;\n \tuint32_t\ttable_type;\n \tuint8_t\t\tdirection;\n-\tuint8_t\t\tmem;\n \tuint32_t\tpriority;\n \tuint8_t\t\tsrch_b4_alloc;\n \tuint32_t\tcritical_resource;\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.c b/drivers/net/bnxt/tf_ulp/ulp_utils.c\nindex 0150c1d49..bd267b637 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_utils.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.c\n@@ -309,6 +309,40 @@ ulp_blob_push_64(struct ulp_blob *blob,\n \treturn &val[8 - size];\n }\n \n+/*\n+ * Add data to the binary blob at the current offset.\n+ *\n+ * blob [in] The blob that data is added to.  The blob must\n+ * be initialized prior to pushing data.\n+ *\n+ * data [in] 32-bit value to be added to the blob.\n+ *\n+ * datalen [in] The number of bits to be added ot the blob.\n+ *\n+ * The offset of the data is updated after each push of data.\n+ * NULL returned on error, pointer pushed value otherwise.\n+ */\n+uint8_t *\n+ulp_blob_push_32(struct ulp_blob *blob,\n+\t\t uint32_t *data,\n+\t\t uint32_t datalen)\n+{\n+\tuint8_t *val = (uint8_t *)data;\n+\tuint32_t rc;\n+\tuint32_t size = ULP_BITS_2_BYTE(datalen);\n+\n+\tif (!data || size > sizeof(uint32_t)) {\n+\t\tBNXT_TF_DBG(ERR, \"invalid argument\\n\");\n+\t\treturn 0;\n+\t}\n+\n+\trc = ulp_blob_push(blob, &val[sizeof(uint32_t) - size], datalen);\n+\tif (!rc)\n+\t\treturn 0;\n+\n+\treturn &val[sizeof(uint32_t) - size];\n+}\n+\n /*\n  * Add encap data to the binary blob at the current offset.\n  *\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.h b/drivers/net/bnxt/tf_ulp/ulp_utils.h\nindex 5db393398..b8de4b41a 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_utils.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.h\n@@ -178,6 +178,24 @@ ulp_blob_push_64(struct ulp_blob *blob,\n \t\t uint64_t *data,\n \t\t uint32_t datalen);\n \n+/*\n+ * Add data to the binary blob at the current offset.\n+ *\n+ * blob [in] The blob that data is added to.  The blob must\n+ * be initialized prior to pushing data.\n+ *\n+ * data [in] 32-bit value to be added to the blob.\n+ *\n+ * datalen [in] The number of bits to be added ot the blob.\n+ *\n+ * The offset of the data is updated after each push of data.\n+ * NULL returned on error, pointer pushed value otherwise.\n+ */\n+uint8_t *\n+ulp_blob_push_32(struct ulp_blob *blob,\n+\t\t uint32_t *data,\n+\t\t uint32_t datalen);\n+\n /*\n  * Add encap data to the binary blob at the current offset.\n  *\n",
    "prefixes": [
        "v4",
        "02/25"
    ]
}