Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/724771/?format=api
{ "id": 724771, "url": "http://patchwork.ozlabs.org/api/patches/724771/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206222113.14170-1-jacob.e.keller@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": "<20170206222113.14170-1-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2017-02-06T22:21:13", "name": "fm10k: do not enqueue mailbox when host not ready", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "16a775825e4e675cb6f630cf24e861b8c385c54d", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20170206222113.14170-1-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/724771/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/724771/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 3vHMPz252Sz9s2P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 7 Feb 2017 09:21:26 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ED99D88DA9;\n\tMon, 6 Feb 2017 22:21:24 +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 pwbQmKvfUyc6; Mon, 6 Feb 2017 22:21:23 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0390688D9C;\n\tMon, 6 Feb 2017 22:21:23 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 24D0E1BFF07\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:21:21 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 20E5688D84\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:21:21 +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 VmgZ1IFO1iQB for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:21:18 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 527EC88DA9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:21:18 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP; 06 Feb 2017 14:21:17 -0800", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.174])\n\tby FMSMGA003.fm.intel.com with ESMTP; 06 Feb 2017 14:21:17 -0800" ], "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.33,342,1477983600\"; d=\"scan'208\";a=\"817794077\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Mon, 6 Feb 2017 14:21:13 -0800", "Message-Id": "<20170206222113.14170-1-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.12.0.rc0.151.g8a5726c42288", "Cc": "Ngai-Mint Kwan <ngai-mint.kwan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH] fm10k: do not enqueue mailbox when host\n\tnot ready", "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: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>\n\nInterfaces will reset whenever the TX mailbox FIFO has become full. This\noccurs more frequently whenever the IES API application is not running\nto process and clear the messages in the FIFO. Thus, this could lead to\nsituations where the interface would enter an infinite reset loop. That\nis: if the interface is trying to synchronize a huge number of unicast\nand multicast entries with the IES API application, the TX mailbox FIFO\nwill become full and the interface resets. Once the interface exits\nreset, it'll try to synchronize the unicast and multicast entries again.\nErgo, this creates an infinite loop. Other actions such as multiple\nmulitcast mode or up/down transitions will fill the TX mailbox FIFO and\ninduce the interface to reset. To correct these situations, check if the\ninterface's \"host_ready\" flag is enabled before enqueuing any messages\nto the TX mailbox FIFO. This check will be conducted by a function call.\nLastly, this issue mainly affects the PF and, thus, the VF is exempt.\n\nSigned-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 105 ++++++++++++++++++------\n 1 file changed, 80 insertions(+), 25 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\nindex 1aa0f7aabcc0..4200956197d5 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n@@ -737,6 +737,23 @@ static void fm10k_tx_timeout(struct net_device *netdev)\n \t}\n }\n \n+/**\n+ * fm10k_host_mbx_ready - Check PF interface's mailbox readiness\n+ * @interface: board private structure\n+ *\n+ * This function checks if the PF interface's mailbox is ready before queueing\n+ * mailbox messages for transmission. This will prevent filling the TX mailbox\n+ * queue when the receiver is not ready. VF interfaces are exempt from this\n+ * check since it will block all PF-VF mailbox messages from being sent from\n+ * the VF to the PF at initialization.\n+ **/\n+static bool fm10k_host_mbx_ready(struct fm10k_intfc *interface)\n+{\n+\tstruct fm10k_hw *hw = &interface->hw;\n+\n+\treturn (hw->mac.type == fm10k_mac_vf || interface->host_ready);\n+}\n+\n static int fm10k_uc_vlan_unsync(struct net_device *netdev,\n \t\t\t\tconst unsigned char *uc_addr)\n {\n@@ -745,12 +762,15 @@ static int fm10k_uc_vlan_unsync(struct net_device *netdev,\n \tu16 glort = interface->glort;\n \tu16 vid = interface->vid;\n \tbool set = !!(vid / VLAN_N_VID);\n-\tint err;\n+\tint err = -EHOSTDOWN;\n \n \t/* drop any leading bits on the VLAN ID */\n \tvid &= VLAN_N_VID - 1;\n \n-\terr = hw->mac.ops.update_uc_addr(hw, glort, uc_addr, vid, set, 0);\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\terr = hw->mac.ops.update_uc_addr(hw, glort, uc_addr,\n+\t\t\t\t\t\t vid, set, 0);\n+\n \tif (err)\n \t\treturn err;\n \n@@ -766,12 +786,14 @@ static int fm10k_mc_vlan_unsync(struct net_device *netdev,\n \tu16 glort = interface->glort;\n \tu16 vid = interface->vid;\n \tbool set = !!(vid / VLAN_N_VID);\n-\tint err;\n+\tint err = -EHOSTDOWN;\n \n \t/* drop any leading bits on the VLAN ID */\n \tvid &= VLAN_N_VID - 1;\n \n-\terr = hw->mac.ops.update_mc_addr(hw, glort, mc_addr, vid, set);\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\terr = hw->mac.ops.update_mc_addr(hw, glort, mc_addr, vid, set);\n+\n \tif (err)\n \t\treturn err;\n \n@@ -834,9 +856,13 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)\n \t\t\tgoto err_out;\n \t}\n \n-\t/* update our base MAC address */\n-\terr = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,\n-\t\t\t\t\t vid, set, 0);\n+\t/* update our base MAC address if host's mailbox is ready */\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\terr = hw->mac.ops.update_uc_addr(hw, interface->glort,\n+\t\t\t\t\t\t hw->mac.addr, vid, set, 0);\n+\telse\n+\t\terr = -EHOSTDOWN;\n+\n \tif (err)\n \t\tgoto err_out;\n \n@@ -907,12 +933,15 @@ static int __fm10k_uc_sync(struct net_device *dev,\n \tif (!is_valid_ether_addr(addr))\n \t\treturn -EADDRNOTAVAIL;\n \n-\t/* update table with current entries */\n+\t/* update table with current entries if host's mailbox is ready */\n+\tif (!fm10k_host_mbx_ready(interface))\n+\t\treturn -EHOSTDOWN;\n+\n \tfor (vid = hw->mac.default_vid ? fm10k_find_next_vlan(interface, 0) : 1;\n \t vid < VLAN_N_VID;\n \t vid = fm10k_find_next_vlan(interface, vid)) {\n \t\terr = hw->mac.ops.update_uc_addr(hw, glort, addr,\n-\t\t\t\t\t\t vid, sync, 0);\n+\t\t\t\t\t\t vid, sync, 0);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n@@ -970,7 +999,10 @@ static int __fm10k_mc_sync(struct net_device *dev,\n \tstruct fm10k_hw *hw = &interface->hw;\n \tu16 vid, glort = interface->glort;\n \n-\t/* update table with current entries */\n+\t/* update table with current entries if host's mailbox is ready */\n+\tif (!fm10k_host_mbx_ready(interface))\n+\t\treturn 0;\n+\n \tfor (vid = hw->mac.default_vid ? fm10k_find_next_vlan(interface, 0) : 1;\n \t vid < VLAN_N_VID;\n \t vid = fm10k_find_next_vlan(interface, vid)) {\n@@ -1018,8 +1050,10 @@ static void fm10k_set_rx_mode(struct net_device *dev)\n \t\tif (interface->xcast_mode == FM10K_XCAST_MODE_PROMISC)\n \t\t\tfm10k_clear_unused_vlans(interface);\n \n-\t\t/* update xcast mode */\n-\t\thw->mac.ops.update_xcast_mode(hw, interface->glort, xcast_mode);\n+\t\t/* update xcast mode if host's mailbox is ready */\n+\t\tif (fm10k_host_mbx_ready(interface))\n+\t\t\thw->mac.ops.update_xcast_mode(hw, interface->glort,\n+\t\t\t\t\t\t xcast_mode);\n \n \t\t/* record updated xcast mode state */\n \t\tinterface->xcast_mode = xcast_mode;\n@@ -1054,8 +1088,10 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)\n \n \tfm10k_mbx_lock(interface);\n \n-\t/* Enable logical port */\n-\thw->mac.ops.update_lport_state(hw, glort, interface->glort_count, true);\n+\t/* Enable logical port if host's mailbox is ready */\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\thw->mac.ops.update_lport_state(hw, glort,\n+\t\t\t\t\t interface->glort_count, true);\n \n \t/* update VLAN table */\n \thw->mac.ops.update_vlan(hw, FM10K_VLAN_ALL, 0,\n@@ -1069,12 +1105,18 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)\n \t vid < VLAN_N_VID;\n \t vid = fm10k_find_next_vlan(interface, vid)) {\n \t\thw->mac.ops.update_vlan(hw, vid, 0, true);\n-\t\thw->mac.ops.update_uc_addr(hw, glort, hw->mac.addr,\n-\t\t\t\t\t vid, true, 0);\n+\n+\t\t/* Update unicast entries if host's mailbox is ready */\n+\t\tif (fm10k_host_mbx_ready(interface))\n+\t\t\thw->mac.ops.update_uc_addr(hw, glort, hw->mac.addr,\n+\t\t\t\t\t\t vid, true, 0);\n \t}\n \n-\t/* update xcast mode before synchronizing addresses */\n-\thw->mac.ops.update_xcast_mode(hw, glort, xcast_mode);\n+\t/* update xcast mode before synchronizing addresses if host's mailbox\n+\t * is ready\n+\t */\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\thw->mac.ops.update_xcast_mode(hw, glort, xcast_mode);\n \n \t/* synchronize all of the addresses */\n \t__dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync);\n@@ -1096,9 +1138,12 @@ void fm10k_reset_rx_state(struct fm10k_intfc *interface)\n \n \tfm10k_mbx_lock(interface);\n \n-\t/* clear the logical port state on lower device */\n-\thw->mac.ops.update_lport_state(hw, interface->glort,\n-\t\t\t\t interface->glort_count, false);\n+\t/* clear the logical port state on lower device if host's mailbox is\n+\t * ready\n+\t */\n+\tif (fm10k_host_mbx_ready(interface))\n+\t\thw->mac.ops.update_lport_state(hw, interface->glort,\n+\t\t\t\t\t interface->glort_count, false);\n \n \tfm10k_mbx_unlock(interface);\n \n@@ -1317,8 +1362,13 @@ static void *fm10k_dfwd_add_station(struct net_device *dev,\n \tfm10k_mbx_lock(interface);\n \n \tglort = l2_accel->dglort + 1 + i;\n-\thw->mac.ops.update_xcast_mode(hw, glort, FM10K_XCAST_MODE_MULTI);\n-\thw->mac.ops.update_uc_addr(hw, glort, sdev->dev_addr, 0, true, 0);\n+\n+\tif (fm10k_host_mbx_ready(interface)) {\n+\t\thw->mac.ops.update_xcast_mode(hw, glort,\n+\t\t\t\t\t FM10K_XCAST_MODE_MULTI);\n+\t\thw->mac.ops.update_uc_addr(hw, glort, sdev->dev_addr,\n+\t\t\t\t\t 0, true, 0);\n+\t}\n \n \tfm10k_mbx_unlock(interface);\n \n@@ -1352,8 +1402,13 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)\n \tfm10k_mbx_lock(interface);\n \n \tglort = l2_accel->dglort + 1 + i;\n-\thw->mac.ops.update_xcast_mode(hw, glort, FM10K_XCAST_MODE_NONE);\n-\thw->mac.ops.update_uc_addr(hw, glort, sdev->dev_addr, 0, false, 0);\n+\n+\tif (fm10k_host_mbx_ready(interface)) {\n+\t\thw->mac.ops.update_xcast_mode(hw, glort,\n+\t\t\t\t\t FM10K_XCAST_MODE_NONE);\n+\t\thw->mac.ops.update_uc_addr(hw, glort, sdev->dev_addr,\n+\t\t\t\t\t 0, false, 0);\n+\t}\n \n \tfm10k_mbx_unlock(interface);\n \n", "prefixes": [] }