Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1227515/?format=api
{ "id": 1227515, "url": "http://patchwork.ozlabs.org/api/patches/1227515/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200122152138.41585-8-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-8-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-01-22T15:21:31", "name": "[S38,08/15] ice: Handle LAN overflow event for VF queues", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "f60ec1db40b948c7a2d1959d6d9c1eddb1b65ce9", "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-8-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/1227515/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1227515/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 4832Ly6R0Wz9sRX\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 23 Jan 2020 10:54:34 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4A02F20361;\n\tWed, 22 Jan 2020 23:54:33 +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 q4XcNle-O4jE; Wed, 22 Jan 2020 23:54:31 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1BC2D20338;\n\tWed, 22 Jan 2020 23:54:31 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 36FA11BF281\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:25 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 323278558D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 22 Jan 2020 23:54:25 +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 oAcWbnjluvan 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 178BD81EE9\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=\"259651617\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 22 Jan 2020 07:21:31 -0800", "Message-Id": "<20200122152138.41585-8-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 08/15] ice: Handle LAN overflow event\n\tfor VF queues", "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 we are not handling LAN overflow events. There can be cases\nwhere LAN overflow events occur on VF queues, especially with Link Flow\nControl (LFC) enabled on the controlling PF. In order to recover from\nthe LAN overflow event caused by a VF we need to determine if the queue\nbelongs to a VF and reset that VF accordingly.\n\nThe struct ice_aqc_event_lan_overflow returns a copy of the GLDCB_RTCTQ\nregister, which tells us what the queue index is in the global/device\nspace. The global queue index needs to first be converted to a PF space\nqueue index and then it can be used to find if a VF owns it.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n .../net/ethernet/intel/ice/ice_adminq_cmd.h | 11 ++++\n .../net/ethernet/intel/ice/ice_hw_autogen.h | 2 +\n drivers/net/ethernet/intel/ice/ice_main.c | 3 +\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 66 +++++++++++++++++++\n .../net/ethernet/intel/ice/ice_virtchnl_pf.h | 4 ++\n 5 files changed, 86 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex 210113eade20..801e4fd40b03 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -1692,6 +1692,13 @@ struct ice_aqc_get_pkg_info_resp {\n \tstruct ice_aqc_get_pkg_info pkg_info[1];\n };\n \n+/* Lan Queue Overflow Event (direct, 0x1001) */\n+struct ice_aqc_event_lan_overflow {\n+\t__le32 prtdcb_ruptq;\n+\t__le32 qtx_ctl;\n+\tu8 reserved[8];\n+};\n+\n /**\n * struct ice_aq_desc - Admin Queue (AQ) descriptor\n * @flags: ICE_AQ_FLAG_* flags\n@@ -1762,6 +1769,7 @@ struct ice_aq_desc {\n \t\tstruct ice_aqc_alloc_free_res_cmd sw_res_ctrl;\n \t\tstruct ice_aqc_set_event_mask set_event_mask;\n \t\tstruct ice_aqc_get_link_status get_link_status;\n+\t\tstruct ice_aqc_event_lan_overflow lan_overflow;\n \t} params;\n };\n \n@@ -1893,6 +1901,9 @@ enum ice_adminq_opc {\n \tice_aqc_opc_update_pkg\t\t\t\t= 0x0C42,\n \tice_aqc_opc_get_pkg_info_list\t\t\t= 0x0C43,\n \n+\t/* Standalone Commands/Events */\n+\tice_aqc_opc_event_lan_overflow\t\t\t= 0x1001,\n+\n \t/* debug commands */\n \tice_aqc_opc_fw_logging\t\t\t\t= 0xFF09,\n \tice_aqc_opc_fw_logging_info\t\t\t= 0xFF10,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\nindex 306b8943cfc0..d767c398ac71 100644\n--- a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\n+++ b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h\n@@ -287,6 +287,8 @@\n #define GL_PWR_MODE_CTL\t\t\t\t0x000B820C\n #define GL_PWR_MODE_CTL_CAR_MAX_BW_S\t\t30\n #define GL_PWR_MODE_CTL_CAR_MAX_BW_M\t\tICE_M(0x3, 30)\n+#define GLDCB_RTCTQ_RXQNUM_S\t\t\t0\n+#define GLDCB_RTCTQ_RXQNUM_M\t\t\tICE_M(0x7FF, 0)\n #define GLPRT_BPRCL(_i)\t\t\t\t(0x00381380 + ((_i) * 8))\n #define GLPRT_BPTCL(_i)\t\t\t\t(0x00381240 + ((_i) * 8))\n #define GLPRT_CRCERRS(_i)\t\t\t(0x00380100 + ((_i) * 8))\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 8816ac1ec573..4add2c3e830e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -1032,6 +1032,9 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t\tif (ice_handle_link_event(pf, &event))\n \t\t\t\tdev_err(dev, \"Could not handle link event\\n\");\n \t\t\tbreak;\n+\t\tcase ice_aqc_opc_event_lan_overflow:\n+\t\t\tice_vf_lan_overflow_event(pf, &event);\n+\t\t\tbreak;\n \t\tcase ice_mbx_opc_send_msg_to_pf:\n \t\t\tice_vc_process_vf_msg(pf, &event);\n \t\t\tbreak;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex cc5d9ed5e4ec..6f67a45a9026 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -1488,6 +1488,72 @@ static void ice_vc_reset_vf(struct ice_vf *vf)\n \tice_reset_vf(vf, false);\n }\n \n+/**\n+ * ice_get_vf_from_pfq - get the VF who owns the PF space queue passed in\n+ * @pf: PF used to index all VFs\n+ * @pfq: queue index relative to the PF's function space\n+ *\n+ * If no VF is found who owns the pfq then return NULL, otherwise return a\n+ * pointer to the VF who owns the pfq\n+ */\n+static struct ice_vf *ice_get_vf_from_pfq(struct ice_pf *pf, u16 pfq)\n+{\n+\tint vf_id;\n+\n+\tice_for_each_vf(pf, vf_id) {\n+\t\tstruct ice_vf *vf = &pf->vf[vf_id];\n+\t\tstruct ice_vsi *vsi;\n+\t\tu16 rxq_idx;\n+\n+\t\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\n+\t\tice_for_each_rxq(vsi, rxq_idx)\n+\t\t\tif (vsi->rxq_map[rxq_idx] == pfq)\n+\t\t\t\treturn vf;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n+/**\n+ * ice_globalq_to_pfq - convert from global queue index to PF space queue index\n+ * @pf: PF used for conversion\n+ * @globalq: global queue index used to convert to PF space queue index\n+ */\n+static u32 ice_globalq_to_pfq(struct ice_pf *pf, u32 globalq)\n+{\n+\treturn globalq - pf->hw.func_caps.common_cap.rxq_first_id;\n+}\n+\n+/**\n+ * ice_vf_lan_overflow_event - handle LAN overflow event for a VF\n+ * @pf: PF that the LAN overflow event happened on\n+ * @event: structure holding the event information for the LAN overflow event\n+ *\n+ * Determine if the LAN overflow event was caused by a VF queue. If it was not\n+ * caused by a VF, do nothing. If a VF caused this LAN overflow event trigger a\n+ * reset on the offending VF.\n+ */\n+void\n+ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event)\n+{\n+\tu32 gldcb_rtctq, queue;\n+\tstruct ice_vf *vf;\n+\n+\tgldcb_rtctq = le32_to_cpu(event->desc.params.lan_overflow.prtdcb_ruptq);\n+\tdev_dbg(ice_pf_to_dev(pf), \"GLDCB_RTCTQ: 0x%08x\\n\", gldcb_rtctq);\n+\n+\t/* event returns device global Rx queue number */\n+\tqueue = (gldcb_rtctq & GLDCB_RTCTQ_RXQNUM_M) >>\n+\t\tGLDCB_RTCTQ_RXQNUM_S;\n+\n+\tvf = ice_get_vf_from_pfq(pf, ice_globalq_to_pfq(pf, queue));\n+\tif (!vf)\n+\t\treturn;\n+\n+\tice_vc_reset_vf(vf);\n+}\n+\n /**\n * ice_vc_send_msg_to_vf - Send message to VF\n * @vf: pointer to the VF info\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\nindex a1bb196d417a..c65269c15dfc 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n@@ -122,6 +122,9 @@ void ice_set_vf_state_qs_dis(struct ice_vf *vf);\n int\n ice_get_vf_stats(struct net_device *netdev, int vf_id,\n \t\t struct ifla_vf_stats *vf_stats);\n+void\n+ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event);\n+\n #else /* CONFIG_PCI_IOV */\n #define ice_process_vflr_event(pf) do {} while (0)\n #define ice_free_vfs(pf) do {} while (0)\n@@ -129,6 +132,7 @@ ice_get_vf_stats(struct net_device *netdev, int vf_id,\n #define ice_vc_notify_link_state(pf) do {} while (0)\n #define ice_vc_notify_reset(pf) do {} while (0)\n #define ice_set_vf_state_qs_dis(vf) do {} while (0)\n+#define ice_vf_lan_overflow_event(pf, event) do {} while (0)\n \n static inline bool\n ice_reset_all_vfs(struct ice_pf __always_unused *pf,\n", "prefixes": [ "S38", "08/15" ] }