Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/989701/?format=api
{ "id": 989701, "url": "http://patchwork.ozlabs.org/api/patches/989701/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20181026174105.11628-15-anirudh.venkataramanan@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": "<20181026174105.11628-15-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2018-10-26T17:41:03", "name": "[S8,14/16] ice: Calculate guaranteed VSIs per function and use it", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3cedd4260ccb7fdadb8b5d4af539dda19999e4e4", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20181026174105.11628-15-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 72783, "url": "http://patchwork.ozlabs.org/api/series/72783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=72783", "date": "2018-10-26T17:40:52", "name": "Bug fixes for ice, set 1/2", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/72783/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/989701/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/989701/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 42hWk534CNz9sLt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 27 Oct 2018 04:50:37 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id DAD0622C44;\n\tFri, 26 Oct 2018 17:50:35 +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 K-XvqCkOk2+V; Fri, 26 Oct 2018 17:50:34 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3DBFD25933;\n\tFri, 26 Oct 2018 17:50:34 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6893A1BF30F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:28 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 65B0488726\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50: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 WgUo9ew1rnus for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:26 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id B2F8B88734\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:26 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Oct 2018 10:41:06 -0700", "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga004.jf.intel.com with ESMTP; 26 Oct 2018 10:41:05 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,428,1534834800\"; d=\"scan'208\";a=\"244654995\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 26 Oct 2018 10:41:03 -0700", "Message-Id": "<20181026174105.11628-15-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20181026174105.11628-1-anirudh.venkataramanan@intel.com>", "References": "<20181026174105.11628-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S8 14/16] ice: Calculate guaranteed VSIs\n\tper function and use it", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Currently we are setting the guar_num_vsi to equal to ICE_MAX_VSI\nwhich is the device limit of 768. This is incorrect and could have\nunintended consequences. To fix this use the valid_function's 8-bit\nbitmap returned from discovering device capabilities to determine the\nguar_num_vsi per function. guar_num_vsi value is then passed on to\npf->num_alloc_vsi.\n\nAlso shorten instances of \"guaranteed\" to \"guar\"\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h | 1 -\n drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 1 +\n drivers/net/ethernet/intel/ice/ice_common.c | 31 +++++++++++++++++++++++--\n drivers/net/ethernet/intel/ice/ice_main.c | 3 +--\n drivers/net/ethernet/intel/ice/ice_type.h | 4 +++-\n 5 files changed, 34 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex b8548370f1c7..ba03cbd3638e 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -52,7 +52,6 @@ extern const char ice_drv_ver[];\n #define ICE_MBXQ_LEN\t\t64\n #define ICE_MIN_MSIX\t\t2\n #define ICE_NO_VSI\t\t0xffff\n-#define ICE_MAX_VSI_ALLOC\t130\n #define ICE_MAX_TXQS\t\t2048\n #define ICE_MAX_RXQS\t\t2048\n #define ICE_VSI_MAP_CONTIG\t0\ndiff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex 6653555f55dd..602f02a0a2d1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -87,6 +87,7 @@ struct ice_aqc_list_caps {\n /* Device/Function buffer entry, repeated per reported capability */\n struct ice_aqc_list_caps_elem {\n \t__le16 cap;\n+#define ICE_AQC_CAPS_VALID_FUNCTIONS\t\t\t0x0005\n #define ICE_AQC_CAPS_SRIOV\t\t\t\t0x0012\n #define ICE_AQC_CAPS_VF\t\t\t\t\t0x0013\n #define ICE_AQC_CAPS_VSI\t\t\t\t0x0017\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex 554fd707a6d6..9de5a3aac77d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -1386,6 +1386,27 @@ void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res)\n \t}\n }\n \n+/**\n+ * ice_get_guar_num_vsi - determine number of guar VSI for a PF\n+ * @hw: pointer to the hw structure\n+ *\n+ * Determine the number of valid functions by going through the bitmap returned\n+ * from parsing capabilities and use this to calculate the number of VSI per PF.\n+ */\n+static u32 ice_get_guar_num_vsi(struct ice_hw *hw)\n+{\n+\tu8 funcs;\n+\n+#define ICE_CAPS_VALID_FUNCS_M\t0xFF\n+\tfuncs = hweight8(hw->dev_caps.common_cap.valid_functions &\n+\t\t\t ICE_CAPS_VALID_FUNCS_M);\n+\n+\tif (!funcs)\n+\t\treturn 0;\n+\n+\treturn ICE_MAX_VSI / funcs;\n+}\n+\n /**\n * ice_parse_caps - parse function/device capabilities\n * @hw: pointer to the hw struct\n@@ -1428,6 +1449,12 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,\n \t\tu16 cap = le16_to_cpu(cap_resp->cap);\n \n \t\tswitch (cap) {\n+\t\tcase ICE_AQC_CAPS_VALID_FUNCTIONS:\n+\t\t\tcaps->valid_functions = number;\n+\t\t\tice_debug(hw, ICE_DBG_INIT,\n+\t\t\t\t \"HW caps: Valid Functions = %d\\n\",\n+\t\t\t\t caps->valid_functions);\n+\t\t\tbreak;\n \t\tcase ICE_AQC_CAPS_SRIOV:\n \t\t\tcaps->sr_iov_1_1 = (number == 1);\n \t\t\tice_debug(hw, ICE_DBG_INIT,\n@@ -1457,10 +1484,10 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,\n \t\t\t\t\t \"HW caps: Dev.VSI cnt = %d\\n\",\n \t\t\t\t\t dev_p->num_vsi_allocd_to_host);\n \t\t\t} else if (func_p) {\n-\t\t\t\tfunc_p->guaranteed_num_vsi = number;\n+\t\t\t\tfunc_p->guar_num_vsi = ice_get_guar_num_vsi(hw);\n \t\t\t\tice_debug(hw, ICE_DBG_INIT,\n \t\t\t\t\t \"HW caps: Func.VSI cnt = %d\\n\",\n-\t\t\t\t\t func_p->guaranteed_num_vsi);\n+\t\t\t\t\t number);\n \t\t\t}\n \t\t\tbreak;\n \t\tcase ICE_AQC_CAPS_RSS:\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 8584061e1bc6..ea79e5e1f589 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -2091,8 +2091,7 @@ static int ice_probe(struct pci_dev *pdev,\n \n \tice_determine_q_usage(pf);\n \n-\tpf->num_alloc_vsi = min_t(u16, ICE_MAX_VSI_ALLOC,\n-\t\t\t\t hw->func_caps.guaranteed_num_vsi);\n+\tpf->num_alloc_vsi = hw->func_caps.guar_num_vsi;\n \tif (!pf->num_alloc_vsi) {\n \t\terr = -EIO;\n \t\tgoto err_init_pf_unroll;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 12f9432abf11..e5657be86c74 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -124,6 +124,8 @@ struct ice_phy_info {\n \n /* Common HW capabilities for SW use */\n struct ice_hw_common_caps {\n+\tu32 valid_functions;\n+\n \t/* TX/RX queues */\n \tu16 num_rxq;\t\t/* Number/Total RX queues */\n \tu16 rxq_first_id;\t/* First queue ID for RX queues */\n@@ -150,7 +152,7 @@ struct ice_hw_func_caps {\n \tstruct ice_hw_common_caps common_cap;\n \tu32 num_allocd_vfs;\t\t/* Number of allocated VFs */\n \tu32 vf_base_id;\t\t\t/* Logical ID of the first VF */\n-\tu32 guaranteed_num_vsi;\n+\tu32 guar_num_vsi;\n };\n \n /* Device wide capabilities */\n", "prefixes": [ "S8", "14/16" ] }