get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71087,
    "url": "http://patches.dpdk.org/api/patches/71087/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200610065733.18698-7-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": "<20200610065733.18698-7-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200610065733.18698-7-somnath.kotur@broadcom.com",
    "date": "2020-06-10T06:57:03",
    "name": "[06/36] net/bnxt: support more resource functions in flow database",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e42f91190a83b951ffa70ef0e169b24d12e735f0",
    "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/20200610065733.18698-7-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 10371,
            "url": "http://patches.dpdk.org/api/series/10371/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=10371",
            "date": "2020-06-10T06:56:57",
            "name": "bnxt fixes and enhancements",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/10371/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/71087/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/71087/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 BF7E0A04FD;\n\tWed, 10 Jun 2020 09:03:10 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1F00F374C;\n\tWed, 10 Jun 2020 09:02:15 +0200 (CEST)",
            "from relay.smtp.broadcom.com (relay.smtp.broadcom.com\n [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 076A71B19\n for <dev@dpdk.org>; Wed, 10 Jun 2020 09:02:00 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 1DAB22957A9;\n Wed, 10 Jun 2020 00:01:59 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 1DAB22957A9",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1591772519;\n bh=jYM7ced58UrvRZSwvuPKOrLJTiLhUM4kf1YoH2P93zY=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=dDZKRIXJ6hsnU3xtB/lDHuENlS9/Ys8UHHeho7T2+opK8ba3fSTlM+F8dhMtyFITG\n qc6Cfjl18NeQXC/NHlHsL9+dZg4suEzikXeQQ9PgbLd1UcC9FFS4xA1J4iHt26RuML\n ZONMnaAZDCzo93NVZo7n56aN1R54o0pVBC9/9XLo=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Wed, 10 Jun 2020 12:27:03 +0530",
        "Message-Id": "<20200610065733.18698-7-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200610065733.18698-1-somnath.kotur@broadcom.com>",
        "References": "<20200610065733.18698-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 06/36] net/bnxt: support more resource functions\n\tin 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>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@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 35a7f86..30a809a 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 ebca849..9037dc5 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 9531bed..437b055 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 0754e39..3be04e8 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 fcd80d9..4721177 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h\n@@ -196,14 +196,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": [
        "06/36"
    ]
}