get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816471,
    "url": "http://patchwork.ozlabs.org/api/patches/816471/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505939573-17335-1-git-send-email-timur@codeaurora.org/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505939573-17335-1-git-send-email-timur@codeaurora.org>",
    "list_archive_url": null,
    "date": "2017-09-20T20:32:53",
    "name": "[RESEND,for,4.14] net: qcom/emac: add software control for pause frame mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d9f2a8906d61e3547a40971e39a4410b67451587",
    "submitter": {
        "id": 66858,
        "url": "http://patchwork.ozlabs.org/api/people/66858/?format=api",
        "name": "Timur Tabi",
        "email": "timur@codeaurora.org"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1505939573-17335-1-git-send-email-timur@codeaurora.org/mbox/",
    "series": [
        {
            "id": 4227,
            "url": "http://patchwork.ozlabs.org/api/series/4227/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4227",
            "date": "2017-09-20T20:32:53",
            "name": "[RESEND,for,4.14] net: qcom/emac: add software control for pause frame mode",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4227/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816471/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816471/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=codeaurora.org header.i=@codeaurora.org\n\theader.b=\"LStxJvz0\"; \n\tdkim=pass (1024-bit key) header.d=codeaurora.org\n\theader.i=@codeaurora.org header.b=\"LStxJvz0\"; \n\tdkim-atps=neutral",
            "pdx-caf-mail.web.codeaurora.org;\n\tdmarc=none (p=none dis=none)\n\theader.from=codeaurora.org",
            "pdx-caf-mail.web.codeaurora.org;\n\tspf=none smtp.mailfrom=timur@codeaurora.org"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyBJZ6fSfz9s7v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 06:33:02 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751547AbdITUdA (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 16:33:00 -0400",
            "from smtp.codeaurora.org ([198.145.29.96]:57332 \"EHLO\n\tsmtp.codeaurora.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751367AbdITUc7 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 16:32:59 -0400",
            "by smtp.codeaurora.org (Postfix, from userid 1000)\n\tid EA4FA60727; Wed, 20 Sep 2017 20:32:58 +0000 (UTC)",
            "from timur-ubuntu.qualcomm.com (i-global254.qualcomm.com\n\t[199.106.103.254])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\t(Authenticated sender: timur@smtp.codeaurora.org)\n\tby smtp.codeaurora.org (Postfix) with ESMTPSA id BC31960618;\n\tWed, 20 Sep 2017 20:32:57 +0000 (UTC)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org;\n\ts=default; t=1505939578;\n\tbh=p6jhZh2hkhkPm9GSvdSIZ+D/M8sLvLc1ROqxvS2puxk=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=LStxJvz0zYiRebeldEOs7HFhE+ceQLpJ4MONnnCowRiSVqwITvwyY/LcQFjpJbbQ6\n\tB2GrSL/+5D/Um3IJM3+A98Sq/zu9GYFUCx1MbDxRmYUDkNtN2G6S5GYgR21UeIcx9G\n\tCizI91wETJNLM2zLVBFpt/SgZhvz8I62UJ1oGOxg=",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org;\n\ts=default; t=1505939578;\n\tbh=p6jhZh2hkhkPm9GSvdSIZ+D/M8sLvLc1ROqxvS2puxk=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=LStxJvz0zYiRebeldEOs7HFhE+ceQLpJ4MONnnCowRiSVqwITvwyY/LcQFjpJbbQ6\n\tB2GrSL/+5D/Um3IJM3+A98Sq/zu9GYFUCx1MbDxRmYUDkNtN2G6S5GYgR21UeIcx9G\n\tCizI91wETJNLM2zLVBFpt/SgZhvz8I62UJ1oGOxg="
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on\n\tpdx-caf-mail.web.codeaurora.org",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00,\n\tDKIM_SIGNED,\n\tT_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0",
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 smtp.codeaurora.org BC31960618",
        "From": "Timur Tabi <timur@codeaurora.org>",
        "To": "\"David S. Miller\" <davem@davemloft.net>, netdev@vger.kernel.org",
        "Cc": "timur@codeaurora.org",
        "Subject": "[PATCH] [RESEND][for 4.14] net: qcom/emac: add software control for\n\tpause frame mode",
        "Date": "Wed, 20 Sep 2017 15:32:53 -0500",
        "Message-Id": "<1505939573-17335-1-git-send-email-timur@codeaurora.org>",
        "X-Mailer": "git-send-email 1.9.1",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "The EMAC has the option of sending only a single pause frame when\nflow control is enabled and the RX queue is full.  Although sending\nonly one pause frame has little value, this would allow admins to\nenable automatic flow control without having to worry about the EMAC\nflooding nearby switches with pause frames if the kernel hangs.\n\nThe option is enabled by using the single-pause-mode private flag.\n\nSigned-off-by: Timur Tabi <timur@codeaurora.org>\n---\n drivers/net/ethernet/qualcomm/emac/emac-ethtool.c | 30 +++++++++++++++++++++++\n drivers/net/ethernet/qualcomm/emac/emac-mac.c     | 22 +++++++++++++++++\n drivers/net/ethernet/qualcomm/emac/emac.c         |  3 +++\n drivers/net/ethernet/qualcomm/emac/emac.h         |  3 +++\n 4 files changed, 58 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c\nindex bbe24639aa5a..c8c6231b87f3 100644\n--- a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c\n+++ b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c\n@@ -88,6 +88,8 @@ static void emac_set_msglevel(struct net_device *netdev, u32 data)\n static int emac_get_sset_count(struct net_device *netdev, int sset)\n {\n \tswitch (sset) {\n+\tcase ETH_SS_PRIV_FLAGS:\n+\t\treturn 1;\n \tcase ETH_SS_STATS:\n \t\treturn EMAC_STATS_LEN;\n \tdefault:\n@@ -100,6 +102,10 @@ static void emac_get_strings(struct net_device *netdev, u32 stringset, u8 *data)\n \tunsigned int i;\n \n \tswitch (stringset) {\n+\tcase ETH_SS_PRIV_FLAGS:\n+\t\tstrcpy(data, \"single-pause-mode\");\n+\t\tbreak;\n+\n \tcase ETH_SS_STATS:\n \t\tfor (i = 0; i < EMAC_STATS_LEN; i++) {\n \t\t\tstrlcpy(data, emac_ethtool_stat_strings[i],\n@@ -230,6 +236,27 @@ static int emac_get_regs_len(struct net_device *netdev)\n \treturn EMAC_MAX_REG_SIZE * sizeof(u32);\n }\n \n+#define EMAC_PRIV_ENABLE_SINGLE_PAUSE\tBIT(0)\n+\n+static int emac_set_priv_flags(struct net_device *netdev, u32 flags)\n+{\n+\tstruct emac_adapter *adpt = netdev_priv(netdev);\n+\n+\tadpt->single_pause_mode = !!(flags & EMAC_PRIV_ENABLE_SINGLE_PAUSE);\n+\n+\tif (netif_running(netdev))\n+\t\treturn emac_reinit_locked(adpt);\n+\n+\treturn 0;\n+}\n+\n+static u32 emac_get_priv_flags(struct net_device *netdev)\n+{\n+\tstruct emac_adapter *adpt = netdev_priv(netdev);\n+\n+\treturn adpt->single_pause_mode ? EMAC_PRIV_ENABLE_SINGLE_PAUSE : 0;\n+}\n+\n static const struct ethtool_ops emac_ethtool_ops = {\n \t.get_link_ksettings = phy_ethtool_get_link_ksettings,\n \t.set_link_ksettings = phy_ethtool_set_link_ksettings,\n@@ -253,6 +280,9 @@ static int emac_get_regs_len(struct net_device *netdev)\n \n \t.get_regs_len    = emac_get_regs_len,\n \t.get_regs        = emac_get_regs,\n+\n+\t.set_priv_flags = emac_set_priv_flags,\n+\t.get_priv_flags = emac_get_priv_flags,\n };\n \n void emac_set_ethtool_ops(struct net_device *netdev)\ndiff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c\nindex bcd4708b3745..0ea3ca09c689 100644\n--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c\n+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c\n@@ -551,6 +551,28 @@ static void emac_mac_start(struct emac_adapter *adpt)\n \tmac &= ~(HUGEN | VLAN_STRIP | TPAUSE | SIMR | HUGE | MULTI_ALL |\n \t\t DEBUG_MODE | SINGLE_PAUSE_MODE);\n \n+\t/* Enable single-pause-frame mode if requested.\n+\t *\n+\t * If enabled, the EMAC will send a single pause frame when the RX\n+\t * queue is full.  This normally leads to packet loss because\n+\t * the pause frame disables the remote MAC only for 33ms (the quanta),\n+\t * and then the remote MAC continues sending packets even though\n+\t * the RX queue is still full.\n+\t *\n+\t * If disabled, the EMAC sends a pause frame every 31ms until the RX\n+\t * queue is no longer full.  Normally, this is the preferred\n+\t * method of operation.  However, when the system is hung (e.g.\n+\t * cores are halted), the EMAC interrupt handler is never called\n+\t * and so the RX queue fills up quickly and stays full.  The resuling\n+\t * non-stop \"flood\" of pause frames sometimes has the effect of\n+\t * disabling nearby switches.  In some cases, other nearby switches\n+\t * are also affected, shutting down the entire network.\n+\t *\n+\t * The user can enable or disable single-pause-frame mode\n+\t * via ethtool.\n+\t */\n+\tmac |= adpt->single_pause_mode ? SINGLE_PAUSE_MODE : 0;\n+\n \twritel_relaxed(csr1, adpt->csr + EMAC_EMAC_WRAPPER_CSR1);\n \n \twritel_relaxed(mac, adpt->base + EMAC_MAC_CTRL);\ndiff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c\nindex 60850bfa3d32..759543512117 100644\n--- a/drivers/net/ethernet/qualcomm/emac/emac.c\n+++ b/drivers/net/ethernet/qualcomm/emac/emac.c\n@@ -443,6 +443,9 @@ static void emac_init_adapter(struct emac_adapter *adpt)\n \n \t/* default to automatic flow control */\n \tadpt->automatic = true;\n+\n+\t/* Disable single-pause-frame mode by default */\n+\tadpt->single_pause_mode = false;\n }\n \n /* Get the clock */\ndiff --git a/drivers/net/ethernet/qualcomm/emac/emac.h b/drivers/net/ethernet/qualcomm/emac/emac.h\nindex 8ee4ec6aef2e..d7c9f44209d4 100644\n--- a/drivers/net/ethernet/qualcomm/emac/emac.h\n+++ b/drivers/net/ethernet/qualcomm/emac/emac.h\n@@ -363,6 +363,9 @@ struct emac_adapter {\n \tbool\t\t\t\ttx_flow_control;\n \tbool\t\t\t\trx_flow_control;\n \n+\t/* True == use single-pause-frame mode. */\n+\tbool\t\t\t\tsingle_pause_mode;\n+\n \t/* Ring parameter */\n \tu8\t\t\t\ttpd_burst;\n \tu8\t\t\t\trfd_burst;\n",
    "prefixes": [
        "RESEND",
        "for",
        "4.14"
    ]
}