get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 677165,
    "url": "http://patchwork.ozlabs.org/api/patches/677165/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160930122104.12039.57727.stgit@ahduyck-blue-test.jf.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": "<20160930122104.12039.57727.stgit@ahduyck-blue-test.jf.intel.com>",
    "list_archive_url": null,
    "date": "2016-09-30T12:21:46",
    "name": "[net-next,v3] i40e: Clean up handling of msglevel flags and debug parameter",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4426744b4d4d880046c0bfb94046f29217a0cebc",
    "submitter": {
        "id": 251,
        "url": "http://patchwork.ozlabs.org/api/people/251/?format=api",
        "name": "Duyck, Alexander H",
        "email": "alexander.h.duyck@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/20160930122104.12039.57727.stgit@ahduyck-blue-test.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/677165/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/677165/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3sm0CB1MHLz9sdg\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  1 Oct 2016 04:21:58 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 7B43E92856;\n\tFri, 30 Sep 2016 18:21: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 SZUOs8EMg4kz; Fri, 30 Sep 2016 18:21:55 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 659FE9284E;\n\tFri, 30 Sep 2016 18:21:55 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 385941C1EA5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 30 Sep 2016 18:21:54 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 34598A6EFF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 30 Sep 2016 18:21:54 +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 17o8BibNnd5x for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 30 Sep 2016 18:21:52 +0000 (UTC)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 98AEBA6EF2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 30 Sep 2016 18:21:52 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga105.jf.intel.com with ESMTP; 30 Sep 2016 11:21:52 -0700",
            "from ahduyck-blue-test.jf.intel.com ([134.134.2.201])\n\tby fmsmga004.fm.intel.com with ESMTP; 30 Sep 2016 11:21:51 -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.31,274,1473145200\"; d=\"scan'208\";a=\"175076129\"",
        "From": "Alexander Duyck <alexander.h.duyck@intel.com>",
        "To": "sassmann@kpanic.de, intel-wired-lan@lists.osuosl.org,\n\tjeffrey.t.kirsher@intel.com",
        "Date": "Fri, 30 Sep 2016 08:21:46 -0400",
        "Message-ID": "<20160930122104.12039.57727.stgit@ahduyck-blue-test.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [net-next PATCH v3] i40e: Clean up handling of\n\tmsglevel flags and debug parameter",
        "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>",
        "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": "So the i40e driver had a really convoluted configuration for how to handle\nthe debug flags contained in msg_level.  Part of the issue is that the\ndriver has its own 32 bit mask that it was using to track a separate set of\ndebug features.  From what I can tell it was trying to use the upper 4 bits\nto determine if the value was meant to represent a bit-mask or the numeric\nvalue provided by debug level.\n\nWhat this patch does is clean this up by compressing those 4 bits into bit\n31, as a result we just have to perform a check against the value being\nnegative to determine if we are looking at a debug level (positive), or a\ndebug mask (negative).  The debug level will populate the msg_level, and\nthe debug mask will populate the debug_mask in the hardware struct.\n\nI added similar logic for ethtool.  If the value being provided has bit 31\nset we assume the value being provided is a debug mask, otherwise we assume\nit is a msg_enable mask.  For displaying we only provide the msg_enable,\nand if debug_mask is in use we will print it to the dmesg log.\n\nLastly I removed the debugfs interface.  It is redundant with what we\nalready have in ethtool and really doesn't belong anyway.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n\nv2: Consolidated setup for msg_enable and hw.debug_mask to one point in probe.\nv3: Removed msg_enable from list of debugfs commands listed.\n\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c |   19 -------------------\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c |    7 ++++++-\n drivers/net/ethernet/intel/i40e/i40e_main.c    |   23 ++++++++---------------\n 3 files changed, 14 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex 0c1875b..0354632 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -1210,24 +1210,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"dump debug fwdata <cluster_id> <table_id> <index>\\n\");\n \t\t}\n-\n-\t} else if (strncmp(cmd_buf, \"msg_enable\", 10) == 0) {\n-\t\tu32 level;\n-\t\tcnt = sscanf(&cmd_buf[10], \"%i\", &level);\n-\t\tif (cnt) {\n-\t\t\tif (I40E_DEBUG_USER & level) {\n-\t\t\t\tpf->hw.debug_mask = level;\n-\t\t\t\tdev_info(&pf->pdev->dev,\n-\t\t\t\t\t \"set hw.debug_mask = 0x%08x\\n\",\n-\t\t\t\t\t pf->hw.debug_mask);\n-\t\t\t}\n-\t\t\tpf->msg_enable = level;\n-\t\t\tdev_info(&pf->pdev->dev, \"set msg_enable = 0x%08x\\n\",\n-\t\t\t\t pf->msg_enable);\n-\t\t} else {\n-\t\t\tdev_info(&pf->pdev->dev, \"msg_enable = 0x%08x\\n\",\n-\t\t\t\t pf->msg_enable);\n-\t\t}\n \t} else if (strncmp(cmd_buf, \"pfr\", 3) == 0) {\n \t\tdev_info(&pf->pdev->dev, \"debugfs: forcing PFR\\n\");\n \t\ti40e_do_reset_safe(pf, BIT(__I40E_PF_RESET_REQUESTED));\n@@ -1644,7 +1626,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\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\");\n \t\tdev_info(&pf->pdev->dev, \"  clear_stats vsi [seid]\\n\");\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex e79a920..b133a77 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -978,6 +978,10 @@ static u32 i40e_get_msglevel(struct net_device *netdev)\n {\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_pf *pf = np->vsi->back;\n+\tu32 debug_mask = pf->hw.debug_mask;\n+\n+\tif (debug_mask)\n+\t\tnetdev_info(netdev, \"i40e debug_mask: 0x%08X\\n\", debug_mask);\n \n \treturn pf->msg_enable;\n }\n@@ -989,7 +993,8 @@ static void i40e_set_msglevel(struct net_device *netdev, u32 data)\n \n \tif (I40E_DEBUG_USER & data)\n \t\tpf->hw.debug_mask = data;\n-\tpf->msg_enable = data;\n+\telse\n+\t\tpf->msg_enable = data;\n }\n \n static int i40e_get_regs_len(struct net_device *netdev)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex b93fa2a..c5417aa 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -93,8 +93,8 @@ MODULE_DEVICE_TABLE(pci, i40e_pci_tbl);\n \n #define I40E_MAX_VF_COUNT 128\n static int debug = -1;\n-module_param(debug, int, 0);\n-MODULE_PARM_DESC(debug, \"Debug level (0=none,...,16=all)\");\n+module_param(debug, uint, 0);\n+MODULE_PARM_DESC(debug, \"Debug level (0=none,...,16=all), Debug mask (0x8XXXXXXX)\");\n \n MODULE_AUTHOR(\"Intel Corporation, <e1000-devel@lists.sourceforge.net>\");\n MODULE_DESCRIPTION(\"Intel(R) Ethernet Connection XL710 Network Driver\");\n@@ -8481,15 +8481,6 @@ static int i40e_sw_init(struct i40e_pf *pf)\n \tint err = 0;\n \tint size;\n \n-\tpf->msg_enable = netif_msg_init(I40E_DEFAULT_MSG_ENABLE,\n-\t\t\t\t(NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK));\n-\tif (debug != -1 && debug != I40E_DEFAULT_MSG_ENABLE) {\n-\t\tif (I40E_DEBUG_USER & debug)\n-\t\t\tpf->hw.debug_mask = debug;\n-\t\tpf->msg_enable = netif_msg_init((debug & ~I40E_DEBUG_USER),\n-\t\t\t\t\t\tI40E_DEFAULT_MSG_ENABLE);\n-\t}\n-\n \t/* Set default capability flags */\n \tpf->flags = I40E_FLAG_RX_CSUM_ENABLED |\n \t\t    I40E_FLAG_MSI_ENABLED     |\n@@ -10790,10 +10781,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tmutex_init(&hw->aq.asq_mutex);\n \tmutex_init(&hw->aq.arq_mutex);\n \n-\tif (debug != -1) {\n-\t\tpf->msg_enable = pf->hw.debug_mask;\n-\t\tpf->msg_enable = debug;\n-\t}\n+\tpf->msg_enable = netif_msg_init(debug,\n+\t\t\t\t\tNETIF_MSG_DRV |\n+\t\t\t\t\tNETIF_MSG_PROBE |\n+\t\t\t\t\tNETIF_MSG_LINK);\n+\tif (debug < -1)\n+\t\tpf->hw.debug_mask = debug;\n \n \t/* do a special CORER for clearing PXE mode once at init */\n \tif (hw->revision_id == 0 &&\n",
    "prefixes": [
        "net-next",
        "v3"
    ]
}