Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1226847/?format=api
{ "id": 1226847, "url": "http://patchwork.ozlabs.org/api/patches/1226847/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200121162021.17107-5-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": "<20200121162021.17107-5-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-01-21T16:20:20", "name": "[S34,v3,5/6] ice: Allow reset operations", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "b4a707943f4ae63587592c34fb78b151bc200cf1", "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/20200121162021.17107-5-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 154551, "url": "http://patchwork.ozlabs.org/api/series/154551/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=154551", "date": "2020-01-21T16:20:19", "name": "[S34,v3,1/6] ice: Create and register virtual bus for RDMA", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/154551/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1226847/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1226847/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 482Rj92GVKz9sRX\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 22 Jan 2020 11:53:16 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1799B86005;\n\tWed, 22 Jan 2020 00:53:14 +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 tfY4-bVzM-Ss; Wed, 22 Jan 2020 00:53:12 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 0853F86812;\n\tWed, 22 Jan 2020 00:53:12 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 405271BF475\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 00:53:10 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 38A8A86005\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 00:53:10 +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 fQaxFIfWRPnl for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 00:53:07 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 5FD4086841\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 00:53:07 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Jan 2020 16:53:05 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby FMSMGA003.fm.intel.com with ESMTP; 21 Jan 2020 16:53:05 -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,347,1574150400\"; d=\"scan'208\";a=\"275463004\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 21 Jan 2020 08:20:20 -0800", "Message-Id": "<20200121162021.17107-5-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200121162021.17107-1-anthony.l.nguyen@intel.com>", "References": "<20200121162021.17107-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S34 v3 5/6] ice: Allow reset operations", "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: Dave Ertman <david.m.ertman@intel.com>\n\nEnable the PF to notify peers when it's going to reset so that peer devices\ncan prepare accordingly. Also enable the peer devices to request the PF to\nreset.\n\nImplement ice_peer_is_vsi_ready() so the peer device can determine when the\nVSI is ready for operations following a reset.\n\nSigned-off-by: Dave Ertman <david.m.ertman@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_idc.c | 140 +++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_idc_int.h | 1 +\n drivers/net/ethernet/intel/ice/ice_lib.c | 6 +\n drivers/net/ethernet/intel/ice/ice_main.c | 3 +\n 4 files changed, 150 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c\nindex ff3dc452d7d7..6d625cc18a9d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_idc.c\n+++ b/drivers/net/ethernet/intel/ice/ice_idc.c\n@@ -217,6 +217,40 @@ int ice_peer_update_vsi(struct ice_peer_dev_int *peer_dev_int, void *data)\n \treturn 0;\n }\n \n+/**\n+ * ice_close_peer_for_reset - queue work to close peer for reset\n+ * @peer_dev_int: pointer peer dev internal struct\n+ * @data: pointer to opaque data used for reset type\n+ */\n+int ice_close_peer_for_reset(struct ice_peer_dev_int *peer_dev_int, void *data)\n+{\n+\tstruct iidc_peer_dev *peer_dev;\n+\tenum ice_reset_req reset;\n+\n+\tpeer_dev = &peer_dev_int->peer_dev;\n+\tif (!ice_validate_peer_dev(peer_dev))\n+\t\treturn 0;\n+\n+\treset = *(enum ice_reset_req *)data;\n+\n+\tswitch (reset) {\n+\tcase ICE_RESET_GLOBR:\n+\t\tpeer_dev_int->rst_type = IIDC_REASON_GLOBR_REQ;\n+\t\tbreak;\n+\tcase ICE_RESET_CORER:\n+\t\tpeer_dev_int->rst_type = IIDC_REASON_CORER_REQ;\n+\t\tbreak;\n+\tcase ICE_RESET_PFR:\n+\t\tpeer_dev_int->rst_type = IIDC_REASON_PFR_REQ;\n+\t\tbreak;\n+\tdefault:\n+\t\t/* reset type is invalid */\n+\t\treturn 1;\n+\t}\n+\tqueue_work(peer_dev_int->ice_peer_wq, &peer_dev_int->peer_close_task);\n+\treturn 0;\n+}\n+\n /**\n * ice_check_peer_drv_for_events - check peer_drv for events to report\n * @peer_dev: peer device to report to\n@@ -954,6 +988,74 @@ static int ice_peer_register(struct iidc_peer_dev *peer_dev)\n \treturn 0;\n }\n \n+/**\n+ * ice_peer_request_reset - accept request from peer to perform a reset\n+ * @peer_dev: peer device that is request a reset\n+ * @reset_type: type of reset the peer is requesting\n+ */\n+static int\n+ice_peer_request_reset(struct iidc_peer_dev *peer_dev,\n+\t\t enum iidc_peer_reset_type reset_type)\n+{\n+\tenum ice_reset_req reset;\n+\tstruct ice_pf *pf;\n+\n+\tif (!ice_validate_peer_dev(peer_dev))\n+\t\treturn -EINVAL;\n+\n+\tpf = pci_get_drvdata(peer_dev->pdev);\n+\n+\tswitch (reset_type) {\n+\tcase IIDC_PEER_PFR:\n+\t\treset = ICE_RESET_PFR;\n+\t\tbreak;\n+\tcase IIDC_PEER_CORER:\n+\t\treset = ICE_RESET_CORER;\n+\t\tbreak;\n+\tcase IIDC_PEER_GLOBR:\n+\t\treset = ICE_RESET_GLOBR;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_err(ice_pf_to_dev(pf), \"incorrect reset request from peer\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn ice_schedule_reset(pf, reset);\n+}\n+\n+/**\n+ * ice_peer_is_vsi_ready - query if VSI in nominal state\n+ * @peer_dev: pointer to iidc_peer_dev struct\n+ */\n+static int ice_peer_is_vsi_ready(struct iidc_peer_dev *peer_dev)\n+{\n+\tDECLARE_BITMAP(check_bits, __ICE_STATE_NBITS) = { 0 };\n+\tstruct ice_netdev_priv *np;\n+\tstruct ice_vsi *vsi;\n+\n+\t/* If the peer_dev or associated values are not valid, then return\n+\t * 0 as there is no ready port associated with the values passed in\n+\t * as parameters.\n+\t */\n+\n+\tif (!ice_validate_peer_dev(peer_dev))\n+\t\treturn 0;\n+\n+\tif (!peer_dev->netdev)\n+\t\treturn 0;\n+\n+\tnp = netdev_priv(peer_dev->netdev);\n+\tvsi = np->vsi;\n+\tif (!vsi)\n+\t\treturn 0;\n+\n+\tbitmap_set(check_bits, 0, __ICE_STATE_NOMINAL_CHECK_BITS);\n+\tif (bitmap_intersects(vsi->state, check_bits, __ICE_STATE_NBITS))\n+\t\treturn 0;\n+\n+\treturn 1;\n+}\n+\n /**\n * ice_peer_update_vsi_filter - update main VSI filters for RDMA\n * @peer_dev: pointer to RDMA peer device\n@@ -997,9 +1099,11 @@ ice_peer_update_vsi_filter(struct iidc_peer_dev *peer_dev,\n static const struct iidc_ops ops = {\n \t.alloc_res\t\t\t= ice_peer_alloc_res,\n \t.free_res\t\t\t= ice_peer_free_res,\n+\t.is_vsi_ready\t\t\t= ice_peer_is_vsi_ready,\n \t.reg_for_notification\t\t= ice_peer_reg_for_notif,\n \t.unreg_for_notification\t\t= ice_peer_unreg_for_notif,\n \t.notify_state_change\t\t= ice_peer_report_state_change,\n+\t.request_reset\t\t\t= ice_peer_request_reset,\n \t.peer_register\t\t\t= ice_peer_register,\n \t.peer_unregister\t\t= ice_peer_unregister,\n \t.update_vsi_filter\t\t= ice_peer_update_vsi_filter,\n@@ -1024,6 +1128,41 @@ static int ice_reserve_peer_qvector(struct ice_pf *pf)\n \treturn 0;\n }\n \n+/**\n+ * ice_peer_close_task - call peer's close asynchronously\n+ * @work: pointer to work_struct contained by the peer_dev_int struct\n+ *\n+ * This method (asynchronous) of calling a peer's close function is\n+ * meant to be used in the reset path.\n+ */\n+static void ice_peer_close_task(struct work_struct *work)\n+{\n+\tstruct ice_peer_dev_int *peer_dev_int;\n+\tstruct iidc_peer_dev *peer_dev;\n+\n+\tpeer_dev_int = container_of(work, struct ice_peer_dev_int,\n+\t\t\t\t peer_close_task);\n+\n+\tpeer_dev = &peer_dev_int->peer_dev;\n+\tif (!peer_dev || !peer_dev->peer_ops)\n+\t\treturn;\n+\n+\t/* If this peer_dev is going to close, we do not want any state changes\n+\t * to happen until after we successfully finish or abort the close.\n+\t * Grab the peer_dev_state_mutex to protect this flow\n+\t */\n+\tmutex_lock(&peer_dev_int->peer_dev_state_mutex);\n+\n+\tice_peer_state_change(peer_dev_int, ICE_PEER_DEV_STATE_CLOSING, true);\n+\n+\tif (peer_dev->peer_ops->close)\n+\t\tpeer_dev->peer_ops->close(peer_dev, peer_dev_int->rst_type);\n+\n+\tice_peer_state_change(peer_dev_int, ICE_PEER_DEV_STATE_CLOSED, true);\n+\n+\tmutex_unlock(&peer_dev_int->peer_dev_state_mutex);\n+}\n+\n /**\n * ice_peer_vdev_release - function to map to virtbus_devices release callback\n * @vdev: pointer to virtbus_device to free\n@@ -1120,6 +1259,7 @@ int ice_init_peer_devices(struct ice_pf *pf)\n \t\t\t\t\t\ti);\n \t\tif (!peer_dev_int->ice_peer_wq)\n \t\t\treturn -ENOMEM;\n+\t\tINIT_WORK(&peer_dev_int->peer_close_task, ice_peer_close_task);\n \n \t\tpeer_dev->pdev = pdev;\n \t\tqos_info = &peer_dev->initial_qos_info;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_idc_int.h b/drivers/net/ethernet/intel/ice/ice_idc_int.h\nindex 1d3d5cafc977..90e165434aea 100644\n--- a/drivers/net/ethernet/intel/ice/ice_idc_int.h\n+++ b/drivers/net/ethernet/intel/ice/ice_idc_int.h\n@@ -63,6 +63,7 @@ struct ice_peer_dev_int {\n };\n \n int ice_peer_update_vsi(struct ice_peer_dev_int *peer_dev_int, void *data);\n+int ice_close_peer_for_reset(struct ice_peer_dev_int *peer_dev_int, void *data);\n int ice_unroll_peer(struct ice_peer_dev_int *peer_dev_int, void *data);\n int ice_unreg_peer_device(struct ice_peer_dev_int *peer_dev_int, void *data);\n int ice_peer_close(struct ice_peer_dev_int *peer_dev_int, void *data);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex b2c2f7e05393..75159b658098 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2277,6 +2277,12 @@ void ice_vsi_close(struct ice_vsi *vsi)\n {\n \tenum iidc_close_reason reason = IIDC_REASON_INTERFACE_DOWN;\n \n+\tif (test_bit(__ICE_CORER_REQ, vsi->back->state))\n+\t\treason = IIDC_REASON_CORER_REQ;\n+\tif (test_bit(__ICE_GLOBR_REQ, vsi->back->state))\n+\t\treason = IIDC_REASON_GLOBR_REQ;\n+\tif (test_bit(__ICE_PFR_REQ, vsi->back->state))\n+\t\treason = IIDC_REASON_PFR_REQ;\n \tif (!ice_is_safe_mode(vsi->back) && vsi->type == ICE_VSI_PF) {\n \t\tint ret = ice_for_each_peer(vsi->back, &reason, ice_peer_close);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex b085a3e66b4f..6ce422789df7 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -562,6 +562,9 @@ static void ice_reset_subtask(struct ice_pf *pf)\n \t\t/* return if no valid reset type requested */\n \t\tif (reset_type == ICE_RESET_INVAL)\n \t\t\treturn;\n+\t\tif (ice_is_peer_ena(pf))\n+\t\t\tice_for_each_peer(pf, &reset_type,\n+\t\t\t\t\t ice_close_peer_for_reset);\n \t\tice_prepare_for_reset(pf);\n \n \t\t/* make sure we are ready to rebuild */\n", "prefixes": [ "S34", "v3", "5/6" ] }