Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1264473/?format=api
{ "id": 1264473, "url": "http://patchwork.ozlabs.org/api/patches/1264473/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200331011053.339291-5-jeffrey.t.kirsher@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": "<20200331011053.339291-5-jeffrey.t.kirsher@intel.com>", "list_archive_url": null, "date": "2020-03-31T01:10:52", "name": "[next-queue,v5,5/6] ice: Allow reset operations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a8c3f25ae1825a1d884c6f7f8d64a6d8ba7c7f35", "submitter": { "id": 473, "url": "http://patchwork.ozlabs.org/api/people/473/?format=api", "name": "Kirsher, Jeffrey T", "email": "jeffrey.t.kirsher@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/20200331011053.339291-5-jeffrey.t.kirsher@intel.com/mbox/", "series": [ { "id": 167727, "url": "http://patchwork.ozlabs.org/api/series/167727/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=167727", "date": "2020-03-31T01:10:53", "name": "[next-queue,v5,1/6] ice: Create and register virtual bus for RDMA", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/167727/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1264473/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1264473/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 48rrqz2ySQz9sSL\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 31 Mar 2020 12:11:11 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C49FA23B81;\n\tTue, 31 Mar 2020 01:11:09 +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 1pmE1-YNhJYb; Tue, 31 Mar 2020 01:11:06 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id D1EA323C58;\n\tTue, 31 Mar 2020 01:11:06 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id C27451BF388\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Mar 2020 01:11:02 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id BF5428610E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Mar 2020 01:11:02 +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 3UBXG1dCoJB3 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Mar 2020 01:11:00 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 3E4C4861A1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 31 Mar 2020 01:11:00 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t30 Mar 2020 18:10:59 -0700", "from jtkirshe-desk1.jf.intel.com ([134.134.177.86])\n\tby orsmga001.jf.intel.com with ESMTP; 30 Mar 2020 18:10:58 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "fmYevdupckRrocgLs9BoCBoQhiOL0quIDRmK80lkl6uC6ThJUYo0W3ujiiKcyDN5dwNGLQhoq6\n\tpiauaRcB22uQ==", "LzrBPG3pcA9jNZi17wqcN3Xb0boKzjA2JzVO8/0Tj12G5Cn4rWvKUQcPdopi9OLeHZzdbuTvkF\n\t8+P84kmr5EAQ==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.72,326,1580803200\"; d=\"scan'208\";a=\"327925973\"", "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 30 Mar 2020 18:10:52 -0700", "Message-Id": "<20200331011053.339291-5-jeffrey.t.kirsher@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200331011053.339291-1-jeffrey.t.kirsher@intel.com>", "References": "<20200331011053.339291-1-jeffrey.t.kirsher@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next-queue v5 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>\nTested-by: Andrew Bowers <andrewx.bowers@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 9995112e0bda..5e1877772245 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@@ -929,6 +963,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@@ -972,9 +1074,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@@ -999,6 +1103,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@@ -1097,6 +1236,7 @@ int ice_init_peer_devices(struct ice_pf *pf)\n \t\t\tkfree(vbo);\n \t\t\treturn -ENOMEM;\n \t\t}\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 5043d5ed1b2a..34b41b1039f1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2416,6 +2416,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 6473804dcb76..1d425c78a3e8 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -559,6 +559,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": [ "next-queue", "v5", "5/6" ] }