get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 490408,
    "url": "http://patchwork.ozlabs.org/api/patches/490408/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1435710352-956-1-git-send-email-suzuki_shota_t3@lab.ntt.co.jp/",
    "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": "<1435710352-956-1-git-send-email-suzuki_shota_t3@lab.ntt.co.jp>",
    "list_archive_url": null,
    "date": "2015-07-01T00:25:52",
    "name": "[net] igb: Fix oops caused by missing queue pairing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0523df45cf7cac16e71d74b9a85ec32c54104b73",
    "submitter": {
        "id": 66755,
        "url": "http://patchwork.ozlabs.org/api/people/66755/?format=api",
        "name": "Shota Suzuki",
        "email": "suzuki_shota_t3@lab.ntt.co.jp"
    },
    "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/1435710352-956-1-git-send-email-suzuki_shota_t3@lab.ntt.co.jp/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/490408/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/490408/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 8AA00140187\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Jul 2015 11:10:53 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 30E58338A9;\n\tThu,  2 Jul 2015 01:01: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 bMgBLVuNoHOW; Thu,  2 Jul 2015 01:01:15 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 044FB33882;\n\tThu,  2 Jul 2015 01:01:15 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 28FBF1C1098\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  1 Jul 2015 01:46:45 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 23E00882FC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  1 Jul 2015 01:46:45 +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 B4T9kkDMTLM3 for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  1 Jul 2015 01:46:40 +0000 (UTC)",
            "from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CCDEF882AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  1 Jul 2015 01:46:39 +0000 (UTC)",
            "from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153])\n\tby tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t610SJVS017313; \n\tWed, 1 Jul 2015 09:28:19 +0900",
            "from vc1.ecl.ntt.co.jp (localhost [127.0.0.1])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 66B0B5F611;\n\tWed,  1 Jul 2015 09:28:31 +0900 (JST)",
            "from imail2.m.ecl.ntt.co.jp (imail2.m.ecl.ntt.co.jp [129.60.5.247])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 572AA5F63F;\n\tWed,  1 Jul 2015 09:28:31 +0900 (JST)",
            "from localhost.localdomain (suzukisua.sic.ecl.ntt.co.jp\n\t[129.60.241.102])\n\tby imail2.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id\n\tt610SJuM028813; Wed, 1 Jul 2015 09:28:19 +0900"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "delayed 01:18:15 by SQLgrey-1.7.6",
        "From": "Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>",
        "To": "jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com,\n\tshannon.nelson@intel.com, carolyn.wyborny@intel.com,\n\tdonald.c.skidmore@intel.com, matthew.vick@intel.com,\n\tjohn.ronciak@intel.com, mitch.a.williams@intel.com,\n\tintel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org",
        "Date": "Wed,  1 Jul 2015 09:25:52 +0900",
        "Message-Id": "<1435710352-956-1-git-send-email-suzuki_shota_t3@lab.ntt.co.jp>",
        "X-Mailer": "git-send-email 1.7.9",
        "X-TM-AS-MML": "disable",
        "X-Mailman-Approved-At": "Thu, 02 Jul 2015 01:01:13 +0000",
        "Subject": "[Intel-wired-lan] [PATCH net] igb: Fix oops caused by missing queue\n\tpairing",
        "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": "When initializing igb driver (e.g. 82576, I350), IGB_FLAG_QUEUE_PAIRS is\nset if adapter->rss_queues exceeds half of max_rss_queues in\nigb_init_queue_configuration().\nOn the other hand, IGB_FLAG_QUEUE_PAIRS is not set even if the number of\nqueues exceeds half of max_combined in igb_set_channels() when changing\nthe number of queues by \"ethtool -L\".\nIn this case, if numvecs is larger than MAX_MSIX_ENTRIES (10), the size\nof adapter->msix_entries[], an overflow can occur in\nigb_set_interrupt_capability(), which in turn leads to an oops.\n\nFix this problem as follows:\n - When changing the number of queues by \"ethtool -L\", set\n   IGB_FLAG_QUEUE_PAIRS in the same way as initializing igb driver.\n - When increasing the size of q_vector, reallocate it appropriately.\n   (With IGB_FLAG_QUEUE_PAIRS set, the size of q_vector gets larger.)\n\nAnother possible way to fix this problem is to cap the queues at its\ninitial number, which is the number of the initial online cpus. But this\nis not the optimal way because we cannnot increase queues when another\ncpu becomes online.\n\nNote that before commit cd14ef54d25b (\"igb: Change to use statically\nallocated array for MSIx entries\"), this problem did not cause oops\nbut just made the number of queues become 1 because of entering msi_only\nmode in igb_set_interrupt_capability().\n\nFixes: 907b7835799f (\"igb: Add ethtool support to configure number of channels\")\nSigned-off-by: Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>\n---\nAlthough we might be able to additionally unset IGB_FLAG_QUEUE_PAIRS\nwhen it is not needed, this patch doesn't change existing behaviour\nbecause such a change is not a bug fix.\n\n drivers/net/ethernet/intel/igb/igb.h         |  1 +\n drivers/net/ethernet/intel/igb/igb_ethtool.c |  5 ++++-\n drivers/net/ethernet/intel/igb/igb_main.c    | 16 ++++++++++++++--\n 3 files changed, 19 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex c2bd4f9..212d668 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -540,6 +540,7 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,\n \t\t\t struct sk_buff *skb);\n int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);\n int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);\n+void igb_set_flag_queue_pairs(struct igb_adapter *, const u32);\n #ifdef CONFIG_IGB_HWMON\n void igb_sysfs_exit(struct igb_adapter *adapter);\n int igb_sysfs_init(struct igb_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex d5673eb..0afc091 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -2991,6 +2991,7 @@ static int igb_set_channels(struct net_device *netdev,\n {\n \tstruct igb_adapter *adapter = netdev_priv(netdev);\n \tunsigned int count = ch->combined_count;\n+\tunsigned int max_combined = 0;\n \n \t/* Verify they are not requesting separate vectors */\n \tif (!count || ch->rx_count || ch->tx_count)\n@@ -3001,11 +3002,13 @@ static int igb_set_channels(struct net_device *netdev,\n \t\treturn -EINVAL;\n \n \t/* Verify the number of channels doesn't exceed hw limits */\n-\tif (count > igb_max_channels(adapter))\n+\tmax_combined = igb_max_channels(adapter);\n+\tif (count > max_combined)\n \t\treturn -EINVAL;\n \n \tif (count != adapter->rss_queues) {\n \t\tadapter->rss_queues = count;\n+\t\tigb_set_flag_queue_pairs(adapter, max_combined);\n \n \t\t/* Hardware has to reinitialize queues and interrupts to\n \t\t * match the new configuration.\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex f287186..59dc2b4 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -1205,10 +1205,14 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter,\n \n \t/* allocate q_vector and rings */\n \tq_vector = adapter->q_vector[v_idx];\n-\tif (!q_vector)\n+\tif (!q_vector) {\n \t\tq_vector = kzalloc(size, GFP_KERNEL);\n-\telse\n+\t} else if (size > ksize(q_vector)) {\n+\t\tkfree_rcu(q_vector, rcu);\n+\t\tq_vector = kzalloc(size, GFP_KERNEL);\n+\t} else {\n \t\tmemset(q_vector, 0, size);\n+\t}\n \tif (!q_vector)\n \t\treturn -ENOMEM;\n \n@@ -2888,6 +2892,14 @@ static void igb_init_queue_configuration(struct igb_adapter *adapter)\n \n \tadapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus());\n \n+\tigb_set_flag_queue_pairs(adapter, max_rss_queues);\n+}\n+\n+void igb_set_flag_queue_pairs(struct igb_adapter *adapter,\n+\t\t\t      const u32 max_rss_queues)\n+{\n+\tstruct e1000_hw *hw = &adapter->hw;\n+\n \t/* Determine if we need to pair queues. */\n \tswitch (hw->mac.type) {\n \tcase e1000_82575:\n",
    "prefixes": [
        "net"
    ]
}