get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 99365,
    "url": "http://patches.dpdk.org/api/patches/99365/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210921132009.3461020-14-qi.z.zhang@intel.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": "<20210921132009.3461020-14-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210921132009.3461020-14-qi.z.zhang@intel.com",
    "date": "2021-09-21T13:20:02",
    "name": "[v3,13/20] net/ice/base: add helper functions for parse graph key matching",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "aa9b3ada23b343ed6fc1f6fd87738e2996cb9c32",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210921132009.3461020-14-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 19057,
            "url": "http://patches.dpdk.org/api/series/19057/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19057",
            "date": "2021-09-21T13:19:49",
            "name": "ice/base: add parser module",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/19057/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/99365/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/99365/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AF7B0A0C4C;\n\tTue, 21 Sep 2021 15:18:47 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AFC7D41185;\n\tTue, 21 Sep 2021 15:17:30 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 7387141169\n for <dev@dpdk.org>; Tue, 21 Sep 2021 15:17:26 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Sep 2021 06:17:25 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.142])\n by orsmga008.jf.intel.com with ESMTP; 21 Sep 2021 06:17:24 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10113\"; a=\"202847478\"",
            "E=Sophos;i=\"5.85,311,1624345200\"; d=\"scan'208\";a=\"202847478\"",
            "E=Sophos;i=\"5.85,311,1624345200\"; d=\"scan'208\";a=\"484173913\""
        ],
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "junfeng.guo@intel.com,\n\tdev@dpdk.org,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Date": "Tue, 21 Sep 2021 21:20:02 +0800",
        "Message-Id": "<20210921132009.3461020-14-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20210921132009.3461020-1-qi.z.zhang@intel.com>",
        "References": "<20210921132009.3461020-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 13/20] net/ice/base: add helper functions for\n parse graph key matching",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "Add below two internal helper functions for parse graph key matching\nin cam table:\n\nice_pg_cam_match\nice_pg_nm_cam_match\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Junfeng Guo <junfeng.guo@intel.com>\n---\n drivers/net/ice/base/ice_pg_cam.c | 76 +++++++++++++++++++++++++++++++\n drivers/net/ice/base/ice_pg_cam.h |  6 +++\n 2 files changed, 82 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/base/ice_pg_cam.c b/drivers/net/ice/base/ice_pg_cam.c\nindex 03484d6a91..fe461ad849 100644\n--- a/drivers/net/ice/base/ice_pg_cam.c\n+++ b/drivers/net/ice/base/ice_pg_cam.c\n@@ -296,3 +296,79 @@ struct ice_pg_nm_cam_item *ice_pg_nm_sp_cam_table_get(struct ice_hw *hw)\n \t\t\t\t\tice_parser_sect_item_get,\n \t\t\t\t\t_pg_nm_sp_cam_parse_item, false);\n }\n+\n+static bool _pg_cam_match(struct ice_pg_cam_item *item,\n+\t\t\t  struct ice_pg_cam_key *key)\n+{\n+\tif (!item->key.valid ||\n+\t    item->key.node_id != key->node_id ||\n+\t    item->key.flag0 != key->flag0 ||\n+\t    item->key.flag1 != key->flag1 ||\n+\t    item->key.flag2 != key->flag2 ||\n+\t    item->key.flag3 != key->flag3 ||\n+\t    item->key.boost_idx != key->boost_idx ||\n+\t    item->key.alu_reg != key->alu_reg ||\n+\t    item->key.next_proto != key->next_proto)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+static bool _pg_nm_cam_match(struct ice_pg_nm_cam_item *item,\n+\t\t\t     struct ice_pg_cam_key *key)\n+{\n+\tif (!item->key.valid ||\n+\t    item->key.node_id != key->node_id ||\n+\t    item->key.flag0 != key->flag0 ||\n+\t    item->key.flag1 != key->flag1 ||\n+\t    item->key.flag2 != key->flag2 ||\n+\t    item->key.flag3 != key->flag3 ||\n+\t    item->key.boost_idx != key->boost_idx ||\n+\t    item->key.alu_reg != key->alu_reg)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+/**\n+ * ice_pg_cam_match - search parse graph cam table by key\n+ * @table: parse graph cam table to search\n+ * @size: cam table size\n+ * @key: search key\n+ */\n+struct ice_pg_cam_item *ice_pg_cam_match(struct ice_pg_cam_item *table,\n+\t\t\t\t\t int size, struct ice_pg_cam_key *key)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < size; i++) {\n+\t\tstruct ice_pg_cam_item *item = &table[i];\n+\n+\t\tif (_pg_cam_match(item, key))\n+\t\t\treturn item;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n+/**\n+ * ice_pg_nm_cam_match - search parse graph no match cam table by key\n+ * @table: parse graph no match cam table to search\n+ * @size: cam table size\n+ * @key: search key\n+ */\n+struct ice_pg_nm_cam_item *\n+ice_pg_nm_cam_match(struct ice_pg_nm_cam_item *table, int size,\n+\t\t    struct ice_pg_cam_key *key)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < size; i++) {\n+\t\tstruct ice_pg_nm_cam_item *item = &table[i];\n+\n+\t\tif (_pg_nm_cam_match(item, key))\n+\t\t\treturn item;\n+\t}\n+\n+\treturn NULL;\n+}\ndiff --git a/drivers/net/ice/base/ice_pg_cam.h b/drivers/net/ice/base/ice_pg_cam.h\nindex fcb2e11e54..aeadc20a77 100644\n--- a/drivers/net/ice/base/ice_pg_cam.h\n+++ b/drivers/net/ice/base/ice_pg_cam.h\n@@ -65,4 +65,10 @@ struct ice_pg_cam_item *ice_pg_sp_cam_table_get(struct ice_hw *hw);\n \n struct ice_pg_nm_cam_item *ice_pg_nm_cam_table_get(struct ice_hw *hw);\n struct ice_pg_nm_cam_item *ice_pg_nm_sp_cam_table_get(struct ice_hw *hw);\n+\n+struct ice_pg_cam_item *ice_pg_cam_match(struct ice_pg_cam_item *table,\n+\t\t\t\t\t int size, struct ice_pg_cam_key *key);\n+struct ice_pg_nm_cam_item *\n+ice_pg_nm_cam_match(struct ice_pg_nm_cam_item *table, int size,\n+\t\t    struct ice_pg_cam_key *key);\n #endif /* _ICE_PG_CAM_H_ */\n",
    "prefixes": [
        "v3",
        "13/20"
    ]
}