Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1227519/?format=api
{ "id": 1227519, "url": "http://patchwork.ozlabs.org/api/patches/1227519/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200122152138.41585-9-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": "<20200122152138.41585-9-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-01-22T15:21:32", "name": "[S38,09/15] ice: Fix and refactor Rx queue disable for VFs", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "06d0485957800312fdf2e0060ab85015095f774a", "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/20200122152138.41585-9-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 154777, "url": "http://patchwork.ozlabs.org/api/series/154777/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=154777", "date": "2020-01-22T15:21:26", "name": "[S38,01/15] ice: Add initial support for QinQ", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/154777/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1227519/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1227519/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.136;\n\thelo=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 4832MQ36gPz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 23 Jan 2020 10:54:58 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 09EDE20338;\n\tWed, 22 Jan 2020 23:54:57 +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 7emFmvXpJnxr; Wed, 22 Jan 2020 23:54:53 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0EDE320530;\n\tWed, 22 Jan 2020 23:54:53 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5D2361BF281\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:26 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 59F238636A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:26 +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 bkqEUD2hjQ6g for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:23 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 3551C8303A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:23 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Jan 2020 15:54:22 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga002.fm.intel.com with ESMTP; 22 Jan 2020 15:54:22 -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.70,351,1574150400\"; d=\"scan'208\";a=\"259651618\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 22 Jan 2020 07:21:32 -0800", "Message-Id": "<20200122152138.41585-9-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200122152138.41585-1-anthony.l.nguyen@intel.com>", "References": "<20200122152138.41585-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S38 09/15] ice: Fix and refactor Rx queue\n\tdisable for VFs", "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: Brett Creeley <brett.creeley@intel.com>\n\nCurrently when a VF driver sends the PF a request to disable Rx queues\nwe will disable them one at a time, even if the VF driver sent us a\nbatch of queues to disable. This is causing issues where the Rx queue\ndisable times out with LFC enabled. This can be improved by detecting\nwhen the VF is trying to disable all of its queues.\n\nAlso remove the variable num_qs_ena from the ice_vf structure as it was\nonly used to see if there were no Rx and no Tx queues active. Instead\nadd a function that checks if both the vf->rxq_ena and vf->txq_ena\nbitmaps are empty.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 36 ++++++++++++++-----\n .../net/ethernet/intel/ice/ice_virtchnl_pf.h | 1 -\n 2 files changed, 27 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 6f67a45a9026..5513ee42de3c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -90,6 +90,19 @@ ice_set_pfe_link(struct ice_vf *vf, struct virtchnl_pf_event *pfe,\n \t}\n }\n \n+/**\n+ * ice_vf_has_no_qs_ena - check if the VF has any Rx or Tx queues enabled\n+ * @vf: the VF to check\n+ *\n+ * Returns true if the VF has no Rx and no Tx queues enabled and returns false\n+ * otherwise\n+ */\n+static bool ice_vf_has_no_qs_ena(struct ice_vf *vf)\n+{\n+\treturn (!bitmap_weight(vf->rxq_ena, ICE_MAX_BASE_QS_PER_VF) &&\n+\t\t!bitmap_weight(vf->txq_ena, ICE_MAX_BASE_QS_PER_VF));\n+}\n+\n /**\n * ice_is_vf_link_up - check if the VF's link is up\n * @vf: VF to check if link is up\n@@ -101,7 +114,7 @@ static bool ice_is_vf_link_up(struct ice_vf *vf)\n \tif (ice_check_vf_init(pf, vf))\n \t\treturn false;\n \n-\tif (!vf->num_qs_ena)\n+\tif (ice_vf_has_no_qs_ena(vf))\n \t\treturn false;\n \telse if (vf->link_forced)\n \t\treturn vf->link_up;\n@@ -255,7 +268,6 @@ void ice_set_vf_state_qs_dis(struct ice_vf *vf)\n \t/* Clear Rx/Tx enabled queues flag */\n \tbitmap_zero(vf->txq_ena, ICE_MAX_BASE_QS_PER_VF);\n \tbitmap_zero(vf->rxq_ena, ICE_MAX_BASE_QS_PER_VF);\n-\tvf->num_qs_ena = 0;\n \tclear_bit(ICE_VF_STATE_QS_ENA, vf->vf_states);\n }\n \n@@ -2100,7 +2112,6 @@ static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t}\n \n \t\tset_bit(vf_q_id, vf->rxq_ena);\n-\t\tvf->num_qs_ena++;\n \t}\n \n \tvsi = pf->vsi[vf->lan_vsi_idx];\n@@ -2116,7 +2127,6 @@ static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t\tcontinue;\n \n \t\tset_bit(vf_q_id, vf->txq_ena);\n-\t\tvf->num_qs_ena++;\n \t}\n \n \t/* Set flag to indicate that queues are enabled */\n@@ -2203,13 +2213,22 @@ static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)\n \n \t\t\t/* Clear enabled queues flag */\n \t\t\tclear_bit(vf_q_id, vf->txq_ena);\n-\t\t\tvf->num_qs_ena--;\n \t\t}\n \t}\n \n-\tif (vqs->rx_queues) {\n-\t\tq_map = vqs->rx_queues;\n+\tq_map = vqs->rx_queues;\n+\t/* speed up Rx queue disable by batching them if possible */\n+\tif (q_map &&\n+\t bitmap_equal(&q_map, vf->rxq_ena, ICE_MAX_BASE_QS_PER_VF)) {\n+\t\tif (ice_vsi_stop_all_rx_rings(vsi)) {\n+\t\t\tdev_err(ice_pf_to_dev(vsi->back), \"Failed to stop all Rx rings on VSI %d\\n\",\n+\t\t\t\tvsi->vsi_num);\n+\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n \n+\t\tbitmap_zero(vf->rxq_ena, ICE_MAX_BASE_QS_PER_VF);\n+\t} else if (q_map) {\n \t\tfor_each_set_bit(vf_q_id, &q_map, ICE_MAX_BASE_QS_PER_VF) {\n \t\t\tif (!ice_vc_isvalid_q_id(vf, vqs->vsi_id, vf_q_id)) {\n \t\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -2230,12 +2249,11 @@ static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)\n \n \t\t\t/* Clear enabled queues flag */\n \t\t\tclear_bit(vf_q_id, vf->rxq_ena);\n-\t\t\tvf->num_qs_ena--;\n \t\t}\n \t}\n \n \t/* Clear enabled queues flag */\n-\tif (v_ret == VIRTCHNL_STATUS_SUCCESS && !vf->num_qs_ena)\n+\tif (v_ret == VIRTCHNL_STATUS_SUCCESS && ice_vf_has_no_qs_ena(vf))\n \t\tclear_bit(ICE_VF_STATE_QS_ENA, vf->vf_states);\n \n error_param:\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\nindex c65269c15dfc..474b2613f09c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n@@ -90,7 +90,6 @@ struct ice_vf {\n \tu8 num_req_qs;\t\t\t/* num of queue pairs requested by VF */\n \tu16 num_mac;\n \tu16 num_vf_qs;\t\t\t/* num of queue configured per VF */\n-\tu16 num_qs_ena;\t\t\t/* total num of Tx/Rx queue enabled */\n };\n \n #ifdef CONFIG_PCI_IOV\n", "prefixes": [ "S38", "09/15" ] }