get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1165378,
    "url": "http://patchwork.ozlabs.org/api/patches/1165378/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190920091724.51767-1-alice.michael@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190920091724.51767-1-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2019-09-20T09:17:15",
    "name": "[next,S10,01/10] i40e: Fix for persistent lldp support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d73dba3301fb6638d775fe6d86d00f88633a008b",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190920091724.51767-1-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 131821,
            "url": "http://patchwork.ozlabs.org/api/series/131821/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=131821",
            "date": "2019-09-20T09:17:15",
            "name": "[next,S10,01/10] i40e: Fix for persistent lldp support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/131821/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1165378/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1165378/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 46Zgvy4vgRz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 21 Sep 2019 03:39:57 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 29927870B3;\n\tFri, 20 Sep 2019 17:39:56 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id efbDLMixhblJ; Fri, 20 Sep 2019 17:39:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BCE4A86E88;\n\tFri, 20 Sep 2019 17:39:54 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3C3041BF2C6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Sep 2019 17:39:53 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3870F85852\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Sep 2019 17:39:53 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id qYwVcgz0lRcU for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Sep 2019 17:39:52 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 4D45685764\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Sep 2019 17:39:52 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Sep 2019 10:39:51 -0700",
            "from alicemic-1.jf.intel.com ([10.166.17.62])\n\tby fmsmga004.fm.intel.com with ESMTP; 20 Sep 2019 10:39:50 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,529,1559545200\"; d=\"scan'208\";a=\"212635320\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 20 Sep 2019 02:17:15 -0700",
        "Message-Id": "<20190920091724.51767-1-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH S10 01/10] i40e: Fix for persistent\n\tlldp support",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Sylwia Wnuczko <sylwia.wnuczko@intel.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Sylwia Wnuczko <sylwia.wnuczko@intel.com>\n\nThis patch fixes function to read nvm module data and uses it to\nread current lldp agent configuration from nvm api version 1.8.\n\nSigned-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_dcb.c    |  4 +-\n drivers/net/ethernet/intel/i40e/i40e_dcb.h    |  3 +\n drivers/net/ethernet/intel/i40e/i40e_nvm.c    | 61 ++++++++++---------\n .../net/ethernet/intel/i40e/i40e_prototype.h  | 10 +--\n 4 files changed, 44 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.c b/drivers/net/ethernet/intel/i40e/i40e_dcb.c\nindex 200a1cb3b536..9de503c5f99b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_dcb.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.c\n@@ -889,7 +889,9 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change)\n \n \t\tret = i40e_read_nvm_module_data(hw,\n \t\t\t\t\t\tI40E_SR_EMP_SR_SETTINGS_PTR,\n-\t\t\t\t\t\toffset, 1,\n+\t\t\t\t\t\toffset,\n+\t\t\t\t\t\tI40E_LLDP_CURRENT_STATUS_OFFSET,\n+\t\t\t\t\t\tI40E_LLDP_CURRENT_STATUS_SIZE,\n \t\t\t\t\t\t&lldp_cfg.adminstatus);\n \t} else {\n \t\tret = i40e_read_lldp_cfg(hw, &lldp_cfg);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.h b/drivers/net/ethernet/intel/i40e/i40e_dcb.h\nindex 2a80c5daa376..ba86ad833bee 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_dcb.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.h\n@@ -32,6 +32,9 @@\n #define I40E_CEE_MAX_FEAT_TYPE\t\t3\n #define I40E_LLDP_CURRENT_STATUS_XL710_OFFSET\t0x2B\n #define I40E_LLDP_CURRENT_STATUS_X722_OFFSET\t0x31\n+#define I40E_LLDP_CURRENT_STATUS_OFFSET\t\t1\n+#define I40E_LLDP_CURRENT_STATUS_SIZE\t\t1\n+\n /* Defines for LLDP TLV header */\n #define I40E_LLDP_TLV_LEN_SHIFT\t\t0\n #define I40E_LLDP_TLV_LEN_MASK\t\t(0x01FF << I40E_LLDP_TLV_LEN_SHIFT)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\nindex b30acab1314c..e5cfd0178b7c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c\n@@ -323,20 +323,24 @@ i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,\n \n /**\n  * i40e_read_nvm_module_data - Reads NVM Buffer to specified memory location\n- * @hw: pointer to the HW structure\n+ * @hw: Pointer to the HW structure\n  * @module_ptr: Pointer to module in words with respect to NVM beginning\n- * @offset: offset in words from module start\n+ * @module_offset: Offset in words from module start\n+ * @data_offset: Offset in words from reading data area start\n  * @words_data_size: Words to read from NVM\n  * @data_ptr: Pointer to memory location where resulting buffer will be stored\n  **/\n-i40e_status i40e_read_nvm_module_data(struct i40e_hw *hw,\n-\t\t\t\t      u8 module_ptr, u16 offset,\n-\t\t\t\t      u16 words_data_size,\n-\t\t\t\t      u16 *data_ptr)\n+enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw,\n+\t\t\t\t\t\tu8 module_ptr,\n+\t\t\t\t\t\tu16 module_offset,\n+\t\t\t\t\t\tu16 data_offset,\n+\t\t\t\t\t\tu16 words_data_size,\n+\t\t\t\t\t\tu16 *data_ptr)\n {\n \ti40e_status status;\n+\tu16 specific_ptr = 0;\n \tu16 ptr_value = 0;\n-\tu32 flat_offset;\n+\tu32 offset = 0;\n \n \tif (module_ptr != 0) {\n \t\tstatus = i40e_read_nvm_word(hw, module_ptr, &ptr_value);\n@@ -352,36 +356,35 @@ i40e_status i40e_read_nvm_module_data(struct i40e_hw *hw,\n \n \t/* Pointer not initialized */\n \tif (ptr_value == I40E_NVM_INVALID_PTR_VAL ||\n-\t    ptr_value == I40E_NVM_INVALID_VAL)\n+\t    ptr_value == I40E_NVM_INVALID_VAL) {\n+\t\ti40e_debug(hw, I40E_DEBUG_ALL, \"Pointer not initialized.\\n\");\n \t\treturn I40E_ERR_BAD_PTR;\n+\t}\n \n \t/* Check whether the module is in SR mapped area or outside */\n \tif (ptr_value & I40E_PTR_TYPE) {\n \t\t/* Pointer points outside of the Shared RAM mapped area */\n-\t\tptr_value &= ~I40E_PTR_TYPE;\n+\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n+\t\t\t   \"Reading nvm data failed. Pointer points outside of the Shared RAM mapped area.\\n\");\n \n-\t\t/* PtrValue in 4kB units, need to convert to words */\n-\t\tptr_value /= 2;\n-\t\tflat_offset = ((u32)ptr_value * 0x1000) + (u32)offset;\n-\t\tstatus = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);\n-\t\tif (!status) {\n-\t\t\tstatus = i40e_aq_read_nvm(hw, 0, 2 * flat_offset,\n-\t\t\t\t\t\t  2 * words_data_size,\n-\t\t\t\t\t\t  data_ptr, true, NULL);\n-\t\t\ti40e_release_nvm(hw);\n-\t\t\tif (status) {\n-\t\t\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n-\t\t\t\t\t   \"Reading nvm aq failed.Error code: %d.\\n\",\n-\t\t\t\t\t   status);\n-\t\t\t\treturn I40E_ERR_NVM;\n-\t\t\t}\n-\t\t} else {\n-\t\t\treturn I40E_ERR_NVM;\n-\t\t}\n+\t\treturn I40E_ERR_PARAM;\n \t} else {\n \t\t/* Read from the Shadow RAM */\n-\t\tstatus = i40e_read_nvm_buffer(hw, ptr_value + offset,\n-\t\t\t\t\t      &words_data_size, data_ptr);\n+\n+\t\tstatus = i40e_read_nvm_word(hw, ptr_value + module_offset,\n+\t\t\t\t\t    &specific_ptr);\n+\t\tif (status) {\n+\t\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n+\t\t\t\t   \"Reading nvm word failed.Error code: %d.\\n\",\n+\t\t\t\t   status);\n+\t\t\treturn I40E_ERR_NVM;\n+\t\t}\n+\n+\t\toffset = ptr_value + module_offset + specific_ptr +\n+\t\t\tdata_offset;\n+\n+\t\tstatus = i40e_read_nvm_buffer(hw, offset, &words_data_size,\n+\t\t\t\t\t      data_ptr);\n \t\tif (status) {\n \t\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n \t\t\t\t   \"Reading nvm buffer failed.Error code: %d.\\n\",\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\nindex 5250441bf75b..7effe5010e32 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n@@ -315,10 +315,12 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw,\n void i40e_release_nvm(struct i40e_hw *hw);\n i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,\n \t\t\t\t\t u16 *data);\n-i40e_status i40e_read_nvm_module_data(struct i40e_hw *hw,\n-\t\t\t\t      u8 module_ptr, u16 offset,\n-\t\t\t\t      u16 words_data_size,\n-\t\t\t\t      u16 *data_ptr);\n+enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw,\n+\t\t\t\t\t\tu8 module_ptr,\n+\t\t\t\t\t\tu16 module_offset,\n+\t\t\t\t\t\tu16 data_offset,\n+\t\t\t\t\t\tu16 words_data_size,\n+\t\t\t\t\t\tu16 *data_ptr);\n i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,\n \t\t\t\t u16 *words, u16 *data);\n i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw);\n",
    "prefixes": [
        "next",
        "S10",
        "01/10"
    ]
}