get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 719280,
    "url": "http://patchwork.ozlabs.org/api/patches/719280/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1485282241-3579-4-git-send-email-bimmy.pujari@intel.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": "<1485282241-3579-4-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-24T18:24:01",
    "name": "[next,S58-V3,4/4] i40e: don't add more vectors to num_lan_msix than number of CPUs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cb0551c008c15cec72c792a5ee3ad40acd88767a",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@intel.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/1485282241-3579-4-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/719280/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/719280/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\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3v7FTP3qxMz9srY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Jan 2017 04:26:17 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id F1EE08431D;\n\tTue, 24 Jan 2017 17:26:15 +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 1gzo69vDG5B5; Tue, 24 Jan 2017 17:26:13 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5F319842F6;\n\tTue, 24 Jan 2017 17:26:13 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 079C91C0493\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:26:12 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id EBA0730A02\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:26:11 +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 4PdWWb4q2I+W for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:25:59 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 2FAF530A4F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:25:59 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga102.fm.intel.com with ESMTP; 24 Jan 2017 09:25:58 -0800",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby fmsmga004.fm.intel.com with ESMTP; 24 Jan 2017 09:25:58 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.33,278,1477983600\"; d=\"scan'208\";a=\"217089099\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 24 Jan 2017 10:24:01 -0800",
        "Message-Id": "<1485282241-3579-4-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1485282241-3579-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1485282241-3579-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S58-V3 4/4] i40e: don't add more\n\tvectors to num_lan_msix than number of CPUs",
        "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": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nThis is a solution to avoid adding too many queues to num_lan_msix.\nA recent refactor of queue pairs accidentally added all remaining\nvectors to the num_lan_msix which can have adverse performance issues,\ndue to enabling more queues than the number of CPU cores.\n\nThis patch removes the old calculation, and replaces it with a simple\nalgorithm.\n\n1) add queue pairs up to num_online_cpus(), but capped at half of total\n   vectors\n2) then add alternative features such as flow directory and similar\n3) finally, add the remaining vectors back to queue pairs, but capped\n   such that the total number of queue pairs does not exceed\n   num_online_cpus().\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nSigned-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>\nSigned-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>\nChange-ID: I668abf67d5011a1248866daba8885f4ff00cb8d9\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 30 ++++++++++++++++++++++++++---\n 1 file changed, 27 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex ad7b9ba..357f7df 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -8027,6 +8027,7 @@ static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors)\n static int i40e_init_msix(struct i40e_pf *pf)\n {\n \tstruct i40e_hw *hw = &pf->hw;\n+\tint cpus, extra_vectors;\n \tint vectors_left;\n \tint v_budget, i;\n \tint v_actual;\n@@ -8062,10 +8063,16 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\tvectors_left--;\n \t}\n \n-\t/* reserve vectors for the main PF traffic queues */\n-\tpf->num_lan_msix = min_t(int, num_online_cpus(), vectors_left);\n+\t/* reserve some vectors for the main PF traffic queues. Initially we\n+\t * only reserve at most 50% of the available vectors, in the case that\n+\t * the number of online CPUs is large. This ensures that we can enable\n+\t * extra features as well. Once we've enabled the other features, we\n+\t * will use any remaining vectors to reach as close as we can to the\n+\t * number of online CPUs.\n+\t */\n+\tcpus = num_online_cpus();\n+\tpf->num_lan_msix = min_t(int, cpus, vectors_left / 2);\n \tvectors_left -= pf->num_lan_msix;\n-\tv_budget += pf->num_lan_msix;\n \n \t/* reserve one vector for sideband flow director */\n \tif (pf->flags & I40E_FLAG_FD_SB_ENABLED) {\n@@ -8128,6 +8135,23 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\t}\n \t}\n \n+\t/* On systems with a large number of SMP cores, we previously limited\n+\t * the number of vectors for num_lan_msix to be at most 50% of the\n+\t * available vectors, to allow for other features. Now, we add back\n+\t * the remaining vectors. However, we ensure that the total\n+\t * num_lan_msix will not exceed num_online_cpus(). To do this, we\n+\t * calculate the number of vectors we can add without going over the\n+\t * cap of CPUs. For systems with a small number of CPUs this will be\n+\t * zero.\n+\t */\n+\textra_vectors = min_t(int, cpus - pf->num_lan_msix, vectors_left);\n+\tpf->num_lan_msix += extra_vectors;\n+\tvectors_left -= extra_vectors;\n+\n+\tWARN(vectors_left < 0,\n+\t     \"Calculation of remaining vectors underflowed. This is an accounting bug when determining total MSI-X vectors.\\n\");\n+\n+\tv_budget += pf->num_lan_msix;\n \tpf->msix_entries = kcalloc(v_budget, sizeof(struct msix_entry),\n \t\t\t\t   GFP_KERNEL);\n \tif (!pf->msix_entries)\n",
    "prefixes": [
        "next",
        "S58-V3",
        "4/4"
    ]
}