get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 459056,
    "url": "http://patchwork.ozlabs.org/api/patches/459056/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1428450342-48517-8-git-send-email-catherine.sullivan@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": "<1428450342-48517-8-git-send-email-catherine.sullivan@intel.com>",
    "list_archive_url": null,
    "date": "2015-04-07T23:45:37",
    "name": "[net-next,S3,08/13] i40e: enable user dump of internal hardware state",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e3178f68f01f727a67259b46d5e14d09cadb00b0",
    "submitter": {
        "id": 13931,
        "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api",
        "name": "Catherine Sullivan",
        "email": "catherine.sullivan@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/1428450342-48517-8-git-send-email-catherine.sullivan@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/459056/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/459056/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "Received": [
            "from silver.osuosl.org (silver.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 54337140187\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Apr 2015 09:42:34 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A4B4C33438;\n\tTue,  7 Apr 2015 23:42:33 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Yaf2tD3VVtix; Tue,  7 Apr 2015 23:42:30 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0353633420;\n\tTue,  7 Apr 2015 23:42:30 +0000 (UTC)",
            "from whitealder.osuosl.org (whitealder.osuosl.org\n\t[140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8B63C1C265F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Apr 2015 23:42:29 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8795C8C49B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Apr 2015 23:42:29 +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 6pIFqmxMJJQV for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Apr 2015 23:42:28 +0000 (UTC)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4E6E490EE8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Apr 2015 23:42:28 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP; 07 Apr 2015 16:42:28 -0700",
            "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Apr 2015 16:42:27 -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-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.11,540,1422950400\"; d=\"scan'208\";a=\"477975441\"",
        "From": "Catherine Sullivan <catherine.sullivan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue,  7 Apr 2015 19:45:37 -0400",
        "Message-Id": "<1428450342-48517-8-git-send-email-catherine.sullivan@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1428450342-48517-1-git-send-email-catherine.sullivan@intel.com>",
        "References": "<1428450342-48517-1-git-send-email-catherine.sullivan@intel.com>",
        "Subject": "[Intel-wired-lan] [net-next S3 08/13] i40e: enable user dump of\n\tinternal hardware state",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Jesse Brandeburg <jesse.brandeburg@intel.com>\n\nThis is a feature to enable better debugging of user reported issues by\nallowing a bash script to acquire information about the internal hardware\nstate. The data output to the kernel log is collected by the script and can\nthen be sent to Intel. This is a critical debugging feature for helping us\ninterpret and reproduce complex customer setups.\n\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\nChange-ID: Ie8b3ab09086d6870a709015f51ada05af10b41bb\n---\n drivers/net/ethernet/intel/i40e/i40e_common.c    | 57 ++++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c   | 45 +++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_prototype.h |  5 +++\n 3 files changed, 107 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 44dc4b1..ce522d7 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -3506,6 +3506,63 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status)\n }\n \n /**\n+ * i40e_aq_debug_dump\n+ * @hw: pointer to the hardware structure\n+ * @cluster_id: specific cluster to dump\n+ * @table_id: table id within cluster\n+ * @start_index: index of line in the block to read\n+ * @buff_size: dump buffer size\n+ * @buff: dump buffer\n+ * @ret_buff_size: actual buffer size returned\n+ * @ret_next_table: next block to read\n+ * @ret_next_index: next index to read\n+ *\n+ * Dump internal FW/HW data for debug purposes.\n+ *\n+ **/\n+i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,\n+\t\t\t       u8 table_id, u32 start_index, u16 buff_size,\n+\t\t\t       void *buff, u16 *ret_buff_size,\n+\t\t\t       u8 *ret_next_table, u32 *ret_next_index,\n+\t\t\t       struct i40e_asq_cmd_details *cmd_details)\n+{\n+\tstruct i40e_aq_desc desc;\n+\tstruct i40e_aqc_debug_dump_internals *cmd =\n+\t\t(struct i40e_aqc_debug_dump_internals *)&desc.params.raw;\n+\tstruct i40e_aqc_debug_dump_internals *resp =\n+\t\t(struct i40e_aqc_debug_dump_internals *)&desc.params.raw;\n+\ti40e_status status;\n+\n+\tif (buff_size == 0 || !buff)\n+\t\treturn I40E_ERR_PARAM;\n+\n+\ti40e_fill_default_direct_cmd_desc(&desc,\n+\t\t\t\t\t  i40e_aqc_opc_debug_dump_internals);\n+\t/* Indirect Command */\n+\tdesc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF);\n+\tif (buff_size > I40E_AQ_LARGE_BUF)\n+\t\tdesc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);\n+\n+\tcmd->cluster_id = cluster_id;\n+\tcmd->table_id = table_id;\n+\tcmd->idx = cpu_to_le32(start_index);\n+\n+\tdesc.datalen = cpu_to_le16(buff_size);\n+\n+\tstatus = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);\n+\tif (!status) {\n+\t\tif (ret_buff_size)\n+\t\t\t*ret_buff_size = le16_to_cpu(desc.datalen);\n+\t\tif (ret_next_table)\n+\t\t\t*ret_next_table = resp->table_id;\n+\t\tif (ret_next_index)\n+\t\t\t*ret_next_index = le32_to_cpu(resp->idx);\n+\t}\n+\n+\treturn status;\n+}\n+\n+/**\n  * i40e_read_bw_from_alt_ram\n  * @hw: pointer to the hardware structure\n  * @max_bw: pointer for max_bw read\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex daa8826..34170ea 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -1388,6 +1388,50 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\t\t\t r_cfg->app[i].selector,\n \t\t\t\t\t r_cfg->app[i].protocolid);\n \t\t\t}\n+\t\t} else if (strncmp(&cmd_buf[5], \"debug fwdata\", 12) == 0) {\n+\t\t\tint cluster_id, table_id;\n+\t\t\tint index, ret;\n+\t\t\tu16 buff_len = 4096;\n+\t\t\tu32 next_index;\n+\t\t\tu8 next_table;\n+\t\t\tu8 *buff;\n+\t\t\tu16 rlen;\n+\n+\t\t\tcnt = sscanf(&cmd_buf[18], \"%i %i %i\",\n+\t\t\t\t     &cluster_id, &table_id, &index);\n+\t\t\tif (cnt != 3) {\n+\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t\t \"dump debug fwdata <cluster_id> <table_id> <index>\\n\");\n+\t\t\t\tgoto command_write_done;\n+\t\t\t}\n+\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"AQ debug dump fwdata params %x %x %x %x\\n\",\n+\t\t\t\t cluster_id, table_id, index, buff_len);\n+\t\t\tbuff = kzalloc(buff_len, GFP_KERNEL);\n+\t\t\tif (!buff)\n+\t\t\t\tgoto command_write_done;\n+\n+\t\t\tret = i40e_aq_debug_dump(&pf->hw, cluster_id, table_id,\n+\t\t\t\t\t\t index, buff_len, buff, &rlen,\n+\t\t\t\t\t\t &next_table, &next_index,\n+\t\t\t\t\t\t NULL);\n+\t\t\tif (ret) {\n+\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t\t \"debug dump fwdata AQ Failed %d 0x%x\\n\",\n+\t\t\t\t\t ret, pf->hw.aq.asq_last_status);\n+\t\t\t\tkfree(buff);\n+\t\t\t\tbuff = NULL;\n+\t\t\t\tgoto command_write_done;\n+\t\t\t}\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"AQ debug dump fwdata rlen=0x%x next_table=0x%x next_index=0x%x\\n\",\n+\t\t\t\t rlen, next_table, next_index);\n+\t\t\tprint_hex_dump(KERN_INFO, \"AQ buffer WB: \",\n+\t\t\t\t       DUMP_PREFIX_OFFSET, 16, 1,\n+\t\t\t\t       buff, rlen, true);\n+\t\t\tkfree(buff);\n+\t\t\tbuff = NULL;\n \t\t} else {\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\\n\");\n@@ -1903,6 +1947,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\tdev_info(&pf->pdev->dev, \"  dump desc rx <vsi_seid> <ring_id> [<desc_n>]\\n\");\n \t\tdev_info(&pf->pdev->dev, \"  dump desc aq\\n\");\n \t\tdev_info(&pf->pdev->dev, \"  dump reset stats\\n\");\n+\t\tdev_info(&pf->pdev->dev, \"  dump debug fwdata <cluster_id> <table_id> <index>\\n\");\n \t\tdev_info(&pf->pdev->dev, \"  msg_enable [level]\\n\");\n \t\tdev_info(&pf->pdev->dev, \"  read <reg>\\n\");\n \t\tdev_info(&pf->pdev->dev, \"  write <reg> <value>\\n\");\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\nindex fea0d37..7b34f1e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n@@ -303,4 +303,9 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,\n \t\t\t\tu16 vsi_seid, u16 queue, bool is_add,\n \t\t\t\tstruct i40e_control_filter_stats *stats,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n+i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,\n+\t\t\t       u8 table_id, u32 start_index, u16 buff_size,\n+\t\t\t       void *buff, u16 *ret_buff_size,\n+\t\t\t       u8 *ret_next_table, u32 *ret_next_index,\n+\t\t\t       struct i40e_asq_cmd_details *cmd_details);\n #endif /* _I40E_PROTOTYPE_H_ */\n",
    "prefixes": [
        "net-next",
        "S3",
        "08/13"
    ]
}