Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/511033/?format=api
{ "id": 511033, "url": "http://patchwork.ozlabs.org/api/patches/511033/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1440616461-110869-14-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": "<1440616461-110869-14-git-send-email-catherine.sullivan@intel.com>", "list_archive_url": null, "date": "2015-08-26T19:14:19", "name": "[next,S11,13/15] i40e: fix bug in return from get_link_status and avoid spurious link messages", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b0c12df2f46f3816d5f49001c673e00badcae088", "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/1440616461-110869-14-git-send-email-catherine.sullivan@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/511033/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/511033/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\tby ozlabs.org (Postfix) with ESMTP id 9F57F140311\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 27 Aug 2015 05:13:58 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0009FA2D19;\n\tWed, 26 Aug 2015 19:13:57 +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 xLjL5uHcBDDF; Wed, 26 Aug 2015 19:13:56 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 43E8AA2D6D;\n\tWed, 26 Aug 2015 19:13:56 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9B9D31C1550\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Aug 2015 19:13:54 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9831594F5F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Aug 2015 19:13:54 +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 Z++0XO3nIYjl for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Aug 2015 19:13:54 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1334F94F37\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Aug 2015 19:13:54 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga103.fm.intel.com with ESMTP; 26 Aug 2015 12:13:53 -0700", "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby orsmga003.jf.intel.com with ESMTP; 26 Aug 2015 12:13:53 -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.17,418,1437462000\"; d=\"scan'208\";a=\"632786486\"", "From": "Catherine Sullivan <catherine.sullivan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 26 Aug 2015 15:14:19 -0400", "Message-Id": "<1440616461-110869-14-git-send-email-catherine.sullivan@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1440616461-110869-1-git-send-email-catherine.sullivan@intel.com>", "References": "<1440616461-110869-1-git-send-email-catherine.sullivan@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S11 13/15] i40e: fix bug in return\n\tfrom get_link_status and avoid spurious link messages", "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\nPreviously, the driver could call this function and have only true/false\nreturned, but false could mean multiple things like failure to read\nor link was down. This change allows the caller to get all return values\nin the call chain bubbled back to the source, which keeps information about\nfailures from being lost.\n\nAlso, in some unlikely scenarios, the firmware can become slow to respond\nto admin queue (AQ) queries for link state. Should the AQ time out,\nthe driver can detect the state and avoid a link change when there\nmay have been none.\n\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\nChange-ID: Ib2ac38407b7880750fb891b392fa77457fe6c21c\n---\n drivers/net/ethernet/intel/i40e/i40e_common.c | 15 ++++++++-------\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 11 ++++++++++-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 12 ++++++++++--\n drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 +-\n 4 files changed, 29 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 7a70abc..2839ea5 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -2235,27 +2235,28 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,\n /**\n * i40e_get_link_status - get status of the HW network link\n * @hw: pointer to the hw struct\n+ * @link_up: pointer to bool (true/false = linkup/linkdown)\n *\n- * Returns true if link is up, false if link is down.\n+ * Variable link_up true if link is up, false if link is down.\n+ * The variable link_up is invalid if returned value of status != 0\n *\n * Side effect: LinkStatusEvent reporting becomes enabled\n **/\n-bool i40e_get_link_status(struct i40e_hw *hw)\n+i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)\n {\n \ti40e_status status = 0;\n-\tbool link_status = false;\n \n \tif (hw->phy.get_link_info) {\n \t\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n \n \t\tif (status)\n-\t\t\tgoto i40e_get_link_status_exit;\n+\t\t\ti40e_debug(hw, I40E_DEBUG_LINK, \"get link failed: status %d\\n\",\n+\t\t\t\t status);\n \t}\n \n-\tlink_status = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;\n+\t*link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;\n \n-i40e_get_link_status_exit:\n-\treturn link_status;\n+\treturn status;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 930369c..1fa38f6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -1516,9 +1516,18 @@ static int i40e_link_test(struct net_device *netdev, u64 *data)\n {\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_pf *pf = np->vsi->back;\n+\ti40e_status status;\n+\tbool link_up = false;\n \n \tnetif_info(pf, hw, netdev, \"link test\\n\");\n-\tif (i40e_get_link_status(&pf->hw))\n+\tstatus = i40e_get_link_status(&pf->hw, &link_up);\n+\tif (status) {\n+\t\tnetif_err(pf, drv, netdev, \"link query timed out, please retry test\\n\");\n+\t\t*data = 1;\n+\t\treturn *data;\n+\t}\n+\n+\tif (link_up)\n \t\t*data = 0;\n \telse\n \t\t*data = 1;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 6af199a..1165460 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -5626,15 +5626,23 @@ static void i40e_veb_link_event(struct i40e_veb *veb, bool link_up)\n **/\n static void i40e_link_event(struct i40e_pf *pf)\n {\n-\tbool new_link, old_link;\n \tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \tu8 new_link_speed, old_link_speed;\n+\ti40e_status status;\n+\tbool new_link, old_link;\n \n \t/* set this to force the get_link_status call to refresh state */\n \tpf->hw.phy.get_link_info = true;\n \n \told_link = (pf->hw.phy.link_info_old.link_info & I40E_AQ_LINK_UP);\n-\tnew_link = i40e_get_link_status(&pf->hw);\n+\n+\tstatus = i40e_get_link_status(&pf->hw, &new_link);\n+\tif (status) {\n+\t\tdev_dbg(&pf->pdev->dev, \"couldn't get link state, status: %d\\n\",\n+\t\t\tstatus);\n+\t\treturn;\n+\t}\n+\n \told_link_speed = pf->hw.phy.link_info_old.link_speed;\n \tnew_link_speed = pf->hw.phy.link_info.link_speed;\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\nindex dcb72a8..e51e156 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n@@ -258,7 +258,7 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw);\n i40e_status i40e_pf_reset(struct i40e_hw *hw);\n void i40e_clear_hw(struct i40e_hw *hw);\n void i40e_clear_pxe_mode(struct i40e_hw *hw);\n-bool i40e_get_link_status(struct i40e_hw *hw);\n+i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up);\n i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);\n i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw,\n \t\t\t\t u32 *max_bw, u32 *min_bw, bool *min_valid,\n", "prefixes": [ "next", "S11", "13/15" ] }