Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/676715/?format=api
{ "id": 676715, "url": "http://patchwork.ozlabs.org/api/patches/676715/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160929115832.42066.71367.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": "<20160929115832.42066.71367.stgit@ahduyck-blue-test.jf.intel.com>", "list_archive_url": null, "date": "2016-09-29T12:05:53", "name": "[net-next] i40e: Clean up handling of msg_enable flags and debug parameter", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "04b552624ef5ed8f86a2eaccf0570b12ca59ccc8", "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/20160929115832.42066.71367.stgit@ahduyck-blue-test.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/676715/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/676715/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3slMvB4Vb6z9s8x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 30 Sep 2016 04:05:58 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C5A85C1BE1;\n\tThu, 29 Sep 2016 18:05:56 +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 5Xn5tcmKrKFm; Thu, 29 Sep 2016 18:05:54 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C3E1BC1BD3;\n\tThu, 29 Sep 2016 18:05:54 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id DE1EE1CE7FB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 29 Sep 2016 18:05:53 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D9723950BC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 29 Sep 2016 18:05:53 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id SF16ByG2lP2i for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 29 Sep 2016 18:05:53 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 0D580938EC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 29 Sep 2016 18:05:52 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP; 29 Sep 2016 11:05:53 -0700", "from ahduyck-blue-test.jf.intel.com ([134.134.2.201])\n\tby fmsmga002.fm.intel.com with ESMTP; 29 Sep 2016 11:05:52 -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,268,1473145200\"; d=\"scan'208\";\n\ta=\"1064083651\"", "From": "Alexander Duyck <alexander.h.duyck@intel.com>", "To": "sassmann@kpanic.de, intel-wired-lan@lists.osuosl.org,\n\tjeffrey.t.kirsher@intel.com, netdev@vger.kernel.org", "Date": "Thu, 29 Sep 2016 08:05:53 -0400", "Message-ID": "<20160929115832.42066.71367.stgit@ahduyck-blue-test.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Cc": "davem@davemloft.net, linville@tuxdriver.com", "Subject": "[Intel-wired-lan] [net-next PATCH] i40e: Clean up handling of\n\tmsg_enable 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_enable. 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\nSo I am running this through a slightly different process than standard\nbecause there are some items here that might be objectionable so I want to\nhave that ironed out before I deal with the out-of-tree Intel driver.\n\nI just want to verify if this fix for this will work for net-next or if I\nneed to look at taking a different approach. Once I get the go-no-go, I\nwill back-port this into the out-of-tree i40e driver.\n\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 18 ---------------\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 7 +++++-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 28 ++++++++++++------------\n 3 files changed, 20 insertions(+), 33 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex 0c1875b..acb0f13 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));\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..b24c6eb 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,14 +8481,12 @@ 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+\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/* Set default capability flags */\n \tpf->flags = I40E_FLAG_RX_CSUM_ENABLED |\n@@ -10790,10 +10788,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" ] }