get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72321,
    "url": "https://patches.dpdk.org/api/patches/72321/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200627100050.19688-4-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-4-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200627100050.19688-4-ajit.khaparde@broadcom.com",
    "date": "2020-06-27T10:00:28",
    "name": "[v4,03/25] net/bnxt: support more resource functions in flow database",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e42f91190a83b951ffa70ef0e169b24d12e735f0",
    "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-4-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/72321/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/72321/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 2C904A0520;\n\tSat, 27 Jun 2020 12:01:30 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 85DE21BFAE;\n\tSat, 27 Jun 2020 12:01:04 +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 315FD1BF82\n for <dev@dpdk.org>; Sat, 27 Jun 2020 12:00:58 +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 2D36B30C0EE;\n Sat, 27 Jun 2020 03:00:57 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.230.185.215])\n by mail-irv-17.broadcom.com (Postfix) with ESMTP id 9B787140069;\n Sat, 27 Jun 2020 03:00:56 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 2D36B30C0EE",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1593252057;\n bh=X7EKyhNobe7GsRLVKNdnlAg1DDDFAhb2UUlu4HQg0uM=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=D4BLs/sVGoEg3OBNOt4ERGRLQ0YOeOYBbN2lPZMchxYMA2D39rRPT1+s/Rs8wuKGk\n D0T5oiAphUdejtTpWfPM/+HID7LbHGrlbe/IPPO5HAgE+t6m35HED+37JP6OOY0hER\n +i9awjUtvrDd20wIV4P6p4dflYaAyyNoPkrCR/8A=",
        "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>",
        "Date": "Sat, 27 Jun 2020 03:00:28 -0700",
        "Message-Id": "<20200627100050.19688-4-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 03/25] net/bnxt: support more resource\n\tfunctions in flow database",
        "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\nAdded support to include more resource functions in the flow\ndatabase. The number of bits increased from 3 to 8 for storing\nthe resource function.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_flow_db.c     | 51 +++++++++++++++++------\n drivers/net/bnxt/tf_ulp/ulp_flow_db.h     | 24 ++++++++---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c      | 13 ++----\n drivers/net/bnxt/tf_ulp/ulp_mapper.h      |  3 --\n drivers/net/bnxt/tf_ulp/ulp_template_db.h | 18 ++++----\n 5 files changed, 71 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\nindex 35a7f868a..30a809a8d 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c\n@@ -16,6 +16,9 @@\n #define ULP_FLOW_DB_RES_FUNC_BITS\t28\n #define ULP_FLOW_DB_RES_FUNC_MASK\t0x70000000\n #define ULP_FLOW_DB_RES_NXT_MASK\t0x0FFFFFFF\n+#define ULP_FLOW_DB_RES_FUNC_UPPER\t5\n+#define ULP_FLOW_DB_RES_FUNC_NEED_LOWER\t0x80\n+#define ULP_FLOW_DB_RES_FUNC_LOWER_MASK\t0x1F\n \n /* Macro to copy the nxt_resource_idx */\n #define ULP_FLOW_DB_RES_NXT_SET(dst, src)\t{(dst) |= ((src) &\\\n@@ -77,20 +80,32 @@ ulp_flow_db_active_flow_is_set(struct bnxt_ulp_flow_tbl\t*flow_tbl,\n  * returns none\n  */\n static void\n-ulp_flow_db_res_params_to_info(struct ulp_fdb_resource_info   *resource_info,\n-\t\t\t       struct ulp_flow_db_res_params  *params)\n+ulp_flow_db_res_params_to_info(struct ulp_fdb_resource_info *resource_info,\n+\t\t\t       struct ulp_flow_db_res_params *params)\n {\n+\tuint32_t resource_func;\n+\n \tresource_info->nxt_resource_idx |= ((params->direction <<\n \t\t\t\t      ULP_FLOW_DB_RES_DIR_BIT) &\n \t\t\t\t     ULP_FLOW_DB_RES_DIR_MASK);\n-\tresource_info->nxt_resource_idx |= ((params->resource_func <<\n+\tresource_func = (params->resource_func >> ULP_FLOW_DB_RES_FUNC_UPPER);\n+\tresource_info->nxt_resource_idx |= ((resource_func <<\n \t\t\t\t\t     ULP_FLOW_DB_RES_FUNC_BITS) &\n \t\t\t\t\t    ULP_FLOW_DB_RES_FUNC_MASK);\n \n+\tif (params->resource_func & ULP_FLOW_DB_RES_FUNC_NEED_LOWER) {\n+\t\t/* Break the resource func into two parts */\n+\t\tresource_func = (params->resource_func &\n+\t\t\t\t ULP_FLOW_DB_RES_FUNC_LOWER_MASK);\n+\t\tresource_info->resource_func_lower = resource_func;\n+\t}\n+\n+\t/* Store the handle as 64bit only for EM table entries */\n \tif (params->resource_func != BNXT_ULP_RESOURCE_FUNC_EM_TABLE) {\n \t\tresource_info->resource_hndl = (uint32_t)params->resource_hndl;\n \t\tresource_info->resource_type = params->resource_type;\n-\n+\t\tresource_info->resource_sub_type = params->resource_sub_type;\n+\t\tresource_info->reserved = params->reserved;\n \t} else {\n \t\tresource_info->resource_em_handle = params->resource_hndl;\n \t}\n@@ -106,22 +121,34 @@ ulp_flow_db_res_params_to_info(struct ulp_fdb_resource_info   *resource_info,\n  * returns none\n  */\n static void\n-ulp_flow_db_res_info_to_params(struct ulp_fdb_resource_info   *resource_info,\n-\t\t\t       struct ulp_flow_db_res_params  *params)\n+ulp_flow_db_res_info_to_params(struct ulp_fdb_resource_info *resource_info,\n+\t\t\t       struct ulp_flow_db_res_params *params)\n {\n+\tuint8_t resource_func_upper;\n+\n \tmemset(params, 0, sizeof(struct ulp_flow_db_res_params));\n \tparams->direction = ((resource_info->nxt_resource_idx &\n \t\t\t\t ULP_FLOW_DB_RES_DIR_MASK) >>\n \t\t\t\t ULP_FLOW_DB_RES_DIR_BIT);\n-\tparams->resource_func = ((resource_info->nxt_resource_idx &\n-\t\t\t\t ULP_FLOW_DB_RES_FUNC_MASK) >>\n-\t\t\t\t ULP_FLOW_DB_RES_FUNC_BITS);\n+\tresource_func_upper = (((resource_info->nxt_resource_idx &\n+\t\t\t\tULP_FLOW_DB_RES_FUNC_MASK) >>\n+\t\t\t       ULP_FLOW_DB_RES_FUNC_BITS) <<\n+\t\t\t       ULP_FLOW_DB_RES_FUNC_UPPER);\n+\n+\t/* The reource func is split into upper and lower */\n+\tif (resource_func_upper & ULP_FLOW_DB_RES_FUNC_NEED_LOWER)\n+\t\tparams->resource_func = (resource_func_upper |\n+\t\t\t\t\t resource_info->resource_func_lower);\n+\telse\n+\t\tparams->resource_func = resource_func_upper;\n \n-\tif (params->resource_func != BNXT_ULP_RESOURCE_FUNC_EM_TABLE) {\n+\tif (params->resource_func == BNXT_ULP_RESOURCE_FUNC_EM_TABLE) {\n+\t\tparams->resource_hndl = resource_info->resource_em_handle;\n+\t} else if (params->resource_func & ULP_FLOW_DB_RES_FUNC_NEED_LOWER) {\n \t\tparams->resource_hndl = resource_info->resource_hndl;\n \t\tparams->resource_type = resource_info->resource_type;\n-\t} else {\n-\t\tparams->resource_hndl = resource_info->resource_em_handle;\n+\t\tparams->resource_sub_type = resource_info->resource_sub_type;\n+\t\tparams->reserved = resource_info->reserved;\n \t}\n }\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.h b/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\nindex ebca84947..9037dc5f5 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.h\n@@ -12,14 +12,24 @@\n #define BNXT_FLOW_DB_DEFAULT_NUM_FLOWS\t\t128\n #define BNXT_FLOW_DB_DEFAULT_NUM_RESOURCES\t5\n \n-/* Structure for the flow database resource information. */\n+/*\n+ * Structure for the flow database resource information\n+ * The below structure is based on the below paritions\n+ * nxt_resource_idx = dir[31],resource_func_upper[30:28],nxt_resource_idx[27:0]\n+ * If resource_func is EM_TBL then use resource_em_handle.\n+ * Else the other part of the union is used and\n+ * resource_func is resource_func_upper[30:28] << 5 | resource_func_lower\n+ */\n struct ulp_fdb_resource_info {\n \t/* Points to next resource in the chained list. */\n-\tuint32_t\tnxt_resource_idx;\n+\tuint32_t\t\t\tnxt_resource_idx;\n \tunion {\n-\t\tuint64_t\tresource_em_handle;\n+\t\tuint64_t\t\tresource_em_handle;\n \t\tstruct {\n-\t\t\tuint32_t\tresource_type;\n+\t\t\tuint8_t\t\tresource_func_lower;\n+\t\t\tuint8_t\t\tresource_type;\n+\t\t\tuint8_t\t\tresource_sub_type;\n+\t\t\tuint8_t\t\treserved;\n \t\t\tuint32_t\tresource_hndl;\n \t\t};\n \t};\n@@ -59,9 +69,11 @@ struct bnxt_ulp_flow_db {\n struct ulp_flow_db_res_params {\n \tenum tf_dir\t\t\tdirection;\n \tenum bnxt_ulp_resource_func\tresource_func;\n+\tuint8_t\t\t\t\tresource_type;\n+\tuint8_t\t\t\t\tresource_sub_type;\n+\tuint8_t\t\t\t\treserved;\n+\tuint8_t\t\t\t\tcritical_resource;\n \tuint64_t\t\t\tresource_hndl;\n-\tuint32_t\t\t\tresource_type;\n-\tuint32_t\t\t\tcritical_resource;\n };\n \n /*\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex 88b514228..e60d9d572 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -292,9 +292,8 @@ ulp_mapper_cache_res_type_set(struct ulp_flow_db_res_params *res,\n \t\t\t      uint16_t tbl_type,\n \t\t\t      uint16_t tbl_id)\n {\n-\tres->resource_type =\n-\t\t((uint32_t)tbl_id << ULP_MAPPER_CACHE_RES_TBL_ID_SHFT) |\n-\t\t((uint32_t)tbl_type << ULP_MAPPER_CACHE_RES_TBL_TYPE_SHFT);\n+\tres->resource_type = tbl_type;\n+\tres->resource_sub_type = tbl_id;\n }\n \n /* Extracts the tbl_type and tbl_id from the 32bit resource type. */\n@@ -303,12 +302,8 @@ ulp_mapper_cache_res_type_get(struct ulp_flow_db_res_params *res,\n \t\t\t      uint16_t *tbl_type,\n \t\t\t      uint16_t *tbl_id)\n {\n-\t*tbl_type = (uint16_t)((res->resource_type >>\n-\t\t\t\tULP_MAPPER_CACHE_RES_TBL_TYPE_SHFT) &\n-\t\t\t       ULP_MAPPER_CACHE_RES_TBL_MASK);\n-\t*tbl_id = (uint16_t)((res->resource_type >>\n-\t\t\t      ULP_MAPPER_CACHE_RES_TBL_ID_SHFT) &\n-\t\t\t     ULP_MAPPER_CACHE_RES_TBL_MASK);\n+\t*tbl_type = res->resource_type;\n+\t*tbl_id = res->resource_sub_type;\n }\n \n static int32_t\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\nindex e794795c4..12633156a 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h\n@@ -17,9 +17,6 @@\n \n #define ULP_SZ_BITS2BYTES(x) (((x) + 7) / 8)\n #define ULP_IDENTS_INVALID ((uint16_t)0xffff)\n-#define ULP_MAPPER_CACHE_RES_TBL_ID_SHFT 16\n-#define ULP_MAPPER_CACHE_RES_TBL_TYPE_SHFT 0\n-#define ULP_MAPPER_CACHE_RES_TBL_MASK ((uint32_t)0x0000ffff)\n \n /*\n  * The cache table opcode is used to convey informat from the cache handler\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\nindex 212068fc8..4e1836658 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n@@ -195,14 +195,16 @@ enum bnxt_ulp_regfile_index {\n };\n \n enum bnxt_ulp_resource_func {\n-\tBNXT_ULP_RESOURCE_FUNC_INVALID = 0,\n-\tBNXT_ULP_RESOURCE_FUNC_TCAM_TABLE = 1,\n-\tBNXT_ULP_RESOURCE_FUNC_EM_TABLE = 2,\n-\tBNXT_ULP_RESOURCE_FUNC_INDEX_TABLE = 3,\n-\tBNXT_ULP_RESOURCE_FUNC_CACHE_TABLE = 4,\n-\tBNXT_ULP_RESOURCE_FUNC_IDENTIFIER = 5,\n-\tBNXT_ULP_RESOURCE_FUNC_HW_FID = 6,\n-\tBNXT_ULP_RESOURCE_FUNC_LAST = 7\n+\tBNXT_ULP_RESOURCE_FUNC_INVALID = 0x00,\n+\tBNXT_ULP_RESOURCE_FUNC_EM_TABLE = 0x20,\n+\tBNXT_ULP_RESOURCE_FUNC_RSVD1 = 0x40,\n+\tBNXT_ULP_RESOURCE_FUNC_RSVD2 = 0x60,\n+\tBNXT_ULP_RESOURCE_FUNC_TCAM_TABLE = 0x80,\n+\tBNXT_ULP_RESOURCE_FUNC_INDEX_TABLE = 0x81,\n+\tBNXT_ULP_RESOURCE_FUNC_CACHE_TABLE = 0x82,\n+\tBNXT_ULP_RESOURCE_FUNC_IDENTIFIER = 0x83,\n+\tBNXT_ULP_RESOURCE_FUNC_IF_TABLE = 0x84,\n+\tBNXT_ULP_RESOURCE_FUNC_HW_FID = 0x85\n };\n \n enum bnxt_ulp_result_opc {\n",
    "prefixes": [
        "v4",
        "03/25"
    ]
}