Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/671676/?format=api
{ "id": 671676, "url": "http://patchwork.ozlabs.org/api/patches/671676/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1474285071-28218-3-git-send-email-sassmann@kpanic.de/", "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": "<1474285071-28218-3-git-send-email-sassmann@kpanic.de>", "list_archive_url": null, "date": "2016-09-19T11:37:50", "name": "[net-next,2/3] i40e: fix MSI-X vector redistribution if hw limit is reached", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6586c569fba3898727c9d0790530a54cfe859f47", "submitter": { "id": 7508, "url": "http://patchwork.ozlabs.org/api/people/7508/?format=api", "name": "Stefan Assmann", "email": "sassmann@kpanic.de" }, "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/1474285071-28218-3-git-send-email-sassmann@kpanic.de/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/671676/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/671676/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 3sd3mj5pYLz9s5w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 19 Sep 2016 21:38:29 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5C3D887D7A;\n\tMon, 19 Sep 2016 11:38:28 +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 rJR9MJNd35nG; Mon, 19 Sep 2016 11:38:25 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 706CC87D53;\n\tMon, 19 Sep 2016 11:38:25 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2941C1C0CF8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Sep 2016 11:38:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2577588990\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Sep 2016 11:38:24 +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 BTt2FgmMdQio for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Sep 2016 11:38:20 +0000 (UTC)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 55A3586EA1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Sep 2016 11:38:19 +0000 (UTC)", "from int-mx10.intmail.prod.int.phx2.redhat.com\n\t(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 74512B8904;\n\tMon, 19 Sep 2016 11:38:18 +0000 (UTC)", "from w541.redhat.com (ovpn-116-45.ams2.redhat.com [10.36.116.45])\n\tby int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id u8JBcB2V031490; Mon, 19 Sep 2016 07:38:17 -0400" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": [ "from auto-whitelisted by SQLgrey-1.7.6", "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]); Mon, 19 Sep 2016 11:38:18 +0000 (UTC)" ], "From": "Stefan Assmann <sassmann@kpanic.de>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 19 Sep 2016 13:37:50 +0200", "Message-Id": "<1474285071-28218-3-git-send-email-sassmann@kpanic.de>", "In-Reply-To": "<1474285071-28218-1-git-send-email-sassmann@kpanic.de>", "References": "<1474285071-28218-1-git-send-email-sassmann@kpanic.de>", "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.23", "Cc": "netdev@vger.kernel.org, davem@davemloft.net, sassmann@kpanic.de", "Subject": "[Intel-wired-lan] [PATCH net-next 2/3] i40e: fix MSI-X vector\n\tredistribution if hw limit is reached", "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": "The driver allocates 1 vector per CPU thread and the current hardware\nlimit for vectors is 129 per PF. On systems with 128 or more threads\nthis currently means all vectors are used by the PF leaving no room for\nadditional features like VMDq, iWARP, etc...\nThe code that should redistribute the vectors in this case is broken and\nnever triggers. Fixed the code so that it actually triggers if the\nhardware limit is reached and adjust the number of queue pairs\naccordingly.\nAlso the number of initially requested iWARP vectors was not properly\nsaved when the vector limit was reached, and therefore always zero.\n\nComparison with debug statement.\nBefore:\ni40e 0000:2d:00.0: VMDq disabled, not enough MSI-X vectors\ni40e 0000:2d:00.0: IWARP disabled, not enough MSI-X vectors\ni40e 00.0 MSI-X vector distribution: PF 128, VMDq 0, FDSB 0, iWARP 0\nAfter:\ni40e 0000:2d:00.0: MSI-X vector limit reached, attempting to redistribute vectors\ni40e 00.0 MSI-X vector distribution: PF 78, VMDq 8, FDSB 0, iWARP 42\n\nSigned-off-by: Stefan Assmann <sassmann@kpanic.de>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 38 +++++++++++++++++------------\n 1 file changed, 22 insertions(+), 16 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 5f3f1c8..4727c02 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -7665,6 +7665,8 @@ static int i40e_init_msix(struct i40e_pf *pf)\n #endif\n \t/* can we reserve enough for iWARP? */\n \tif (pf->flags & I40E_FLAG_IWARP_ENABLED) {\n+\t\tiwarp_requested = pf->num_iwarp_msix;\n+\n \t\tif (!vectors_left)\n \t\t\tpf->num_iwarp_msix = 0;\n \t\telse if (vectors_left < pf->num_iwarp_msix)\n@@ -7706,21 +7708,6 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\tpf->msix_entries[i].entry = i;\n \tv_actual = i40e_reserve_msix_vectors(pf, v_budget);\n \n-\tif (v_actual != v_budget) {\n-\t\t/* If we have limited resources, we will start with no vectors\n-\t\t * for the special features and then allocate vectors to some\n-\t\t * of these features based on the policy and at the end disable\n-\t\t * the features that did not get any vectors.\n-\t\t */\n-\t\tiwarp_requested = pf->num_iwarp_msix;\n-\t\tpf->num_iwarp_msix = 0;\n-#ifdef I40E_FCOE\n-\t\tpf->num_fcoe_qps = 0;\n-\t\tpf->num_fcoe_msix = 0;\n-#endif\n-\t\tpf->num_vmdq_msix = 0;\n-\t}\n-\n \tif (v_actual < I40E_MIN_MSIX) {\n \t\tpf->flags &= ~I40E_FLAG_MSIX_ENABLED;\n \t\tkfree(pf->msix_entries);\n@@ -7734,9 +7721,16 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\tpf->num_lan_qps = 1;\n \t\tpf->num_lan_msix = 1;\n \n-\t} else if (v_actual != v_budget) {\n+\t} else if (!vectors_left) {\n+\t\t/* If we have limited resources, we will start with no vectors\n+\t\t * for the special features and then allocate vectors to some\n+\t\t * of these features based on the policy and at the end disable\n+\t\t * the features that did not get any vectors.\n+\t\t */\n \t\tint vec;\n \n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"MSI-X vector limit reached, attempting to redistribute vectors\\n\");\n \t\t/* reserve the misc vector */\n \t\tvec = v_actual - 1;\n \n@@ -7744,6 +7738,10 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\tpf->num_vmdq_msix = 1; /* force VMDqs to only one vector */\n \t\tpf->num_vmdq_vsis = 1;\n \t\tpf->num_vmdq_qps = 1;\n+#ifdef I40E_FCOE\n+\t\tpf->num_fcoe_qps = 0;\n+\t\tpf->num_fcoe_msix = 0;\n+#endif\n \t\tpf->flags &= ~I40E_FLAG_FD_SB_ENABLED;\n \n \t\t/* partition out the remaining vectors */\n@@ -7779,6 +7777,7 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\t\tpf->num_lan_msix = min_t(int,\n \t\t\t (vec - (pf->num_iwarp_msix + pf->num_vmdq_vsis)),\n \t\t\t\t\t\t\t pf->num_lan_msix);\n+\t\t\tpf->num_lan_qps = pf->num_lan_msix;\n #ifdef I40E_FCOE\n \t\t\t/* give one vector to FCoE */\n \t\t\tif (pf->flags & I40E_FLAG_FCOE_ENABLED) {\n@@ -7808,6 +7807,13 @@ static int i40e_init_msix(struct i40e_pf *pf)\n \t\tpf->flags &= ~I40E_FLAG_FCOE_ENABLED;\n \t}\n #endif\n+\ti40e_debug(&pf->hw, I40E_DEBUG_INIT,\n+\t\t \"MSI-X vector distribution: PF %d, VMDq %d, FDSB %d, iWARP %d\\n\",\n+\t\t pf->num_lan_msix,\n+\t\t pf->num_vmdq_msix * pf->num_vmdq_vsis,\n+\t\t pf->num_fdsb_msix,\n+\t\t pf->num_iwarp_msix);\n+\n \treturn v_actual;\n }\n \n", "prefixes": [ "net-next", "2/3" ] }