get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57902,
    "url": "https://patches.dpdk.org/api/patches/57902/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190826105105.19121-7-qi.z.zhang@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": "<20190826105105.19121-7-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190826105105.19121-7-qi.z.zhang@intel.com",
    "date": "2019-08-26T10:50:08",
    "name": "[06/63] net/ice/base: add read PBA module function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "008465164f594444b4544640566c514d4d44c5e7",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@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/20190826105105.19121-7-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 6119,
            "url": "https://patches.dpdk.org/api/series/6119/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6119",
            "date": "2019-08-26T10:50:02",
            "name": "net/ice/base: update base code",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6119/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57902/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/57902/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7783D1BFF3;\n\tMon, 26 Aug 2019 12:48:42 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id AFD5E1BFC2\n\tfor <dev@dpdk.org>; Mon, 26 Aug 2019 12:48:36 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Aug 2019 03:48:36 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n\tby orsmga003.jf.intel.com with ESMTP; 26 Aug 2019 03:48:34 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,431,1559545200\"; d=\"scan'208\";a=\"182402082\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "wenzhuo.lu@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n\tTarun Singh <tarun.k.singh@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Mon, 26 Aug 2019 18:50:08 +0800",
        "Message-Id": "<20190826105105.19121-7-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "References": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 06/63] net/ice/base: add read PBA module function",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "New support function added - ice_get_pfa_module_tlv(), the driver or\nother modules can make use of this function to read the pfa area.\n\nSigned-off-by: Tarun Singh <tarun.k.singh@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 66 +++++++++++++++++++++++++++++++++++++++\n drivers/net/ice/base/ice_common.h |  3 ++\n 2 files changed, 69 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex fa97b792e..0356537a4 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -1283,6 +1283,72 @@ enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req)\n \treturn ice_check_reset(hw);\n }\n \n+/**\n+ * ice_get_pfa_module_tlv - Reads sub module TLV from NVM PFA\n+ * @hw: pointer to hardware structure\n+ * @module_tlv: pointer to module TLV to return\n+ * @module_tlv_len: pointer to module TLV length to return\n+ * @module_type: module type requested\n+ *\n+ * Finds the requested sub module TLV type from the Preserved Field\n+ * Area (PFA) and returns the TLV pointer and length. The caller can\n+ * use these to read the variable length TLV value.\n+ */\n+enum ice_status\n+ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,\n+\t\t       u16 module_type)\n+{\n+\tenum ice_status status;\n+\tu16 pfa_len, pfa_ptr;\n+\tu16 next_tlv;\n+\n+\tstatus = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr);\n+\tif (status != ICE_SUCCESS) {\n+\t\tice_debug(hw, ICE_DBG_INIT, \"Preserved Field Array pointer.\\n\");\n+\t\treturn status;\n+\t}\n+\tstatus = ice_read_sr_word(hw, pfa_ptr, &pfa_len);\n+\tif (status != ICE_SUCCESS) {\n+\t\tice_debug(hw, ICE_DBG_INIT, \"Failed to read PFA length.\\n\");\n+\t\treturn status;\n+\t}\n+\t/* Starting with first TLV after PFA length, iterate through the list\n+\t * of TLVs to find the requested one.\n+\t */\n+\tnext_tlv = pfa_ptr + 1;\n+\twhile (next_tlv < pfa_ptr + pfa_len) {\n+\t\tu16 tlv_sub_module_type;\n+\t\tu16 tlv_len;\n+\n+\t\t/* Read TLV type */\n+\t\tstatus = ice_read_sr_word(hw, next_tlv, &tlv_sub_module_type);\n+\t\tif (status != ICE_SUCCESS) {\n+\t\t\tice_debug(hw, ICE_DBG_INIT, \"Failed to read TLV type.\\n\");\n+\t\t\tbreak;\n+\t\t}\n+\t\t/* Read TLV length */\n+\t\tstatus = ice_read_sr_word(hw, next_tlv + 1, &tlv_len);\n+\t\tif (status != ICE_SUCCESS) {\n+\t\t\tice_debug(hw, ICE_DBG_INIT, \"Failed to read TLV length.\\n\");\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (tlv_sub_module_type == module_type) {\n+\t\t\tif (tlv_len) {\n+\t\t\t\t*module_tlv = next_tlv;\n+\t\t\t\t*module_tlv_len = tlv_len;\n+\t\t\t\treturn ICE_SUCCESS;\n+\t\t\t}\n+\t\t\treturn ICE_ERR_INVAL_SIZE;\n+\t\t}\n+\t\t/* Check next TLV, i.e. current TLV pointer + length + 2 words\n+\t\t * (for current TLV's type and length)\n+\t\t */\n+\t\tnext_tlv = next_tlv + tlv_len + 2;\n+\t}\n+\t/* Module does not exist */\n+\treturn ICE_ERR_DOES_NOT_EXIST;\n+}\n+\n \n \n /**\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 009c052ca..c5170f705 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -21,6 +21,9 @@ enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);\n \n enum ice_status ice_init_hw(struct ice_hw *hw);\n void ice_deinit_hw(struct ice_hw *hw);\n+enum ice_status\n+ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,\n+\t\t       u16 module_type);\n enum ice_status ice_check_reset(struct ice_hw *hw);\n enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req);\n \n",
    "prefixes": [
        "06/63"
    ]
}