Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/972040/?format=api
{ "id": 972040, "url": "http://patchwork.ozlabs.org/api/patches/972040/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180920002319.10971-5-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": "<20180920002319.10971-5-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2018-09-20T00:23:07", "name": "[04/16] ice: Move common functions out of ice_main.c part 4/7", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "174227c115806d53b4b7a368e5b705dc20e9454a", "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/20180920002319.10971-5-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 66525, "url": "http://patchwork.ozlabs.org/api/series/66525/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=66525", "date": "2018-09-20T00:23:03", "name": "Implementation updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/66525/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/972040/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/972040/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 42FyBm3j8Cz9sBJ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Sep 2018 10:23:44 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 24EBE882A8;\n\tThu, 20 Sep 2018 00:23:43 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id zDCOX+X7sz8M; Thu, 20 Sep 2018 00:23:33 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8D972882AE;\n\tThu, 20 Sep 2018 00:23:30 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 666111C08AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:28 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 60AC1227F5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:28 +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 PLK1bsa4jh3r for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:24 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 6A059306D3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:24 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Sep 2018 17:23:23 -0700", "from shasta.jf.intel.com ([10.166.241.11])\n\tby fmsmga006.fm.intel.com with ESMTP; 19 Sep 2018 17:23:19 -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.53,396,1531810800\"; d=\"scan'208\";a=\"265057693\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 19 Sep 2018 17:23:07 -0700", "Message-Id": "<20180920002319.10971-5-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20180920002319.10971-1-anirudh.venkataramanan@intel.com>", "References": "<20180920002319.10971-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 04/16] ice: Move common functions out of\n\tice_main.c part 4/7", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "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": "This patch continues the code move out of ice_main.c\n\nThe following top level functions (and related dependency functions) were\nmoved to ice_lib.c:\nice_vsi_alloc_rings\nice_vsi_set_rss_params\nice_vsi_set_num_qs\nice_get_free_slot\nice_vsi_init\nice_vsi_clear_rings\nice_vsi_alloc_arrays\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 414 +++++++++++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_lib.h | 14 +\n drivers/net/ethernet/intel/ice/ice_main.c | 418 +-----------------------------\n 3 files changed, 429 insertions(+), 417 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 25b5575771bb..fa96279139d0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -225,6 +225,102 @@ static int ice_vsi_ctrl_rx_rings(struct ice_vsi *vsi, bool ena)\n \treturn ret;\n }\n \n+/**\n+ * ice_vsi_alloc_arrays - Allocate queue and vector pointer arrays for the vsi\n+ * @vsi: VSI pointer\n+ * @alloc_qvectors: a bool to specify if q_vectors need to be allocated.\n+ *\n+ * On error: returns error code (negative)\n+ * On success: returns 0\n+ */\n+int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors)\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\n+\t/* allocate memory for both Tx and Rx ring pointers */\n+\tvsi->tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,\n+\t\t\t\t sizeof(struct ice_ring *), GFP_KERNEL);\n+\tif (!vsi->tx_rings)\n+\t\tgoto err_txrings;\n+\n+\tvsi->rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,\n+\t\t\t\t sizeof(struct ice_ring *), GFP_KERNEL);\n+\tif (!vsi->rx_rings)\n+\t\tgoto err_rxrings;\n+\n+\tif (alloc_qvectors) {\n+\t\t/* allocate memory for q_vector pointers */\n+\t\tvsi->q_vectors = devm_kcalloc(&pf->pdev->dev,\n+\t\t\t\t\t vsi->num_q_vectors,\n+\t\t\t\t\t sizeof(struct ice_q_vector *),\n+\t\t\t\t\t GFP_KERNEL);\n+\t\tif (!vsi->q_vectors)\n+\t\t\tgoto err_vectors;\n+\t}\n+\n+\treturn 0;\n+\n+err_vectors:\n+\tdevm_kfree(&pf->pdev->dev, vsi->rx_rings);\n+err_rxrings:\n+\tdevm_kfree(&pf->pdev->dev, vsi->tx_rings);\n+err_txrings:\n+\treturn -ENOMEM;\n+}\n+\n+/**\n+ * ice_vsi_set_num_qs - Set num queues, descriptors and vectors for a VSI\n+ * @vsi: the VSI being configured\n+ *\n+ * Return 0 on success and a negative value on error\n+ */\n+void ice_vsi_set_num_qs(struct ice_vsi *vsi)\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\n+\tswitch (vsi->type) {\n+\tcase ICE_VSI_PF:\n+\t\tvsi->alloc_txq = pf->num_lan_tx;\n+\t\tvsi->alloc_rxq = pf->num_lan_rx;\n+\t\tvsi->num_desc = ALIGN(ICE_DFLT_NUM_DESC, ICE_REQ_DESC_MULTIPLE);\n+\t\tvsi->num_q_vectors = max_t(int, pf->num_lan_rx, pf->num_lan_tx);\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(&vsi->back->pdev->dev, \"Unknown VSI type %d\\n\",\n+\t\t\t vsi->type);\n+\t\tbreak;\n+\t}\n+}\n+\n+/**\n+ * ice_get_free_slot - get the next non-NULL location index in array\n+ * @array: array to search\n+ * @size: size of the array\n+ * @curr: last known occupied index to be used as a search hint\n+ *\n+ * void * is being used to keep the functionality generic. This lets us use this\n+ * function on any array of pointers.\n+ */\n+int ice_get_free_slot(void *array, int size, int curr)\n+{\n+\tint **tmp_array = (int **)array;\n+\tint next;\n+\n+\tif (curr < (size - 1) && !tmp_array[curr + 1]) {\n+\t\tnext = curr + 1;\n+\t} else {\n+\t\tint i = 0;\n+\n+\t\twhile ((i < size) && (tmp_array[i]))\n+\t\t\ti++;\n+\t\tif (i == size)\n+\t\t\tnext = ICE_NO_VSI;\n+\t\telse\n+\t\t\tnext = i;\n+\t}\n+\treturn next;\n+}\n+\n /**\n * ice_vsi_delete - delete a VSI from the switch\n * @vsi: pointer to VSI being removed\n@@ -286,6 +382,324 @@ void ice_vsi_put_qs(struct ice_vsi *vsi)\n \tmutex_unlock(&pf->avail_q_mutex);\n }\n \n+/**\n+ * ice_vsi_set_rss_params - Setup RSS capabilities per VSI type\n+ * @vsi: the VSI being configured\n+ */\n+void ice_vsi_set_rss_params(struct ice_vsi *vsi)\n+{\n+\tstruct ice_hw_common_caps *cap;\n+\tstruct ice_pf *pf = vsi->back;\n+\n+\tif (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) {\n+\t\tvsi->rss_size = 1;\n+\t\treturn;\n+\t}\n+\n+\tcap = &pf->hw.func_caps.common_cap;\n+\tswitch (vsi->type) {\n+\tcase ICE_VSI_PF:\n+\t\t/* PF VSI will inherit RSS instance of PF */\n+\t\tvsi->rss_table_size = cap->rss_table_size;\n+\t\tvsi->rss_size = min_t(int, num_online_cpus(),\n+\t\t\t\t BIT(cap->rss_table_entry_width));\n+\t\tvsi->rss_lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\",\n+\t\t\t vsi->type);\n+\t\tbreak;\n+\t}\n+}\n+\n+/**\n+ * ice_set_dflt_vsi_ctx - Set default VSI context before adding a VSI\n+ * @ctxt: the VSI context being set\n+ *\n+ * This initializes a default VSI context for all sections except the Queues.\n+ */\n+static void ice_set_dflt_vsi_ctx(struct ice_vsi_ctx *ctxt)\n+{\n+\tu32 table = 0;\n+\n+\tmemset(&ctxt->info, 0, sizeof(ctxt->info));\n+\t/* VSI's should be allocated from shared pool */\n+\tctxt->alloc_from_pool = true;\n+\t/* Src pruning enabled by default */\n+\tctxt->info.sw_flags = ICE_AQ_VSI_SW_FLAG_SRC_PRUNE;\n+\t/* Traffic from VSI can be sent to LAN */\n+\tctxt->info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;\n+\t/* By default bits 3 and 4 in vlan_flags are 0's which results in legacy\n+\t * behavior (show VLAN, DEI, and UP) in descriptor. Also, allow all\n+\t * packets untagged/tagged.\n+\t */\n+\tctxt->info.vlan_flags = ((ICE_AQ_VSI_VLAN_MODE_ALL &\n+\t\t\t\t ICE_AQ_VSI_VLAN_MODE_M) >>\n+\t\t\t\t ICE_AQ_VSI_VLAN_MODE_S);\n+\t/* Have 1:1 UP mapping for both ingress/egress tables */\n+\ttable |= ICE_UP_TABLE_TRANSLATE(0, 0);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(1, 1);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(2, 2);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(3, 3);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(4, 4);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(5, 5);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(6, 6);\n+\ttable |= ICE_UP_TABLE_TRANSLATE(7, 7);\n+\tctxt->info.ingress_table = cpu_to_le32(table);\n+\tctxt->info.egress_table = cpu_to_le32(table);\n+\t/* Have 1:1 UP mapping for outer to inner UP table */\n+\tctxt->info.outer_up_table = cpu_to_le32(table);\n+\t/* No Outer tag support outer_tag_flags remains to zero */\n+}\n+\n+/**\n+ * ice_vsi_setup_q_map - Setup a VSI queue map\n+ * @vsi: the VSI being configured\n+ * @ctxt: VSI context structure\n+ */\n+static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)\n+{\n+\tu16 offset = 0, qmap = 0, numq_tc;\n+\tu16 pow = 0, max_rss = 0, qcount;\n+\tu16 qcount_tx = vsi->alloc_txq;\n+\tu16 qcount_rx = vsi->alloc_rxq;\n+\tbool ena_tc0 = false;\n+\tint i;\n+\n+\t/* at least TC0 should be enabled by default */\n+\tif (vsi->tc_cfg.numtc) {\n+\t\tif (!(vsi->tc_cfg.ena_tc & BIT(0)))\n+\t\t\tena_tc0 = true;\n+\t} else {\n+\t\tena_tc0 = true;\n+\t}\n+\n+\tif (ena_tc0) {\n+\t\tvsi->tc_cfg.numtc++;\n+\t\tvsi->tc_cfg.ena_tc |= 1;\n+\t}\n+\n+\tnumq_tc = qcount_rx / vsi->tc_cfg.numtc;\n+\n+\t/* TC mapping is a function of the number of Rx queues assigned to the\n+\t * VSI for each traffic class and the offset of these queues.\n+\t * The first 10 bits are for queue offset for TC0, next 4 bits for no:of\n+\t * queues allocated to TC0. No:of queues is a power-of-2.\n+\t *\n+\t * If TC is not enabled, the queue offset is set to 0, and allocate one\n+\t * queue, this way, traffic for the given TC will be sent to the default\n+\t * queue.\n+\t *\n+\t * Setup number and offset of Rx queues for all TCs for the VSI\n+\t */\n+\n+\t/* qcount will change if RSS is enabled */\n+\tif (test_bit(ICE_FLAG_RSS_ENA, vsi->back->flags)) {\n+\t\tif (vsi->type == ICE_VSI_PF)\n+\t\t\tmax_rss = ICE_MAX_LG_RSS_QS;\n+\t\telse\n+\t\t\tmax_rss = ICE_MAX_SMALL_RSS_QS;\n+\n+\t\tqcount = min_t(int, numq_tc, max_rss);\n+\t\tqcount = min_t(int, qcount, vsi->rss_size);\n+\t} else {\n+\t\tqcount = numq_tc;\n+\t}\n+\n+\t/* find the (rounded up) power-of-2 of qcount */\n+\tpow = order_base_2(qcount);\n+\n+\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\t\tif (!(vsi->tc_cfg.ena_tc & BIT(i))) {\n+\t\t\t/* TC is not enabled */\n+\t\t\tvsi->tc_cfg.tc_info[i].qoffset = 0;\n+\t\t\tvsi->tc_cfg.tc_info[i].qcount = 1;\n+\t\t\tctxt->info.tc_mapping[i] = 0;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t/* TC is enabled */\n+\t\tvsi->tc_cfg.tc_info[i].qoffset = offset;\n+\t\tvsi->tc_cfg.tc_info[i].qcount = qcount;\n+\n+\t\tqmap = ((offset << ICE_AQ_VSI_TC_Q_OFFSET_S) &\n+\t\t\tICE_AQ_VSI_TC_Q_OFFSET_M) |\n+\t\t\t((pow << ICE_AQ_VSI_TC_Q_NUM_S) &\n+\t\t\t ICE_AQ_VSI_TC_Q_NUM_M);\n+\t\toffset += qcount;\n+\t\tctxt->info.tc_mapping[i] = cpu_to_le16(qmap);\n+\t}\n+\n+\tvsi->num_txq = qcount_tx;\n+\tvsi->num_rxq = offset;\n+\n+\t/* Rx queue mapping */\n+\tctxt->info.mapping_flags |= cpu_to_le16(ICE_AQ_VSI_Q_MAP_CONTIG);\n+\t/* q_mapping buffer holds the info for the first queue allocated for\n+\t * this VSI in the PF space and also the number of queues associated\n+\t * with this VSI.\n+\t */\n+\tctxt->info.q_mapping[0] = cpu_to_le16(vsi->rxq_map[0]);\n+\tctxt->info.q_mapping[1] = cpu_to_le16(vsi->num_rxq);\n+}\n+\n+/**\n+ * ice_set_rss_vsi_ctx - Set RSS VSI context before adding a VSI\n+ * @ctxt: the VSI context being set\n+ * @vsi: the VSI being configured\n+ */\n+static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)\n+{\n+\tu8 lut_type, hash_type;\n+\n+\tswitch (vsi->type) {\n+\tcase ICE_VSI_PF:\n+\t\t/* PF VSI will inherit RSS instance of PF */\n+\t\tlut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_PF;\n+\t\thash_type = ICE_AQ_VSI_Q_OPT_RSS_TPLZ;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(&vsi->back->pdev->dev, \"Unknown VSI type %d\\n\",\n+\t\t\t vsi->type);\n+\t\treturn;\n+\t}\n+\n+\tctxt->info.q_opt_rss = ((lut_type << ICE_AQ_VSI_Q_OPT_RSS_LUT_S) &\n+\t\t\t\tICE_AQ_VSI_Q_OPT_RSS_LUT_M) |\n+\t\t\t\t((hash_type << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) &\n+\t\t\t\t ICE_AQ_VSI_Q_OPT_RSS_HASH_M);\n+}\n+\n+/**\n+ * ice_vsi_init - Create and initialize a VSI\n+ * @vsi: the VSI being configured\n+ *\n+ * This initializes a VSI context depending on the VSI type to be added and\n+ * passes it down to the add_vsi aq command to create a new VSI.\n+ */\n+int ice_vsi_init(struct ice_vsi *vsi)\n+{\n+\tstruct ice_vsi_ctx ctxt = { 0 };\n+\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_hw *hw = &pf->hw;\n+\tint ret = 0;\n+\n+\tswitch (vsi->type) {\n+\tcase ICE_VSI_PF:\n+\t\tctxt.flags = ICE_AQ_VSI_TYPE_PF;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tice_set_dflt_vsi_ctx(&ctxt);\n+\t/* if the switch is in VEB mode, allow VSI loopback */\n+\tif (vsi->vsw->bridge_mode == BRIDGE_MODE_VEB)\n+\t\tctxt.info.sw_flags |= ICE_AQ_VSI_SW_FLAG_ALLOW_LB;\n+\n+\t/* Set LUT type and HASH type if RSS is enabled */\n+\tif (test_bit(ICE_FLAG_RSS_ENA, pf->flags))\n+\t\tice_set_rss_vsi_ctx(&ctxt, vsi);\n+\n+\tctxt.info.sw_id = vsi->port_info->sw_id;\n+\tice_vsi_setup_q_map(vsi, &ctxt);\n+\n+\tret = ice_add_vsi(hw, vsi->idx, &ctxt, NULL);\n+\tif (ret) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"Add VSI failed, err %d\\n\", ret);\n+\t\treturn -EIO;\n+\t}\n+\n+\t/* keep context for update VSI operations */\n+\tvsi->info = ctxt.info;\n+\n+\t/* record VSI number returned */\n+\tvsi->vsi_num = ctxt.vsi_num;\n+\n+\treturn ret;\n+}\n+\n+/**\n+ * ice_vsi_clear_rings - Deallocates the Tx and Rx rings for VSI\n+ * @vsi: the VSI having rings deallocated\n+ */\n+void ice_vsi_clear_rings(struct ice_vsi *vsi)\n+{\n+\tint i;\n+\n+\tif (vsi->tx_rings) {\n+\t\tfor (i = 0; i < vsi->alloc_txq; i++) {\n+\t\t\tif (vsi->tx_rings[i]) {\n+\t\t\t\tkfree_rcu(vsi->tx_rings[i], rcu);\n+\t\t\t\tvsi->tx_rings[i] = NULL;\n+\t\t\t}\n+\t\t}\n+\t}\n+\tif (vsi->rx_rings) {\n+\t\tfor (i = 0; i < vsi->alloc_rxq; i++) {\n+\t\t\tif (vsi->rx_rings[i]) {\n+\t\t\t\tkfree_rcu(vsi->rx_rings[i], rcu);\n+\t\t\t\tvsi->rx_rings[i] = NULL;\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+/**\n+ * ice_vsi_alloc_rings - Allocates Tx and Rx rings for the VSI\n+ * @vsi: VSI which is having rings allocated\n+ */\n+int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n+{\n+\tstruct ice_pf *pf = vsi->back;\n+\tint i;\n+\n+\t/* Allocate tx_rings */\n+\tfor (i = 0; i < vsi->alloc_txq; i++) {\n+\t\tstruct ice_ring *ring;\n+\n+\t\t/* allocate with kzalloc(), free with kfree_rcu() */\n+\t\tring = kzalloc(sizeof(*ring), GFP_KERNEL);\n+\n+\t\tif (!ring)\n+\t\t\tgoto err_out;\n+\n+\t\tring->q_index = i;\n+\t\tring->reg_idx = vsi->txq_map[i];\n+\t\tring->ring_active = false;\n+\t\tring->vsi = vsi;\n+\t\tring->dev = &pf->pdev->dev;\n+\t\tring->count = vsi->num_desc;\n+\t\tvsi->tx_rings[i] = ring;\n+\t}\n+\n+\t/* Allocate rx_rings */\n+\tfor (i = 0; i < vsi->alloc_rxq; i++) {\n+\t\tstruct ice_ring *ring;\n+\n+\t\t/* allocate with kzalloc(), free with kfree_rcu() */\n+\t\tring = kzalloc(sizeof(*ring), GFP_KERNEL);\n+\t\tif (!ring)\n+\t\t\tgoto err_out;\n+\n+\t\tring->q_index = i;\n+\t\tring->reg_idx = vsi->rxq_map[i];\n+\t\tring->ring_active = false;\n+\t\tring->vsi = vsi;\n+\t\tring->netdev = vsi->netdev;\n+\t\tring->dev = &pf->pdev->dev;\n+\t\tring->count = vsi->num_desc;\n+\t\tvsi->rx_rings[i] = ring;\n+\t}\n+\n+\treturn 0;\n+\n+err_out:\n+\tice_vsi_clear_rings(vsi);\n+\treturn -ENOMEM;\n+}\n+\n /**\n * ice_add_mac_to_list - Add a mac address filter entry to the list\n * @vsi: the VSI to be forwarded to\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex cbde99f38798..ab5a4e1edcf8 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -6,6 +6,20 @@\n \n #include \"ice.h\"\n \n+int ice_vsi_alloc_rings(struct ice_vsi *vsi);\n+\n+void ice_vsi_set_rss_params(struct ice_vsi *vsi);\n+\n+void ice_vsi_set_num_qs(struct ice_vsi *vsi);\n+\n+int ice_get_free_slot(void *array, int size, int curr);\n+\n+int ice_vsi_init(struct ice_vsi *vsi);\n+\n+void ice_vsi_clear_rings(struct ice_vsi *vsi);\n+\n+int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors);\n+\n int ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list,\n \t\t\tconst u8 *macaddr);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 5d893e53976c..9ef8611d13b0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -33,6 +33,7 @@ static const struct net_device_ops ice_netdev_ops;\n static void ice_pf_dis_all_vsi(struct ice_pf *pf);\n static void ice_rebuild(struct ice_pf *pf);\n static int ice_vsi_release(struct ice_vsi *vsi);\n+\n static void ice_vsi_release_all(struct ice_pf *pf);\n static void ice_update_vsi_stats(struct ice_vsi *vsi);\n static void ice_update_pf_stats(struct ice_pf *pf);\n@@ -112,35 +113,6 @@ static void ice_check_for_hang_subtask(struct ice_pf *pf)\n \t}\n }\n \n-/**\n- * ice_get_free_slot - get the next non-NULL location index in array\n- * @array: array to search\n- * @size: size of the array\n- * @curr: last known occupied index to be used as a search hint\n- *\n- * void * is being used to keep the functionality generic. This lets us use this\n- * function on any array of pointers.\n- */\n-static int ice_get_free_slot(void *array, int size, int curr)\n-{\n-\tint **tmp_array = (int **)array;\n-\tint next;\n-\n-\tif (curr < (size - 1) && !tmp_array[curr + 1]) {\n-\t\tnext = curr + 1;\n-\t} else {\n-\t\tint i = 0;\n-\n-\t\twhile ((i < size) && (tmp_array[i]))\n-\t\t\ti++;\n-\t\tif (i == size)\n-\t\t\tnext = ICE_NO_VSI;\n-\t\telse\n-\t\t\tnext = i;\n-\t}\n-\treturn next;\n-}\n-\n /**\n * ice_add_mac_to_sync_list - creates list of mac addresses to be synced\n * @netdev: the net device on which the sync is happening\n@@ -1210,327 +1182,6 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)\n \treturn err;\n }\n \n-/**\n- * ice_vsi_set_rss_params - Setup RSS capabilities per VSI type\n- * @vsi: the VSI being configured\n- */\n-static void ice_vsi_set_rss_params(struct ice_vsi *vsi)\n-{\n-\tstruct ice_hw_common_caps *cap;\n-\tstruct ice_pf *pf = vsi->back;\n-\n-\tif (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) {\n-\t\tvsi->rss_size = 1;\n-\t\treturn;\n-\t}\n-\n-\tcap = &pf->hw.func_caps.common_cap;\n-\tswitch (vsi->type) {\n-\tcase ICE_VSI_PF:\n-\t\t/* PF VSI will inherit RSS instance of PF */\n-\t\tvsi->rss_table_size = cap->rss_table_size;\n-\t\tvsi->rss_size = min_t(int, num_online_cpus(),\n-\t\t\t\t BIT(cap->rss_table_entry_width));\n-\t\tvsi->rss_lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n-\t\tbreak;\n-\tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\", vsi->type);\n-\t\tbreak;\n-\t}\n-}\n-\n-/**\n- * ice_vsi_setup_q_map - Setup a VSI queue map\n- * @vsi: the VSI being configured\n- * @ctxt: VSI context structure\n- */\n-static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)\n-{\n-\tu16 offset = 0, qmap = 0, numq_tc;\n-\tu16 pow = 0, max_rss = 0, qcount;\n-\tu16 qcount_tx = vsi->alloc_txq;\n-\tu16 qcount_rx = vsi->alloc_rxq;\n-\tbool ena_tc0 = false;\n-\tint i;\n-\n-\t/* at least TC0 should be enabled by default */\n-\tif (vsi->tc_cfg.numtc) {\n-\t\tif (!(vsi->tc_cfg.ena_tc & BIT(0)))\n-\t\t\tena_tc0 = true;\n-\t} else {\n-\t\tena_tc0 = true;\n-\t}\n-\n-\tif (ena_tc0) {\n-\t\tvsi->tc_cfg.numtc++;\n-\t\tvsi->tc_cfg.ena_tc |= 1;\n-\t}\n-\n-\tnumq_tc = qcount_rx / vsi->tc_cfg.numtc;\n-\n-\t/* TC mapping is a function of the number of Rx queues assigned to the\n-\t * VSI for each traffic class and the offset of these queues.\n-\t * The first 10 bits are for queue offset for TC0, next 4 bits for no:of\n-\t * queues allocated to TC0. No:of queues is a power-of-2.\n-\t *\n-\t * If TC is not enabled, the queue offset is set to 0, and allocate one\n-\t * queue, this way, traffic for the given TC will be sent to the default\n-\t * queue.\n-\t *\n-\t * Setup number and offset of Rx queues for all TCs for the VSI\n-\t */\n-\n-\t/* qcount will change if RSS is enabled */\n-\tif (test_bit(ICE_FLAG_RSS_ENA, vsi->back->flags)) {\n-\t\tif (vsi->type == ICE_VSI_PF)\n-\t\t\tmax_rss = ICE_MAX_LG_RSS_QS;\n-\t\telse\n-\t\t\tmax_rss = ICE_MAX_SMALL_RSS_QS;\n-\n-\t\tqcount = min_t(int, numq_tc, max_rss);\n-\t\tqcount = min_t(int, qcount, vsi->rss_size);\n-\t} else {\n-\t\tqcount = numq_tc;\n-\t}\n-\n-\t/* find the (rounded up) power-of-2 of qcount */\n-\tpow = order_base_2(qcount);\n-\n-\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n-\t\tif (!(vsi->tc_cfg.ena_tc & BIT(i))) {\n-\t\t\t/* TC is not enabled */\n-\t\t\tvsi->tc_cfg.tc_info[i].qoffset = 0;\n-\t\t\tvsi->tc_cfg.tc_info[i].qcount = 1;\n-\t\t\tctxt->info.tc_mapping[i] = 0;\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\t/* TC is enabled */\n-\t\tvsi->tc_cfg.tc_info[i].qoffset = offset;\n-\t\tvsi->tc_cfg.tc_info[i].qcount = qcount;\n-\n-\t\tqmap = ((offset << ICE_AQ_VSI_TC_Q_OFFSET_S) &\n-\t\t\tICE_AQ_VSI_TC_Q_OFFSET_M) |\n-\t\t\t((pow << ICE_AQ_VSI_TC_Q_NUM_S) &\n-\t\t\t ICE_AQ_VSI_TC_Q_NUM_M);\n-\t\toffset += qcount;\n-\t\tctxt->info.tc_mapping[i] = cpu_to_le16(qmap);\n-\t}\n-\n-\tvsi->num_txq = qcount_tx;\n-\tvsi->num_rxq = offset;\n-\n-\t/* Rx queue mapping */\n-\tctxt->info.mapping_flags |= cpu_to_le16(ICE_AQ_VSI_Q_MAP_CONTIG);\n-\t/* q_mapping buffer holds the info for the first queue allocated for\n-\t * this VSI in the PF space and also the number of queues associated\n-\t * with this VSI.\n-\t */\n-\tctxt->info.q_mapping[0] = cpu_to_le16(vsi->rxq_map[0]);\n-\tctxt->info.q_mapping[1] = cpu_to_le16(vsi->num_rxq);\n-}\n-\n-/**\n- * ice_set_dflt_vsi_ctx - Set default VSI context before adding a VSI\n- * @ctxt: the VSI context being set\n- *\n- * This initializes a default VSI context for all sections except the Queues.\n- */\n-static void ice_set_dflt_vsi_ctx(struct ice_vsi_ctx *ctxt)\n-{\n-\tu32 table = 0;\n-\n-\tmemset(&ctxt->info, 0, sizeof(ctxt->info));\n-\t/* VSI's should be allocated from shared pool */\n-\tctxt->alloc_from_pool = true;\n-\t/* Src pruning enabled by default */\n-\tctxt->info.sw_flags = ICE_AQ_VSI_SW_FLAG_SRC_PRUNE;\n-\t/* Traffic from VSI can be sent to LAN */\n-\tctxt->info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;\n-\n-\t/* By default bits 3 and 4 in vlan_flags are 0's which results in legacy\n-\t * behavior (show VLAN, DEI, and UP) in descriptor. Also, allow all\n-\t * packets untagged/tagged.\n-\t */\n-\tctxt->info.vlan_flags = ((ICE_AQ_VSI_VLAN_MODE_ALL &\n-\t\t\t\t ICE_AQ_VSI_VLAN_MODE_M) >>\n-\t\t\t\t ICE_AQ_VSI_VLAN_MODE_S);\n-\n-\t/* Have 1:1 UP mapping for both ingress/egress tables */\n-\ttable |= ICE_UP_TABLE_TRANSLATE(0, 0);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(1, 1);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(2, 2);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(3, 3);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(4, 4);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(5, 5);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(6, 6);\n-\ttable |= ICE_UP_TABLE_TRANSLATE(7, 7);\n-\tctxt->info.ingress_table = cpu_to_le32(table);\n-\tctxt->info.egress_table = cpu_to_le32(table);\n-\t/* Have 1:1 UP mapping for outer to inner UP table */\n-\tctxt->info.outer_up_table = cpu_to_le32(table);\n-\t/* No Outer tag support outer_tag_flags remains to zero */\n-}\n-\n-/**\n- * ice_set_rss_vsi_ctx - Set RSS VSI context before adding a VSI\n- * @ctxt: the VSI context being set\n- * @vsi: the VSI being configured\n- */\n-static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)\n-{\n-\tu8 lut_type, hash_type;\n-\n-\tswitch (vsi->type) {\n-\tcase ICE_VSI_PF:\n-\t\t/* PF VSI will inherit RSS instance of PF */\n-\t\tlut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_PF;\n-\t\thash_type = ICE_AQ_VSI_Q_OPT_RSS_TPLZ;\n-\t\tbreak;\n-\tdefault:\n-\t\tdev_warn(&vsi->back->pdev->dev, \"Unknown VSI type %d\\n\",\n-\t\t\t vsi->type);\n-\t\treturn;\n-\t}\n-\n-\tctxt->info.q_opt_rss = ((lut_type << ICE_AQ_VSI_Q_OPT_RSS_LUT_S) &\n-\t\t\t\tICE_AQ_VSI_Q_OPT_RSS_LUT_M) |\n-\t\t\t\t((hash_type << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) &\n-\t\t\t\t ICE_AQ_VSI_Q_OPT_RSS_HASH_M);\n-}\n-\n-/**\n- * ice_vsi_init - Create and initialize a VSI\n- * @vsi: the VSI being configured\n- *\n- * This initializes a VSI context depending on the VSI type to be added and\n- * passes it down to the add_vsi aq command to create a new VSI.\n- */\n-static int ice_vsi_init(struct ice_vsi *vsi)\n-{\n-\tstruct ice_vsi_ctx ctxt = { 0 };\n-\tstruct ice_pf *pf = vsi->back;\n-\tstruct ice_hw *hw = &pf->hw;\n-\tint ret = 0;\n-\n-\tswitch (vsi->type) {\n-\tcase ICE_VSI_PF:\n-\t\tctxt.flags = ICE_AQ_VSI_TYPE_PF;\n-\t\tbreak;\n-\tdefault:\n-\t\treturn -ENODEV;\n-\t}\n-\n-\tice_set_dflt_vsi_ctx(&ctxt);\n-\t/* if the switch is in VEB mode, allow VSI loopback */\n-\tif (vsi->vsw->bridge_mode == BRIDGE_MODE_VEB)\n-\t\tctxt.info.sw_flags |= ICE_AQ_VSI_SW_FLAG_ALLOW_LB;\n-\n-\t/* Set LUT type and HASH type if RSS is enabled */\n-\tif (test_bit(ICE_FLAG_RSS_ENA, pf->flags))\n-\t\tice_set_rss_vsi_ctx(&ctxt, vsi);\n-\n-\tctxt.info.sw_id = vsi->port_info->sw_id;\n-\tice_vsi_setup_q_map(vsi, &ctxt);\n-\n-\tret = ice_add_vsi(hw, vsi->idx, &ctxt, NULL);\n-\tif (ret) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Add VSI failed, err %d\\n\", ret);\n-\t\treturn -EIO;\n-\t}\n-\n-\t/* keep context for update VSI operations */\n-\tvsi->info = ctxt.info;\n-\n-\t/* record VSI number returned */\n-\tvsi->vsi_num = ctxt.vsi_num;\n-\n-\treturn ret;\n-}\n-\n-/**\n- * ice_vsi_clear_rings - Deallocates the Tx and Rx rings for VSI\n- * @vsi: the VSI having rings deallocated\n- */\n-static void ice_vsi_clear_rings(struct ice_vsi *vsi)\n-{\n-\tint i;\n-\n-\tif (vsi->tx_rings) {\n-\t\tfor (i = 0; i < vsi->alloc_txq; i++) {\n-\t\t\tif (vsi->tx_rings[i]) {\n-\t\t\t\tkfree_rcu(vsi->tx_rings[i], rcu);\n-\t\t\t\tvsi->tx_rings[i] = NULL;\n-\t\t\t}\n-\t\t}\n-\t}\n-\tif (vsi->rx_rings) {\n-\t\tfor (i = 0; i < vsi->alloc_rxq; i++) {\n-\t\t\tif (vsi->rx_rings[i]) {\n-\t\t\t\tkfree_rcu(vsi->rx_rings[i], rcu);\n-\t\t\t\tvsi->rx_rings[i] = NULL;\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-/**\n- * ice_vsi_alloc_rings - Allocates Tx and Rx rings for the VSI\n- * @vsi: VSI which is having rings allocated\n- */\n-static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n-{\n-\tstruct ice_pf *pf = vsi->back;\n-\tint i;\n-\n-\t/* Allocate tx_rings */\n-\tfor (i = 0; i < vsi->alloc_txq; i++) {\n-\t\tstruct ice_ring *ring;\n-\n-\t\t/* allocate with kzalloc(), free with kfree_rcu() */\n-\t\tring = kzalloc(sizeof(*ring), GFP_KERNEL);\n-\n-\t\tif (!ring)\n-\t\t\tgoto err_out;\n-\n-\t\tring->q_index = i;\n-\t\tring->reg_idx = vsi->txq_map[i];\n-\t\tring->ring_active = false;\n-\t\tring->vsi = vsi;\n-\t\tring->netdev = vsi->netdev;\n-\t\tring->dev = &pf->pdev->dev;\n-\t\tring->count = vsi->num_desc;\n-\n-\t\tvsi->tx_rings[i] = ring;\n-\t}\n-\n-\t/* Allocate rx_rings */\n-\tfor (i = 0; i < vsi->alloc_rxq; i++) {\n-\t\tstruct ice_ring *ring;\n-\n-\t\t/* allocate with kzalloc(), free with kfree_rcu() */\n-\t\tring = kzalloc(sizeof(*ring), GFP_KERNEL);\n-\t\tif (!ring)\n-\t\t\tgoto err_out;\n-\n-\t\tring->q_index = i;\n-\t\tring->reg_idx = vsi->rxq_map[i];\n-\t\tring->ring_active = false;\n-\t\tring->vsi = vsi;\n-\t\tring->netdev = vsi->netdev;\n-\t\tring->dev = &pf->pdev->dev;\n-\t\tring->count = vsi->num_desc;\n-\t\tvsi->rx_rings[i] = ring;\n-\t}\n-\n-\treturn 0;\n-\n-err_out:\n-\tice_vsi_clear_rings(vsi);\n-\treturn -ENOMEM;\n-}\n-\n /**\n * ice_ena_misc_vector - enable the non-queue interrupts\n * @pf: board private structure\n@@ -1716,73 +1367,6 @@ static void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)\n \t}\n }\n \n-/**\n- * ice_vsi_set_num_qs - Set num queues, descriptors and vectors for a VSI\n- * @vsi: the VSI being configured\n- *\n- * Return 0 on success and a negative value on error\n- */\n-static void ice_vsi_set_num_qs(struct ice_vsi *vsi)\n-{\n-\tstruct ice_pf *pf = vsi->back;\n-\n-\tswitch (vsi->type) {\n-\tcase ICE_VSI_PF:\n-\t\tvsi->alloc_txq = pf->num_lan_tx;\n-\t\tvsi->alloc_rxq = pf->num_lan_rx;\n-\t\tvsi->num_desc = ALIGN(ICE_DFLT_NUM_DESC, ICE_REQ_DESC_MULTIPLE);\n-\t\tvsi->num_q_vectors = max_t(int, pf->num_lan_rx, pf->num_lan_tx);\n-\t\tbreak;\n-\tdefault:\n-\t\tdev_warn(&vsi->back->pdev->dev, \"Unknown VSI type %d\\n\",\n-\t\t\t vsi->type);\n-\t\tbreak;\n-\t}\n-}\n-\n-/**\n- * ice_vsi_alloc_arrays - Allocate queue and vector pointer arrays for the vsi\n- * @vsi: VSI pointer\n- * @alloc_qvectors: a bool to specify if q_vectors need to be allocated.\n- *\n- * On error: returns error code (negative)\n- * On success: returns 0\n- */\n-static int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors)\n-{\n-\tstruct ice_pf *pf = vsi->back;\n-\n-\t/* allocate memory for both Tx and Rx ring pointers */\n-\tvsi->tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,\n-\t\t\t\t sizeof(struct ice_ring *), GFP_KERNEL);\n-\tif (!vsi->tx_rings)\n-\t\tgoto err_txrings;\n-\n-\tvsi->rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,\n-\t\t\t\t sizeof(struct ice_ring *), GFP_KERNEL);\n-\tif (!vsi->rx_rings)\n-\t\tgoto err_rxrings;\n-\n-\tif (alloc_qvectors) {\n-\t\t/* allocate memory for q_vector pointers */\n-\t\tvsi->q_vectors = devm_kcalloc(&pf->pdev->dev,\n-\t\t\t\t\t vsi->num_q_vectors,\n-\t\t\t\t\t sizeof(struct ice_q_vector *),\n-\t\t\t\t\t GFP_KERNEL);\n-\t\tif (!vsi->q_vectors)\n-\t\t\tgoto err_vectors;\n-\t}\n-\n-\treturn 0;\n-\n-err_vectors:\n-\tdevm_kfree(&pf->pdev->dev, vsi->rx_rings);\n-err_rxrings:\n-\tdevm_kfree(&pf->pdev->dev, vsi->tx_rings);\n-err_txrings:\n-\treturn -ENOMEM;\n-}\n-\n /**\n * ice_vsi_alloc - Allocates the next available struct vsi in the PF\n * @pf: board private structure\n", "prefixes": [ "04/16" ] }