Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1189097/?format=api
{ "id": 1189097, "url": "http://patchwork.ozlabs.org/api/patches/1189097/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191104093108.21542-7-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": "<20191104093108.21542-7-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2019-11-04T09:31:00", "name": "[S32,v2,07/15] ice: Check if VF is disabled for Opcode and other operations", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "7ab40dab89fd5b37cc783d9cff8ee9f17a8c05a0", "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/20191104093108.21542-7-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 140544, "url": "http://patchwork.ozlabs.org/api/series/140544/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=140544", "date": "2019-11-04T09:30:57", "name": "[S32,v2,01/15] ice: Use ice_ena_vsi and ice_dis_vsi in DCB configuration flow", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/140544/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1189097/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1189097/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 476LGD3F6Vz9sPf\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Nov 2019 05:01:40 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id CE36B2202E;\n\tMon, 4 Nov 2019 18:01:38 +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 nTRPewnlUy9e; Mon, 4 Nov 2019 18:01:34 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 185252155E;\n\tMon, 4 Nov 2019 18:01:34 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id E685C1BF388\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Nov 2019 18:01:28 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id E302920413\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Nov 2019 18:01:28 +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 J2RNY+CevANB for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Nov 2019 18:01:27 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 0742A20110\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Nov 2019 18:01:26 +0000 (UTC)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Nov 2019 10:01:26 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga008.fm.intel.com with ESMTP; 04 Nov 2019 10:01:26 -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.68,267,1569308400\"; d=\"scan'208\";a=\"200098404\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 4 Nov 2019 01:31:00 -0800", "Message-Id": "<20191104093108.21542-7-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20191104093108.21542-1-anthony.l.nguyen@intel.com>", "References": "<20191104093108.21542-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S32 v2 07/15] ice: Check if VF is disabled\n\tfor Opcode and other 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: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>\n\nThis patch adds code to check if PF or VF is disabled before honoring\nmailbox message to configure VF - If it is disabled, and opcode is for\nresetting VF, the PF driver simply tell VF that all is set. In addition,\nif reset is ongoing, and Admin intend to configure VF on the host, we can\npoll the VF enabling bit to make sure it is ready before continue - If\nafter ~250 milliseconds, VF is not in active state, we can bail out with\ninvalid error.\n\nSigned-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 74 ++++++++++++++++---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.h | 1 +\n 2 files changed, 63 insertions(+), 12 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 4a1cb51b50c7..537377448bef 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -1151,6 +1151,25 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)\n \treturn true;\n }\n \n+/**\n+ * ice_is_vf_disabled\n+ * @vf: pointer to the VF info\n+ *\n+ * Returns true if the PF or VF is disabled, false otherwise.\n+ */\n+static bool ice_is_vf_disabled(struct ice_vf *vf)\n+{\n+\tstruct ice_pf *pf = vf->pf;\n+\n+\t/* If the PF has been disabled, there is no need resetting VF until\n+\t * PF is active again. Similarly, if the VF has been disabled, this\n+\t * means something else is resetting the VF, so we shouldn't continue.\n+\t * Otherwise, set disable VF state bit for actual reset, and continue.\n+\t */\n+\treturn (test_bit(__ICE_VF_DIS, pf->state) ||\n+\t\ttest_bit(ICE_VF_STATE_DIS, vf->vf_states));\n+}\n+\n /**\n * ice_reset_vf - Reset a particular VF\n * @vf: pointer to the VF structure\n@@ -1168,19 +1187,15 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \tu32 reg;\n \tint i;\n \n-\t/* If the PF has been disabled, there is no need resetting VF until\n-\t * PF is active again.\n-\t */\n-\tif (test_bit(__ICE_VF_DIS, pf->state))\n-\t\treturn false;\n-\n-\t/* If the VF has been disabled, this means something else is\n-\t * resetting the VF, so we shouldn't continue. Otherwise, set\n-\t * disable VF state bit for actual reset, and continue.\n-\t */\n-\tif (test_and_set_bit(ICE_VF_STATE_DIS, vf->vf_states))\n-\t\treturn false;\n+\tif (ice_is_vf_disabled(vf)) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\\n\",\n+\t\t\t vf->vf_id);\n+\t\treturn true;\n+\t}\n \n+\t/* Set VF disable bit state here, before triggering reset */\n+\tset_bit(ICE_VF_STATE_DIS, vf->vf_states);\n \tice_trigger_vf_reset(vf, is_vflr, false);\n \n \tvsi = pf->vsi[vf->lan_vsi_idx];\n@@ -3128,6 +3143,23 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \treturn ret;\n }\n \n+/**\n+ * ice_wait_on_vf_reset\n+ * @vf: The VF being resseting\n+ *\n+ * Poll to make sure a given VF is ready after reset\n+ */\n+static void ice_wait_on_vf_reset(struct ice_vf *vf)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < ICE_MAX_VF_RESET_WAIT; i++) {\n+\t\tif (test_bit(ICE_VF_STATE_INIT, vf->vf_states))\n+\t\t\tbreak;\n+\t\tmsleep(20);\n+\t}\n+}\n+\n /**\n * ice_set_vf_mac\n * @netdev: network interface device structure\n@@ -3151,6 +3183,15 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n \t}\n \n \tvf = &pf->vf[vf_id];\n+\t/* Don't set MAC on disabled VF */\n+\tif (ice_is_vf_disabled(vf))\n+\t\treturn -EINVAL;\n+\n+\t/* In case VF is in reset mode, wait until it is completed. Depending\n+\t * on factors like queue disabling routine, this could take ~250ms\n+\t */\n+\tice_wait_on_vf_reset(vf);\n+\n \tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n \t\tnetdev_err(netdev, \"VF %d in reset. Try again.\\n\", vf_id);\n \t\treturn -EBUSY;\n@@ -3198,6 +3239,15 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \t}\n \n \tvf = &pf->vf[vf_id];\n+\t/* Don't set Trusted Mode on disabled VF */\n+\tif (ice_is_vf_disabled(vf))\n+\t\treturn -EINVAL;\n+\n+\t/* In case VF is in reset mode, wait until it is completed. Depending\n+\t * on factors like queue disabling routine, this could take ~250ms\n+\t */\n+\tice_wait_on_vf_reset(vf);\n+\n \tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n \t\tdev_err(&pf->pdev->dev, \"VF %d in reset. Try again.\\n\", vf_id);\n \t\treturn -EBUSY;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\nindex 0d9880c8bba3..2e867ad2e81d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n@@ -38,6 +38,7 @@\n #define ICE_MAX_POLICY_INTR_PER_VF\t33\n #define ICE_MIN_INTR_PER_VF\t\t(ICE_MIN_QS_PER_VF + 1)\n #define ICE_DFLT_INTR_PER_VF\t\t(ICE_DFLT_QS_PER_VF + 1)\n+#define ICE_MAX_VF_RESET_WAIT\t\t15\n \n /* Specific VF states */\n enum ice_vf_states {\n", "prefixes": [ "S32", "v2", "07/15" ] }