get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1131964,
    "url": "http://patchwork.ozlabs.org/api/patches/1131964/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190715123518.3510791-1-arnd@arndb.de/",
    "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": "<20190715123518.3510791-1-arnd@arndb.de>",
    "list_archive_url": null,
    "date": "2019-07-15T12:35:07",
    "name": "i40e: reduce stack usage in i40e_set_fc",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "deb1744b418474081e8b79130be0c70330b10bbe",
    "submitter": {
        "id": 30,
        "url": "http://patchwork.ozlabs.org/api/people/30/?format=api",
        "name": "Arnd Bergmann",
        "email": "arnd@arndb.de"
    },
    "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/20190715123518.3510791-1-arnd@arndb.de/mbox/",
    "series": [
        {
            "id": 119507,
            "url": "http://patchwork.ozlabs.org/api/series/119507/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=119507",
            "date": "2019-07-15T12:35:07",
            "name": "i40e: reduce stack usage in i40e_set_fc",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/119507/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1131964/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1131964/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45nNKx65cWz9sNH\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 15 Jul 2019 22:35:49 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C9779866A3;\n\tMon, 15 Jul 2019 12:35:47 +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 LTr0U2fQufmM; Mon, 15 Jul 2019 12:35:46 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 52B018682A;\n\tMon, 15 Jul 2019 12:35:46 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C51A11BF3DF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jul 2019 12:35:44 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BFD928682A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jul 2019 12:35:44 +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 hgUPoeqdBMTB for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jul 2019 12:35:43 +0000 (UTC)",
            "from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 50732866A3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jul 2019 12:35:43 +0000 (UTC)",
            "from threadripper.lan ([149.172.19.189]) by\n\tmrelayeu.kundenserver.de\n\t(mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id\n\t1Mw8gc-1iclyK33WG-00s2DM; Mon, 15 Jul 2019 14:35:24 +0200"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "From": "Arnd Bergmann <arnd@arndb.de>",
        "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>,\n\t\"David S. Miller\" <davem@davemloft.net>",
        "Date": "Mon, 15 Jul 2019 14:35:07 +0200",
        "Message-Id": "<20190715123518.3510791-1-arnd@arndb.de>",
        "X-Mailer": "git-send-email 2.20.0",
        "MIME-Version": "1.0",
        "X-Provags-ID": "V03:K1:51h6XA6Bl7Ot/Uvt6DUGZkDIrFXg806s4a58fRPDph6XbOA1o/L\n\tWbrLnPSeHtrhEkUKGOVrm5zUllrmDXlbf9sY1i7UrNwWXggoPcaEA5UD4UGKnUoTTFo4dpm\n\t0TRgYhqp7cK6Ie2JTDQgnYJaHFmkPGATyMsIU6zlwwf+XYBlKpTln4rDUhPPfmMznJ5h5ld\n\tc4g9OyyEza1nG+nfJfpDg==",
        "X-UI-Out-Filterresults": "notjunk:1; V03:K0:w3445uxjZ9Q=:IVjWnMlU8v6q1ppXkoEDOr\n\tTcwYXO5MhadeyYS0gcqKDbQzsIE7gvrpPKyLCD/n7BdFt1BF/1gJJeX55JuLAZFzqLCx14P4S\n\tKyME68RN9pQFkXfD20FJ8UdFfcd4BHXwAXpoqEsBuZlVOzCFLmy+Vp842jwKVKFYvjBrOg/Xa\n\tsMlCPyZBlMEgVVO6egSgygkv1fwdKXOJARUAT8Ry1ejRBzPQbvpjuev73yHSzESmEjlYT9mwU\n\tqCmmawfcrTGFGKUuCrDxDe37+9KJmClLRO1TOeh8L5wsUkmid/ot2n3hArbTuyk914HUJvwbf\n\t+ealJyZMF57ToycZtuxBwt+KlDoEFM/i9M2yXInOiBbx5qHnUeuu9A7V9kb3SfiO2ogD83C0y\n\tvo+GXtQxGzVXRRRxF0+89+goT5Vl2oaMVygnBZAhr4JH5q2N40Fxn9XBNymFt3lwdP0vHVVXn\n\tDndWovInEB2xr7t9Pt1qu4pu/pNli0KVkzRQWIJUjuxYIuMNdTU9Su1kkmpast8RPUbQOh+75\n\tsXpvevqf7VFXOQX9z2cE1sJVoS8i3RMCAxTGV2Z27eoI9bVIarF8KciTm+ugaZWHCaot8JjAI\n\tGdwo6uf0ZUOe6tLfIK1dQ74gjtNywzvLW2Py1tmx6TrgazEA3ZxxfPGClKihSv9qgbgODVY8J\n\twfg+piibOONRRTt1OqC4aVuj/lGoUZYBWPucGB+kB06SgwL+HQDShpWn6p6BsiRxisRHw8He+\n\tUH2n4lg37ZTxT7uNUIe7hFtppe2/G7B+q8lCjw==",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: reduce stack usage in i40e_set_fc",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Catherine Sullivan <catherine.sullivan@intel.com>, Doug Dziggel\n\t<douglas.a.dziggel@intel.com>, Arnd Bergmann <arnd@arndb.de>, \n\tnetdev@vger.kernel.org, =?utf-8?q?Patryk_Ma=C5=82ek?=\n\t<patryk.malek@intel.com>, linux-kernel@vger.kernel.org,\n\tPiotr Azarewicz <piotr.azarewicz@intel.com>, Aleksandr Loktionov\n\t<aleksandr.loktionov@intel.com>, clang-built-linux@googlegroups.com,\n\tintel-wired-lan@lists.osuosl.org, Piotr Marczak <piotr.marczak@intel.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "The functions i40e_aq_get_phy_abilities_resp() and i40e_set_fc() both\nhave giant structure on the stack, which makes each one use stack frames\nlarger than 500 bytes.\n\nAs clang decides one function into the other, we get a warning for\nexceeding the frame size limit on 32-bit architectures:\n\ndrivers/net/ethernet/intel/i40e/i40e_common.c:1654:23: error: stack frame size of 1116 bytes in function 'i40e_set_fc' [-Werror,-Wframe-larger-than=]\n\nWhen building with gcc, the inlining does not happen, but i40e_set_fc()\ncalls i40e_aq_get_phy_abilities_resp() anyway, so they add up on the\nkernel stack just as much.\n\nThe parts that actually use large stacks don't overlap, so make sure\neach one is a separate function, and mark them as noinline_for_stack to\nprevent the compilers from combining them again.\n\nFixes: 0a862b43acc6 (\"i40e/i40evf: Add module_types and update_link_info\")\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n drivers/net/ethernet/intel/i40e/i40e_common.c | 91 +++++++++++--------\n 1 file changed, 51 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 906cf68d3453..7af1b7477140 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -1643,25 +1643,15 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,\n \treturn status;\n }\n \n-/**\n- * i40e_set_fc\n- * @hw: pointer to the hw struct\n- * @aq_failures: buffer to return AdminQ failure information\n- * @atomic_restart: whether to enable atomic link restart\n- *\n- * Set the requested flow control mode using set_phy_config.\n- **/\n-enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,\n-\t\t\t\t  bool atomic_restart)\n+static noinline_for_stack enum i40e_status_code\n+i40e_set_fc_status(struct i40e_hw *hw,\n+\t\t   struct i40e_aq_get_phy_abilities_resp *abilities,\n+\t\t   bool atomic_restart)\n {\n-\tenum i40e_fc_mode fc_mode = hw->fc.requested_mode;\n-\tstruct i40e_aq_get_phy_abilities_resp abilities;\n \tstruct i40e_aq_set_phy_config config;\n-\tenum i40e_status_code status;\n+\tenum i40e_fc_mode fc_mode = hw->fc.requested_mode;\n \tu8 pause_mask = 0x0;\n \n-\t*aq_failures = 0x0;\n-\n \tswitch (fc_mode) {\n \tcase I40E_FC_FULL:\n \t\tpause_mask |= I40E_AQ_PHY_FLAG_PAUSE_TX;\n@@ -1677,6 +1667,48 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,\n \t\tbreak;\n \t}\n \n+\tmemset(&config, 0, sizeof(struct i40e_aq_set_phy_config));\n+\t/* clear the old pause settings */\n+\tconfig.abilities = abilities->abilities & ~(I40E_AQ_PHY_FLAG_PAUSE_TX) &\n+\t\t\t   ~(I40E_AQ_PHY_FLAG_PAUSE_RX);\n+\t/* set the new abilities */\n+\tconfig.abilities |= pause_mask;\n+\t/* If the abilities have changed, then set the new config */\n+\tif (config.abilities == abilities->abilities)\n+\t\treturn 0;\n+\n+\t/* Auto restart link so settings take effect */\n+\tif (atomic_restart)\n+\t\tconfig.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;\n+\t/* Copy over all the old settings */\n+\tconfig.phy_type = abilities->phy_type;\n+\tconfig.phy_type_ext = abilities->phy_type_ext;\n+\tconfig.link_speed = abilities->link_speed;\n+\tconfig.eee_capability = abilities->eee_capability;\n+\tconfig.eeer = abilities->eeer_val;\n+\tconfig.low_power_ctrl = abilities->d3_lpan;\n+\tconfig.fec_config = abilities->fec_cfg_curr_mod_ext_info &\n+\t\t\t    I40E_AQ_PHY_FEC_CONFIG_MASK;\n+\n+\treturn i40e_aq_set_phy_config(hw, &config, NULL);\n+}\n+\n+/**\n+ * i40e_set_fc\n+ * @hw: pointer to the hw struct\n+ * @aq_failures: buffer to return AdminQ failure information\n+ * @atomic_restart: whether to enable atomic link restart\n+ *\n+ * Set the requested flow control mode using set_phy_config.\n+ **/\n+enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,\n+\t\t\t\t  bool atomic_restart)\n+{\n+\tstruct i40e_aq_get_phy_abilities_resp abilities;\n+\tenum i40e_status_code status;\n+\n+\t*aq_failures = 0x0;\n+\n \t/* Get the current phy config */\n \tstatus = i40e_aq_get_phy_capabilities(hw, false, false, &abilities,\n \t\t\t\t\t      NULL);\n@@ -1685,31 +1717,10 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,\n \t\treturn status;\n \t}\n \n-\tmemset(&config, 0, sizeof(struct i40e_aq_set_phy_config));\n-\t/* clear the old pause settings */\n-\tconfig.abilities = abilities.abilities & ~(I40E_AQ_PHY_FLAG_PAUSE_TX) &\n-\t\t\t   ~(I40E_AQ_PHY_FLAG_PAUSE_RX);\n-\t/* set the new abilities */\n-\tconfig.abilities |= pause_mask;\n-\t/* If the abilities have changed, then set the new config */\n-\tif (config.abilities != abilities.abilities) {\n-\t\t/* Auto restart link so settings take effect */\n-\t\tif (atomic_restart)\n-\t\t\tconfig.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;\n-\t\t/* Copy over all the old settings */\n-\t\tconfig.phy_type = abilities.phy_type;\n-\t\tconfig.phy_type_ext = abilities.phy_type_ext;\n-\t\tconfig.link_speed = abilities.link_speed;\n-\t\tconfig.eee_capability = abilities.eee_capability;\n-\t\tconfig.eeer = abilities.eeer_val;\n-\t\tconfig.low_power_ctrl = abilities.d3_lpan;\n-\t\tconfig.fec_config = abilities.fec_cfg_curr_mod_ext_info &\n-\t\t\t\t    I40E_AQ_PHY_FEC_CONFIG_MASK;\n-\t\tstatus = i40e_aq_set_phy_config(hw, &config, NULL);\n+\tstatus = i40e_set_fc_status(hw, &abilities, atomic_restart);\n+\tif (status)\n+\t\t*aq_failures |= I40E_SET_FC_AQ_FAIL_SET;\n \n-\t\tif (status)\n-\t\t\t*aq_failures |= I40E_SET_FC_AQ_FAIL_SET;\n-\t}\n \t/* Update the link info */\n \tstatus = i40e_update_link_info(hw);\n \tif (status) {\n@@ -2537,7 +2548,7 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)\n  * i40e_updatelink_status - update status of the HW network link\n  * @hw: pointer to the hw struct\n  **/\n-i40e_status i40e_update_link_info(struct i40e_hw *hw)\n+noinline_for_stack i40e_status i40e_update_link_info(struct i40e_hw *hw)\n {\n \tstruct i40e_aq_get_phy_abilities_resp abilities;\n \ti40e_status status = 0;\n",
    "prefixes": []
}