get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 712178,
    "url": "http://patchwork.ozlabs.org/api/patches/712178/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1483739589-15480-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": "<1483739589-15480-4-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-06T21:53:09",
    "name": "[next,S58-V2,4/4] i40e: don't add more vectors to num_lan_msix than number of CPUs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "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/1483739589-15480-4-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/712178/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/712178/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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3twJHh2trKz9t17\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Jan 2017 08:54:56 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DE72A8980D;\n\tFri,  6 Jan 2017 21:54:54 +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 RpifOuq1Ow8u; Fri,  6 Jan 2017 21:54:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 420398981B;\n\tFri,  6 Jan 2017 21:54:54 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id B4FBD1C0586\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 21:54:52 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AAA6F89828\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 21:54:52 +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 ot2ZP8sknx-p for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 21:54:52 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 188548981C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 21:54:52 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga102.jf.intel.com with ESMTP; 06 Jan 2017 13:54:51 -0800",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby fmsmga006.fm.intel.com with ESMTP; 06 Jan 2017 13:54:50 -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,326,1477983600\"; d=\"scan'208\";a=\"50964627\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri,  6 Jan 2017 13:53:09 -0800",
        "Message-Id": "<1483739589-15480-4-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1483739589-15480-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1483739589-15480-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S58-V2 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 2e22b6c..a210844 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -8021,6 +8021,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@@ -8056,10 +8057,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@@ -8122,6 +8129,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-V2",
        "4/4"
    ]
}