Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1208821/?format=api
{ "id": 1208821, "url": "http://patchwork.ozlabs.org/api/patches/1208821/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191212111307.33566-6-anthony.l.nguyen@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": "<20191212111307.33566-6-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2019-12-12T11:12:58", "name": "[S35,06/15] ice: Restore interrupt throttle settings after VSI rebuild", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "98a7abc88239a00cb7c4f8d2e27bd73d58821bcf", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@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/20191212111307.33566-6-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 148167, "url": "http://patchwork.ozlabs.org/api/series/148167/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=148167", "date": "2019-12-12T11:13:03", "name": "[S35,01/15] ice: Support UDP segmentation offload", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/148167/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1208821/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1208821/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.138;\n\thelo=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 47Yklc0J5Zz9sPc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 13 Dec 2019 06:44:43 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8491C881A5;\n\tThu, 12 Dec 2019 19:44:41 +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 Jo5CsDTeAV-K; Thu, 12 Dec 2019 19:44:40 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 41C0A881A6;\n\tThu, 12 Dec 2019 19:44:40 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9AFC31BF9BA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Dec 2019 19:44:37 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9029286FAF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Dec 2019 19:44:37 +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 UaHjjm4JvWMG for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Dec 2019 19:44:36 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id BDF0286F86\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Dec 2019 19:44:36 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Dec 2019 11:44:36 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby orsmga001.jf.intel.com with ESMTP; 12 Dec 2019 11:44:34 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.69,306,1571727600\"; d=\"scan'208\";a=\"296698853\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 12 Dec 2019 03:12:58 -0800", "Message-Id": "<20191212111307.33566-6-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20191212111307.33566-1-anthony.l.nguyen@intel.com>", "References": "<20191212111307.33566-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S35 06/15] ice: Restore interrupt throttle\n\tsettings after VSI rebuild", "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>", "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": "From: Michal Swiatkowski <michal.swiatkowski@intel.com>\n\nAfter each rebuild driver deallocates q_vectors, so the interrupt\nthrottle rate (ITR) settings get lost.\n\nCreate a function to save and restore ITR for each queue. If a user\nincreases the number of queues, restore all the previous queue\nsettings for each existing queue, and the additional queues will\nget the default setting.\n\nSigned-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 102 ++++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_txrx.h | 6 ++\n 2 files changed, 108 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 0581df95f3a1..1f47c39f4e86 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2453,6 +2453,97 @@ int ice_vsi_release(struct ice_vsi *vsi)\n \treturn 0;\n }\n \n+/**\n+ * ice_vsi_rebuild_update_coalesce - set coalesce for a q_vector\n+ * @q_vector: pointer to q_vector which is being updated\n+ * @coalesce: pointer to array of struct with stored coalesce\n+ *\n+ * Set coalesce param in q_vector and update these parameters in HW.\n+ */\n+static void\n+ice_vsi_rebuild_update_coalesce(struct ice_q_vector *q_vector,\n+\t\t\t\tstruct ice_coalesce_stored *coalesce)\n+{\n+\tstruct ice_ring_container *rx_rc = &q_vector->rx;\n+\tstruct ice_ring_container *tx_rc = &q_vector->tx;\n+\tstruct ice_hw *hw = &q_vector->vsi->back->hw;\n+\n+\ttx_rc->itr_setting = coalesce->itr_tx;\n+\trx_rc->itr_setting = coalesce->itr_rx;\n+\n+\t/* dynamic ITR values will be updated during Tx/Rx */\n+\tif (!ITR_IS_DYNAMIC(tx_rc->itr_setting))\n+\t\twr32(hw, GLINT_ITR(tx_rc->itr_idx, q_vector->reg_idx),\n+\t\t ITR_REG_ALIGN(tx_rc->itr_setting) >>\n+\t\t ICE_ITR_GRAN_S);\n+\tif (!ITR_IS_DYNAMIC(rx_rc->itr_setting))\n+\t\twr32(hw, GLINT_ITR(rx_rc->itr_idx, q_vector->reg_idx),\n+\t\t ITR_REG_ALIGN(rx_rc->itr_setting) >>\n+\t\t ICE_ITR_GRAN_S);\n+\n+\tq_vector->intrl = coalesce->intrl;\n+\twr32(hw, GLINT_RATE(q_vector->reg_idx),\n+\t ice_intrl_usec_to_reg(q_vector->intrl, hw->intrl_gran));\n+}\n+\n+/**\n+ * ice_vsi_rebuild_get_coalesce - get coalesce from all q_vectors\n+ * @vsi: VSI connected with q_vectors\n+ * @coalesce: array of struct with stored coalesce\n+ *\n+ * Returns array size.\n+ */\n+static int\n+ice_vsi_rebuild_get_coalesce(struct ice_vsi *vsi,\n+\t\t\t struct ice_coalesce_stored *coalesce)\n+{\n+\tint i;\n+\n+\tice_for_each_q_vector(vsi, i) {\n+\t\tstruct ice_q_vector *q_vector = vsi->q_vectors[i];\n+\n+\t\tcoalesce[i].itr_tx = q_vector->tx.itr_setting;\n+\t\tcoalesce[i].itr_rx = q_vector->rx.itr_setting;\n+\t\tcoalesce[i].intrl = q_vector->intrl;\n+\t}\n+\n+\treturn vsi->num_q_vectors;\n+}\n+\n+/**\n+ * ice_vsi_rebuild_set_coalesce - set coalesce from earlier saved arrays\n+ * @vsi: VSI connected with q_vectors\n+ * @coalesce: pointer to array of struct with stored coalesce\n+ * @size: size of coalesce array\n+ *\n+ * Before this function, ice_vsi_rebuild_get_coalesce should be called to save\n+ * ITR params in arrays. If size is 0 or coalesce wasn't stored set coalesce\n+ * to default value.\n+ */\n+static void\n+ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,\n+\t\t\t struct ice_coalesce_stored *coalesce, int size)\n+{\n+\tint i;\n+\n+\tif ((size && !coalesce) || !vsi)\n+\t\treturn;\n+\n+\tfor (i = 0; i < size && i < vsi->num_q_vectors; i++)\n+\t\tice_vsi_rebuild_update_coalesce(vsi->q_vectors[i],\n+\t\t\t\t\t\t&coalesce[i]);\n+\n+\tfor (; i < vsi->num_q_vectors; i++) {\n+\t\tstruct ice_coalesce_stored coalesce_dflt = {\n+\t\t\t.itr_tx = ICE_DFLT_TX_ITR,\n+\t\t\t.itr_rx = ICE_DFLT_RX_ITR,\n+\t\t\t.intrl = 0\n+\t\t};\n+\t\tice_vsi_rebuild_update_coalesce(vsi->q_vectors[i],\n+\t\t\t\t\t\t&coalesce_dflt);\n+\t}\n+}\n+\n /**\n * ice_vsi_rebuild - Rebuild VSI after reset\n * @vsi: VSI to be rebuild\n@@ -2463,6 +2554,8 @@ int ice_vsi_release(struct ice_vsi *vsi)\n int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n {\n \tu16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };\n+\tstruct ice_coalesce_stored *coalesce;\n+\tint prev_num_q_vectors = 0;\n \tstruct ice_vf *vf = NULL;\n \tenum ice_status status;\n \tstruct ice_pf *pf;\n@@ -2475,6 +2568,11 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n \tif (vsi->type == ICE_VSI_VF)\n \t\tvf = &pf->vf[vsi->vf_id];\n \n+\tcoalesce = kcalloc(vsi->num_q_vectors,\n+\t\t\t sizeof(struct ice_coalesce_stored), GFP_KERNEL);\n+\tif (coalesce)\n+\t\tprev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi,\n+\t\t\t\t\t\t\t\t coalesce);\n \tice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);\n \tice_vsi_free_q_vectors(vsi);\n \n@@ -2587,6 +2685,9 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n \t\t\treturn ice_schedule_reset(pf, ICE_RESET_PFR);\n \t\t}\n \t}\n+\tice_vsi_rebuild_set_coalesce(vsi, coalesce, prev_num_q_vectors);\n+\tkfree(coalesce);\n+\n \treturn 0;\n \n err_vectors:\n@@ -2601,6 +2702,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n err_vsi:\n \tice_vsi_clear(vsi);\n \tset_bit(__ICE_RESET_FAILED, pf->state);\n+\tkfree(coalesce);\n \treturn ret;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx.h b/drivers/net/ethernet/intel/ice/ice_txrx.h\nindex a84cc0e6dd27..a86270696df1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.h\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.h\n@@ -341,6 +341,12 @@ struct ice_ring_container {\n \tu16 itr_setting;\n };\n \n+struct ice_coalesce_stored {\n+\tu16 itr_tx;\n+\tu16 itr_rx;\n+\tu8 intrl;\n+};\n+\n /* iterator for handling rings in ring container */\n #define ice_for_each_ring(pos, head) \\\n \tfor (pos = (head).ring; pos; pos = pos->next)\n", "prefixes": [ "S35", "06/15" ] }