get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1159778,
    "url": "http://patchwork.ozlabs.org/api/patches/1159778/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190909142117.20186-1-bob.beckett@collabora.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": "<20190909142117.20186-1-bob.beckett@collabora.com>",
    "list_archive_url": null,
    "date": "2019-09-09T14:21:01",
    "name": "[v2] igb: add rx drop enable attribute",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "66c73532e7be6ed27d9135db497d9d0b2345f9b0",
    "submitter": {
        "id": 76934,
        "url": "http://patchwork.ozlabs.org/api/people/76934/?format=api",
        "name": "Robert Beckett",
        "email": "bob.beckett@collabora.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/20190909142117.20186-1-bob.beckett@collabora.com/mbox/",
    "series": [
        {
            "id": 129758,
            "url": "http://patchwork.ozlabs.org/api/series/129758/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=129758",
            "date": "2019-09-09T14:21:01",
            "name": "[v2] igb: add rx drop enable attribute",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/129758/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1159778/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1159778/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.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dmarc=fail (p=none dis=none)\n\theader.from=collabora.com"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 46RrQg0ky7z9s00\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Sep 2019 00:39:22 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A3EFC204E0;\n\tMon,  9 Sep 2019 14:39:20 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 717Z44hdQB4H; Mon,  9 Sep 2019 14:39:17 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 89B0F204A8;\n\tMon,  9 Sep 2019 14:39:17 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id CCF021BF3AD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Sep 2019 14:21:50 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C8EFD86FE7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Sep 2019 14:21:50 +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 Ow62IvFlsjs3 for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Sep 2019 14:21:49 +0000 (UTC)",
            "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 9251C861E6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Sep 2019 14:21:49 +0000 (UTC)",
            "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: bbeckett) with ESMTPSA id 2856728BB4D"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "From": "Robert Beckett <bob.beckett@collabora.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon,  9 Sep 2019 15:21:01 +0100",
        "Message-Id": "<20190909142117.20186-1-bob.beckett@collabora.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "X-Mailman-Approved-At": "Mon, 09 Sep 2019 14:39:15 +0000",
        "Subject": "[Intel-wired-lan] [PATCH v2] igb: add rx drop enable attribute",
        "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": "Robert Beckett <bob.beckett@collabora.com>, netdev@vger.kernel.org,\n\t\"David S. Miller\" <davem@davemloft.net>",
        "MIME-Version": "1.0",
        "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": "To allow userland to enable or disable dropping packets when descriptor\nring is exhausted, add RX_DROP_EN private flag.\n\nThis can be used in conjunction with flow control to mitigate packet storms\n(e.g. due to network loop or DoS) by forcing the network adapter to send\npause frames whenever the ring is close to exhaustion.\n\nBy default this will maintain previous behaviour of enabling dropping of\npackets during ring buffer exhaustion.\nSome use cases prefer to not drop packets upon exhaustion, but instead\nuse flow control to limit ingress rates and ensure no dropped packets.\nThis is useful when the host CPU cannot keep up with packet delivery,\nbut data delivery is more important than throughput via multiple queues.\n\nUserland can set this flag to 0 via ethtool to disable packet dropping.\n\nSigned-off-by: Robert Beckett <bob.beckett@collabora.com>\n---\n\nNotes:\n    Changes since v1: re-written to use ethtool priv flags instead of sysfs attribute\n\n drivers/net/ethernet/intel/igb/igb.h         |  1 +\n drivers/net/ethernet/intel/igb/igb_ethtool.c |  8 ++++++++\n drivers/net/ethernet/intel/igb/igb_main.c    | 11 +++++++++--\n 3 files changed, 18 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex ca54e268d157..ff4a61218e3e 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -617,6 +617,7 @@ struct igb_adapter {\n #define IGB_FLAG_VLAN_PROMISC\t\tBIT(15)\n #define IGB_FLAG_RX_LEGACY\t\tBIT(16)\n #define IGB_FLAG_FQTSS\t\t\tBIT(17)\n+#define IGB_FLAG_RX_DROP_EN\t\tBIT(18)\n \n /* Media Auto Sense */\n #define IGB_MAS_ENABLE_0\t\t0X0001\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex 3182b059bf55..b584fa1f0e14 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -128,6 +128,8 @@ static const char igb_gstrings_test[][ETH_GSTRING_LEN] = {\n static const char igb_priv_flags_strings[][ETH_GSTRING_LEN] = {\n #define IGB_PRIV_FLAGS_LEGACY_RX\tBIT(0)\n \t\"legacy-rx\",\n+#define IGB_PRIV_FLAGS_RX_DROP_EN\tBIT(1)\n+\t\"rx-drop-en\",\n };\n \n #define IGB_PRIV_FLAGS_STR_LEN ARRAY_SIZE(igb_priv_flags_strings)\n@@ -3444,6 +3446,8 @@ static u32 igb_get_priv_flags(struct net_device *netdev)\n \n \tif (adapter->flags & IGB_FLAG_RX_LEGACY)\n \t\tpriv_flags |= IGB_PRIV_FLAGS_LEGACY_RX;\n+\tif (adapter->flags & IGB_FLAG_RX_DROP_EN)\n+\t\tpriv_flags |= IGB_PRIV_FLAGS_RX_DROP_EN;\n \n \treturn priv_flags;\n }\n@@ -3457,6 +3461,10 @@ static int igb_set_priv_flags(struct net_device *netdev, u32 priv_flags)\n \tif (priv_flags & IGB_PRIV_FLAGS_LEGACY_RX)\n \t\tflags |= IGB_FLAG_RX_LEGACY;\n \n+\tflags &= ~IGB_FLAG_RX_DROP_EN;\n+\tif (priv_flags & IGB_PRIV_FLAGS_RX_DROP_EN)\n+\t\tflags |= IGB_FLAG_RX_DROP_EN;\n+\n \tif (flags != adapter->flags) {\n \t\tadapter->flags = flags;\n \ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 105b0624081a..51a8010dbe59 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -3236,6 +3236,9 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \n \tigb_validate_mdi_setting(hw);\n \n+\t/* By default, support dropping packets due to ring exhaustion */\n+\tadapter->flags |= IGB_FLAG_RX_DROP_EN;\n+\n \t/* By default, support wake on port A */\n \tif (hw->bus.func == 0)\n \t\tadapter->flags |= IGB_FLAG_WOL_SUPPORTED;\n@@ -4503,8 +4506,12 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,\n \tsrrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;\n \tif (hw->mac.type >= e1000_82580)\n \t\tsrrctl |= E1000_SRRCTL_TIMESTAMP;\n-\t/* Only set Drop Enable if we are supporting multiple queues */\n-\tif (adapter->vfs_allocated_count || adapter->num_rx_queues > 1)\n+\t/*\n+\t * Only set Drop Enable if we are supporting multiple queues and\n+\t * allowed by flags\n+\t */\n+\tif ((adapter->flags & IGB_FLAG_RX_DROP_EN) &&\n+\t\t(adapter->vfs_allocated_count || adapter->num_rx_queues > 1))\n \t\tsrrctl |= E1000_SRRCTL_DROP_EN;\n \n \twr32(E1000_SRRCTL(reg_idx), srrctl);\n",
    "prefixes": [
        "v2"
    ]
}