get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86392,
    "url": "https://patches.dpdk.org/api/patches/86392/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210112093243.40840-2-jia.guo@intel.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": "<20210112093243.40840-2-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210112093243.40840-2-jia.guo@intel.com",
    "date": "2021-01-12T09:32:41",
    "name": "[v3,1/3] net/ice/base: add package PTYPE enable information",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a49940fe10193288969c3f59aec354f7447c47b4",
    "submitter": {
        "id": 507,
        "url": "https://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210112093243.40840-2-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 14666,
            "url": "https://patches.dpdk.org/api/series/14666/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14666",
            "date": "2021-01-12T09:32:40",
            "name": "net/ice: refactor PTYPE parsing",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/14666/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/86392/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/86392/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 D6F0CA04B5;\n\tTue, 12 Jan 2021 10:39:16 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DB82B140DBD;\n\tTue, 12 Jan 2021 10:39:13 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id E25A8140DB2\n for <dev@dpdk.org>; Tue, 12 Jan 2021 10:39:11 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2021 01:39:11 -0800",
            "from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128])\n by orsmga008.jf.intel.com with ESMTP; 12 Jan 2021 01:39:09 -0800"
        ],
        "IronPort-SDR": [
            "\n 2fENsWn6Ua7Sv0DhyvAkSfUIZ3aSTnJ9m4zsuRtICmaZIignoR1EgDmtmRlthazR8zu4UoS5F5\n 9wx93YgxCoAw==",
            "\n /i/bXjbvyzJwKgCl8bE77Knove00/wo4QPqnCLGseFRlIzCmxFNQYDcGJ3jU4U21y5tvbAqoYg\n tt4Sl8VflaMg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9861\"; a=\"239554317\"",
            "E=Sophos;i=\"5.79,341,1602572400\"; d=\"scan'208\";a=\"239554317\"",
            "E=Sophos;i=\"5.79,341,1602572400\"; d=\"scan'208\";a=\"381356089\""
        ],
        "X-ExtLoop1": "1",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "qi.z.zhang@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com,\n haiyue.wang@intel.com",
        "Cc": "dev@dpdk.org,\n\tjia.guo@intel.com,\n\tsimei.su@intel.com",
        "Date": "Tue, 12 Jan 2021 17:32:41 +0800",
        "Message-Id": "<20210112093243.40840-2-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20210112093243.40840-1-jia.guo@intel.com>",
        "References": "<20201216085854.7842-1-jia.guo@intel.com>\n <20210112093243.40840-1-jia.guo@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [dpdk-dev v3 1/3] net/ice/base: add package PTYPE enable\n information",
        "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": "Scan the 'Marker PType TCAM' session to retrieve the Rx parser PTYPE\nenable information from the current package.\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\n drivers/net/ice/base/ice_flex_pipe.c | 79 ++++++++++++++++++++++++++++\n drivers/net/ice/base/ice_flex_pipe.h |  3 ++\n drivers/net/ice/base/ice_flex_type.h | 19 +++++++\n drivers/net/ice/base/ice_type.h      |  1 +\n 4 files changed, 102 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c\nindex 96aed3b795..96628ae5dc 100644\n--- a/drivers/net/ice/base/ice_flex_pipe.c\n+++ b/drivers/net/ice/base/ice_flex_pipe.c\n@@ -316,6 +316,84 @@ ice_pkg_enum_entry(struct ice_seg *ice_seg, struct ice_pkg_enum *state,\n \treturn entry;\n }\n \n+/**\n+ * ice_hw_ptype_ena - check if the PTYPE is enabled or not\n+ * @hw: pointer to the HW structure\n+ * @ptype: the hardware PTYPE\n+ */\n+bool ice_hw_ptype_ena(struct ice_hw *hw, u16 ptype)\n+{\n+\treturn ptype < ICE_FLOW_PTYPE_MAX &&\n+\t       ice_is_bit_set(hw->hw_ptype, ptype);\n+}\n+\n+/**\n+ * ice_marker_ptype_tcam_handler\n+ * @sect_type: section type\n+ * @section: pointer to section\n+ * @index: index of the Marker PType TCAM entry to be returned\n+ * @offset: pointer to receive absolute offset, always 0 for ptype TCAM sections\n+ *\n+ * This is a callback function that can be passed to ice_pkg_enum_entry.\n+ * Handles enumeration of individual Marker PType TCAM entries.\n+ */\n+static void *\n+ice_marker_ptype_tcam_handler(u32 sect_type, void *section, u32 index,\n+\t\t\t      u32 *offset)\n+{\n+\tstruct ice_marker_ptype_tcam_section *marker_ptype;\n+\n+\tif (!section)\n+\t\treturn NULL;\n+\n+\tif (sect_type != ICE_SID_RXPARSER_MARKER_PTYPE)\n+\t\treturn NULL;\n+\n+\tif (index > ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF)\n+\t\treturn NULL;\n+\n+\tif (offset)\n+\t\t*offset = 0;\n+\n+\tmarker_ptype = (struct ice_marker_ptype_tcam_section *)section;\n+\n+\tif (index >= LE16_TO_CPU(marker_ptype->count))\n+\t\treturn NULL;\n+\n+\treturn marker_ptype->tcam + index;\n+}\n+\n+/**\n+ * ice_fill_hw_ptype - fill the enabled PTYPE bit information\n+ * @hw: pointer to the HW structure\n+ */\n+static void\n+ice_fill_hw_ptype(struct ice_hw *hw)\n+{\n+\tstruct ice_marker_ptype_tcam_entry *tcam;\n+\tstruct ice_seg *seg = hw->seg;\n+\tstruct ice_pkg_enum state;\n+\n+\tice_zero_bitmap(hw->hw_ptype, ICE_FLOW_PTYPE_MAX);\n+\tif (!seg)\n+\t\treturn;\n+\n+\tice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);\n+\n+\tdo {\n+\t\ttcam = (struct ice_marker_ptype_tcam_entry *)\n+\t\t\tice_pkg_enum_entry(seg, &state,\n+\t\t\t\t\t   ICE_SID_RXPARSER_MARKER_PTYPE, NULL,\n+\t\t\t\t\t   ice_marker_ptype_tcam_handler);\n+\t\tif (tcam &&\n+\t\t    LE16_TO_CPU(tcam->addr) < ICE_MARKER_PTYPE_TCAM_ADDR_MAX &&\n+\t\t    LE16_TO_CPU(tcam->ptype) < ICE_FLOW_PTYPE_MAX)\n+\t\t\tice_set_bit(LE16_TO_CPU(tcam->ptype), hw->hw_ptype);\n+\n+\t\tseg = NULL;\n+\t} while (tcam);\n+}\n+\n /**\n  * ice_boost_tcam_handler\n  * @sect_type: section type\n@@ -1541,6 +1619,7 @@ enum ice_status ice_init_pkg(struct ice_hw *hw, u8 *buf, u32 len)\n \t\t */\n \t\tice_init_pkg_regs(hw);\n \t\tice_fill_blk_tbls(hw);\n+\t\tice_fill_hw_ptype(hw);\n \t\tice_get_prof_index_max(hw);\n \t} else {\n \t\tice_debug(hw, ICE_DBG_INIT, \"package load failed, %d\\n\",\ndiff --git a/drivers/net/ice/base/ice_flex_pipe.h b/drivers/net/ice/base/ice_flex_pipe.h\nindex d4679cc940..066ff95e13 100644\n--- a/drivers/net/ice/base/ice_flex_pipe.h\n+++ b/drivers/net/ice/base/ice_flex_pipe.h\n@@ -54,6 +54,9 @@ bool ice_tunnel_port_in_use(struct ice_hw *hw, u16 port, u16 *index);\n bool\n ice_tunnel_get_type(struct ice_hw *hw, u16 port, enum ice_tunnel_type *type);\n \n+/* RX parser PType functions */\n+bool ice_hw_ptype_ena(struct ice_hw *hw, u16 ptype);\n+\n /* XLT2/VSI group functions */\n enum ice_status\n ice_vsig_find_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 *vsig);\ndiff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h\nindex 62cc81b49c..9b9503b3ba 100644\n--- a/drivers/net/ice/base/ice_flex_type.h\n+++ b/drivers/net/ice/base/ice_flex_type.h\n@@ -472,6 +472,25 @@ struct ice_boost_tcam_section {\n \tsizeof(struct ice_boost_tcam_entry), \\\n \tsizeof(struct ice_boost_tcam_entry))\n \n+/* package Marker PType TCAM entry */\n+struct ice_marker_ptype_tcam_entry {\n+#define ICE_MARKER_PTYPE_TCAM_ADDR_MAX\t1024\n+\t__le16 addr;\n+\t__le16 ptype;\n+\tu8 keys[20];\n+};\n+\n+struct ice_marker_ptype_tcam_section {\n+\t__le16 count;\n+\t__le16 reserved;\n+\tstruct ice_marker_ptype_tcam_entry tcam[STRUCT_HACK_VAR_LEN];\n+};\n+\n+#define ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \\\n+\tice_struct_size((struct ice_marker_ptype_tcam_section *)0, tcam, 1) - \\\n+\tsizeof(struct ice_marker_ptype_tcam_entry), \\\n+\tsizeof(struct ice_marker_ptype_tcam_entry))\n+\n struct ice_xlt1_section {\n \t__le16 count;\n \t__le16 offset;\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex bb2cfd07fd..86e93c34a1 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -995,6 +995,7 @@ struct ice_hw {\n \tstruct ice_lock rss_locks;\t/* protect RSS configuration */\n \tstruct LIST_HEAD_TYPE rss_list_head;\n \tstruct ice_vlan_mode_ops vlan_mode_ops;\n+\tice_declare_bitmap(hw_ptype, ICE_FLOW_PTYPE_MAX);\n };\n \n /* Statistics collected by each port, VSI, VEB, and S-channel */\n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}