get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 574127,
    "url": "http://patchwork.ozlabs.org/api/patches/574127/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1453919610-8197-1-git-send-email-atomnuker@gmail.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": "<1453919610-8197-1-git-send-email-atomnuker@gmail.com>",
    "list_archive_url": null,
    "date": "2016-01-27T18:33:30",
    "name": "ixgbe: add a callback to set the maximum transmit bitrate",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "844b6d6cff50e07b872d5d98a313be3ac7c6a4ba",
    "submitter": {
        "id": 68195,
        "url": "http://patchwork.ozlabs.org/api/people/68195/?format=api",
        "name": "Rostislav Pehlivanov",
        "email": "atomnuker@gmail.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/1453919610-8197-1-git-send-email-atomnuker@gmail.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/574127/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/574127/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 B04B3140B0E\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Jan 2016 05:42:46 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E13CF8A063;\n\tWed, 27 Jan 2016 18:42:45 +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 4Pl19Vn2pXbu; Wed, 27 Jan 2016 18:42:45 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 606E98A015;\n\tWed, 27 Jan 2016 18:42:45 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 7BBF41BF848\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 18:33:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 77B1A8AB02\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 18:33:41 +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 YV4ma633Xg3q for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 18:33:39 +0000 (UTC)",
            "from mail-wm0-f49.google.com (mail-wm0-f49.google.com\n\t[74.125.82.49])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 295438926D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 18:33:39 +0000 (UTC)",
            "by mail-wm0-f49.google.com with SMTP id n5so42052908wmn.1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 10:33:39 -0800 (PST)",
            "from localhost.localdomain ([217.138.67.130])\n\tby smtp.gmail.com with ESMTPSA id\n\td9sm1539852wjf.43.2016.01.27.10.33.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 27 Jan 2016 10:33:36 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com header.b=HLFLFZF2;\n\tdkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id;\n\tbh=Gmtx/jescMoCpO6hO/pdwikVGtBFQgENGEP1vzV1C/s=;\n\tb=HLFLFZF2ZSd6i0IS6VgIwY/+WUO+FRYNjOYMnGeVupPIdqemd1V1a4pGSGpp+L48WM\n\tzMUC77O6dqhdhMf7yZQ9fEEKkdj6ER111PkyyUnQn4fW8RBPdYI5ef4V2EHh1EBAD9iq\n\tDRhxZKCZ+KUgS+s+q+u5nLuuFpXjIVh0iSmAaTGOXDwS3GQ78w83yHDcjsqR73boO5Cy\n\t7SPyemYeCsXq+BmnrT+snOAy9WE6F6tpgSyE+LeKIXwTlzhMSGhQ59DHe4yuP1Rj5ILc\n\tyCb0eCykOO9AdgwAPYVcPiYv7B2Kx5dRPEvNNsPQF6lOoJXGJgiywRkDlE3xmWucu4kY\n\tsqvA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=Gmtx/jescMoCpO6hO/pdwikVGtBFQgENGEP1vzV1C/s=;\n\tb=KPGXbvg0s5hNGQHYcWWgSVEKHNi/3xshsRhI19eSo+L9vKgtCvpP9e6hAoQlCAMDja\n\thYffi0Bi7TFdW7UnNMi1Nst4g3YRedOxvqCjvXjB1oHG9IQBwLUPBc/+XZYZ8YDtozKy\n\tUqhtYu2lYlZcGyaegyRoo5TC8lgm7p7pv3buhTq1R/ih4pRlQg3YFl9ndoTDF8U0L19j\n\tq5dORzDtWmgVLOyJlaN9l815tpOI06/uBFLddWhVlfcHmvSiuGVDWcFbL5QhKfIs1DcS\n\tsrzzRjJkSvXPD/Moioj7pH6aO7HZ3s/gaRr/dERUQMI+fsaEmkVndmbEWOrt+1vR+rdY\n\tuvtg==",
        "X-Gm-Message-State": "AG10YOSrR/HDMIVcoMHGUcaQZ6RDtosV9ipJKtP++hKeAQrOh+l2OHEVWZX6a/r8l1mp4A==",
        "X-Received": "by 10.28.211.141 with SMTP id k135mr30130054wmg.51.1453919617666;\n\tWed, 27 Jan 2016 10:33:37 -0800 (PST)",
        "From": "Rostislav Pehlivanov <atomnuker@gmail.com>",
        "To": "intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, jeffrey.t.kirsher@intel.com,\n\tjesse.brandeburg@intel.com, shannon.nelson@intel.com",
        "Date": "Wed, 27 Jan 2016 18:33:30 +0000",
        "Message-Id": "<1453919610-8197-1-git-send-email-atomnuker@gmail.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "X-Mailman-Approved-At": "Wed, 27 Jan 2016 18:42:45 +0000",
        "Cc": "Rostislav Pehlivanov <atomnuker@gmail.com>",
        "Subject": "[Intel-wired-lan] [PATCH] ixgbe: add a callback to set the maximum\n\ttransmit bitrate",
        "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": "This commit adds a callback which allows to adjust the maximum transmit\nbitrate the card can output. This makes it possible to get a smooth\ntraffic instead of the default burst-y behaviour when trying to output\ne.g. a video stream.\n\nMuch of the logic needed to get a correct bcnrc_val was taken from the\nixgbe_set_vf_rate_limit() function.\n\nSigned-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  | 31 ++++++++++++++++++++++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |  2 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h |  1 +\n 3 files changed, 33 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex c4003a8..d05455c 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1084,6 +1084,36 @@ static void ixgbe_tx_timeout_reset(struct ixgbe_adapter *adapter)\n }\n \n /**\n+ * ixgbe_tx_maxrate - callback to set the maximum per-queue bitrate\n+ **/\n+static int ixgbe_tx_maxrate(struct net_device *netdev,\n+\t\t\t    int queue_index, u32 maxrate)\n+{\n+\tstruct ixgbe_adapter *adapter = netdev_priv(netdev);\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\tu32 bcnrc_val = ixgbe_link_mbps(adapter);\n+\n+\tif (!maxrate)\n+\t\treturn 0;\n+\n+\t/* Calculate the rate factor values to set */\n+\tbcnrc_val <<= IXGBE_RTTBCNRC_RF_INT_SHIFT;\n+\tbcnrc_val /= maxrate;\n+\n+\t/* clear everything but the rate factor */\n+\tbcnrc_val &= IXGBE_RTTBCNRC_RF_INT_MASK |\n+\tIXGBE_RTTBCNRC_RF_DEC_MASK;\n+\n+\t/* enable the rate scheduler */\n+\tbcnrc_val |= IXGBE_RTTBCNRC_RS_ENA;\n+\n+\tIXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, queue_index);\n+\tIXGBE_WRITE_REG(hw, IXGBE_RTTBCNRC, bcnrc_val);\n+\n+\treturn 0;\n+}\n+\n+/**\n  * ixgbe_clean_tx_irq - Reclaim resources after transmit completes\n  * @q_vector: structure containing interrupt and ring information\n  * @tx_ring: tx ring to clean\n@@ -8646,6 +8676,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {\n \t.ndo_set_mac_address\t= ixgbe_set_mac,\n \t.ndo_change_mtu\t\t= ixgbe_change_mtu,\n \t.ndo_tx_timeout\t\t= ixgbe_tx_timeout,\n+\t.ndo_set_tx_maxrate\t= ixgbe_tx_maxrate,\n \t.ndo_vlan_rx_add_vid\t= ixgbe_vlan_rx_add_vid,\n \t.ndo_vlan_rx_kill_vid\t= ixgbe_vlan_rx_kill_vid,\n \t.ndo_do_ioctl\t\t= ixgbe_ioctl,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex 8025a3f..f9ca7d5 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -1395,7 +1395,7 @@ out:\n \treturn err;\n }\n \n-static int ixgbe_link_mbps(struct ixgbe_adapter *adapter)\n+int ixgbe_link_mbps(struct ixgbe_adapter *adapter)\n {\n \tswitch (adapter->link_speed) {\n \tcase IXGBE_LINK_SPEED_100_FULL:\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\nindex dad9257..47e65e2 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\n@@ -44,6 +44,7 @@ void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);\n int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);\n int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,\n \t\t\t   u8 qos);\n+int ixgbe_link_mbps(struct ixgbe_adapter *adapter);\n int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate,\n \t\t\tint max_tx_rate);\n int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);\n",
    "prefixes": []
}