Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1190604/?format=api
{ "id": 1190604, "url": "http://patchwork.ozlabs.org/api/patches/1190604/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191106100541.48639-1-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": "<20191106100541.48639-1-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2019-11-06T10:05:27", "name": "[S32,v3,01/15] ice: Use ice_ena_vsi and ice_dis_vsi in DCB configuration flow", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "bdc33fd061b947047b1d2b4f46ac7f9d2bd6e0e5", "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/20191106100541.48639-1-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 141151, "url": "http://patchwork.ozlabs.org/api/series/141151/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=141151", "date": "2019-11-06T10:05:27", "name": "[S32,v3,01/15] ice: Use ice_ena_vsi and ice_dis_vsi in DCB configuration flow", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/141151/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1190604/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1190604/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 477Zxb5vTdz9sP3\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 7 Nov 2019 05:36:35 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9F7D689F76;\n\tWed, 6 Nov 2019 18:36:33 +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 oVlXxi6PjM2N; Wed, 6 Nov 2019 18:36:30 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4C24589F73;\n\tWed, 6 Nov 2019 18:36:30 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id D9DCA1BF3FB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 6 Nov 2019 18:36:29 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D185B8A86E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 6 Nov 2019 18:36:29 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 8D66ESkSgGVH for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 6 Nov 2019 18:36:28 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 8B5198A6E8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 6 Nov 2019 18:36:28 +0000 (UTC)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t06 Nov 2019 10:36:27 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby orsmga006.jf.intel.com with ESMTP; 06 Nov 2019 10:36:27 -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,275,1569308400\"; d=\"scan'208\";a=\"205918149\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 6 Nov 2019 02:05:27 -0800", "Message-Id": "<20191106100541.48639-1-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S32 v3 01/15] ice: Use ice_ena_vsi and\n\tice_dis_vsi in DCB configuration flow", "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: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n\nDCB configuration flow needs to disable and enable only the PF (main)\nVSI, so use ice_ena_vsi and ice_dis_vsi. To avoid the use of ifdef to\ncontrol the staticness of these functions, move them to ice_lib.c.\n\nAlso replace the allocate and copy of old_cfg to kmemdup() in\nice_pf_dcb_cfg().\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\nv3:\n- Use kmemdup instead of kzalloc + memcpy\nv2:\n- Add null check after allocation of old_cfg\n---\n drivers/net/ethernet/intel/ice/ice.h | 4 -\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 31 ++++++--\n drivers/net/ethernet/intel/ice/ice_lib.c | 56 ++++++++++++++\n drivers/net/ethernet/intel/ice/ice_lib.h | 4 +\n drivers/net/ethernet/intel/ice/ice_main.c | 79 --------------------\n 5 files changed, 84 insertions(+), 90 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 7d10b8dc2815..53a4870dd271 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -505,10 +505,6 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);\n int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);\n void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size);\n void ice_print_link_msg(struct ice_vsi *vsi, bool isup);\n-#ifdef CONFIG_DCB\n-int ice_pf_ena_all_vsi(struct ice_pf *pf, bool locked);\n-void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked);\n-#endif /* CONFIG_DCB */\n int ice_open(struct net_device *netdev);\n int ice_stop(struct net_device *netdev);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 13da89e22123..baea28c712ee 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -150,6 +150,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n {\n \tstruct ice_dcbx_cfg *old_cfg, *curr_cfg;\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n+\tstruct ice_vsi *pf_vsi;\n \tint ret = 0;\n \n \tcurr_cfg = &pf->hw.port_info->local_dcbx_cfg;\n@@ -169,15 +170,23 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \t}\n \n \t/* Store old config in case FW config fails */\n-\told_cfg = devm_kzalloc(&pf->pdev->dev, sizeof(*old_cfg), GFP_KERNEL);\n-\tmemcpy(old_cfg, curr_cfg, sizeof(*old_cfg));\n+\told_cfg = kmemdup(curr_cfg, sizeof(*old_cfg), GFP_KERNEL);\n+\tif (!old_cfg)\n+\t\treturn -ENOMEM;\n+\n+\tpf_vsi = ice_get_main_vsi(pf);\n+\tif (!pf_vsi) {\n+\t\tdev_dbg(&pf->pdev->dev, \"PF VSI doesn't exist\\n\");\n+\t\tret = -EINVAL;\n+\t\tgoto free_cfg;\n+\t}\n \n \t/* avoid race conditions by holding the lock while disabling and\n \t * re-enabling the VSI\n \t */\n \tif (!locked)\n \t\trtnl_lock();\n-\tice_pf_dis_all_vsi(pf, true);\n+\tice_dis_vsi(pf_vsi, true);\n \n \tmemcpy(curr_cfg, new_cfg, sizeof(*curr_cfg));\n \tmemcpy(&curr_cfg->etsrec, &curr_cfg->etscfg, sizeof(curr_cfg->etsrec));\n@@ -204,10 +213,11 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \tice_pf_dcb_recfg(pf);\n \n out:\n-\tice_pf_ena_all_vsi(pf, true);\n+\tice_ena_vsi(pf_vsi, true);\n \tif (!locked)\n \t\trtnl_unlock();\n-\tdevm_kfree(&pf->pdev->dev, old_cfg);\n+free_cfg:\n+\tkfree(old_cfg);\n \treturn ret;\n }\n \n@@ -690,6 +700,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \tstruct ice_dcbx_cfg tmp_dcbx_cfg;\n \tbool need_reconfig = false;\n \tstruct ice_port_info *pi;\n+\tstruct ice_vsi *pf_vsi;\n \tu8 type;\n \tint ret;\n \n@@ -761,8 +772,14 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t\tclear_bit(ICE_FLAG_DCB_ENA, pf->flags);\n \t}\n \n+\tpf_vsi = ice_get_main_vsi(pf);\n+\tif (!pf_vsi) {\n+\t\tdev_dbg(&pf->pdev->dev, \"PF VSI doesn't exist\\n\");\n+\t\treturn;\n+\t}\n+\n \trtnl_lock();\n-\tice_pf_dis_all_vsi(pf, true);\n+\tice_dis_vsi(pf_vsi, true);\n \n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n@@ -774,6 +791,6 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t/* changes in configuration update VSI */\n \tice_pf_dcb_recfg(pf);\n \n-\tice_pf_ena_all_vsi(pf, true);\n+\tice_ena_vsi(pf_vsi, true);\n \trtnl_unlock();\n }\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 161a2d24ffbd..8dd7f3848c59 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2040,6 +2040,62 @@ void ice_vsi_close(struct ice_vsi *vsi)\n \tice_vsi_free_rx_rings(vsi);\n }\n \n+/**\n+ * ice_ena_vsi - resume a VSI\n+ * @vsi: the VSI being resume\n+ * @locked: is the rtnl_lock already held\n+ */\n+int ice_ena_vsi(struct ice_vsi *vsi, bool locked)\n+{\n+\tint err = 0;\n+\n+\tif (!test_bit(__ICE_NEEDS_RESTART, vsi->state))\n+\t\treturn 0;\n+\n+\tclear_bit(__ICE_NEEDS_RESTART, vsi->state);\n+\n+\tif (vsi->netdev && vsi->type == ICE_VSI_PF) {\n+\t\tif (netif_running(vsi->netdev)) {\n+\t\t\tif (!locked)\n+\t\t\t\trtnl_lock();\n+\n+\t\t\terr = ice_open(vsi->netdev);\n+\n+\t\t\tif (!locked)\n+\t\t\t\trtnl_unlock();\n+\t\t}\n+\t}\n+\n+\treturn err;\n+}\n+\n+/**\n+ * ice_dis_vsi - pause a VSI\n+ * @vsi: the VSI being paused\n+ * @locked: is the rtnl_lock already held\n+ */\n+void ice_dis_vsi(struct ice_vsi *vsi, bool locked)\n+{\n+\tif (test_bit(__ICE_DOWN, vsi->state))\n+\t\treturn;\n+\n+\tset_bit(__ICE_NEEDS_RESTART, vsi->state);\n+\n+\tif (vsi->type == ICE_VSI_PF && vsi->netdev) {\n+\t\tif (netif_running(vsi->netdev)) {\n+\t\t\tif (!locked)\n+\t\t\t\trtnl_lock();\n+\n+\t\t\tice_stop(vsi->netdev);\n+\n+\t\t\tif (!locked)\n+\t\t\t\trtnl_unlock();\n+\t\t} else {\n+\t\t\tice_vsi_close(vsi);\n+\t\t}\n+\t}\n+}\n+\n /**\n * ice_free_res - free a block of resources\n * @res: pointer to the resource\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex d8cc03197878..1ec2ad98ac46 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -62,6 +62,10 @@ int ice_vsi_release(struct ice_vsi *vsi);\n \n void ice_vsi_close(struct ice_vsi *vsi);\n \n+int ice_ena_vsi(struct ice_vsi *vsi, bool locked);\n+\n+void ice_dis_vsi(struct ice_vsi *vsi, bool locked);\n+\n int ice_free_res(struct ice_res_tracker *res, u16 index, u16 id);\n \n int\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 985abd8f5589..dd05505ccbe1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -436,43 +436,12 @@ static void ice_sync_fltr_subtask(struct ice_pf *pf)\n \t\t}\n }\n \n-/**\n- * ice_dis_vsi - pause a VSI\n- * @vsi: the VSI being paused\n- * @locked: is the rtnl_lock already held\n- */\n-static void ice_dis_vsi(struct ice_vsi *vsi, bool locked)\n-{\n-\tif (test_bit(__ICE_DOWN, vsi->state))\n-\t\treturn;\n-\n-\tset_bit(__ICE_NEEDS_RESTART, vsi->state);\n-\n-\tif (vsi->type == ICE_VSI_PF && vsi->netdev) {\n-\t\tif (netif_running(vsi->netdev)) {\n-\t\t\tif (!locked)\n-\t\t\t\trtnl_lock();\n-\n-\t\t\tice_stop(vsi->netdev);\n-\n-\t\t\tif (!locked)\n-\t\t\t\trtnl_unlock();\n-\t\t} else {\n-\t\t\tice_vsi_close(vsi);\n-\t\t}\n-\t}\n-}\n-\n /**\n * ice_pf_dis_all_vsi - Pause all VSIs on a PF\n * @pf: the PF\n * @locked: is the rtnl_lock already held\n */\n-#ifdef CONFIG_DCB\n-void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked)\n-#else\n static void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked)\n-#endif /* CONFIG_DCB */\n {\n \tint v;\n \n@@ -4588,54 +4557,6 @@ static void ice_vsi_release_all(struct ice_pf *pf)\n \t}\n }\n \n-/**\n- * ice_ena_vsi - resume a VSI\n- * @vsi: the VSI being resume\n- * @locked: is the rtnl_lock already held\n- */\n-static int ice_ena_vsi(struct ice_vsi *vsi, bool locked)\n-{\n-\tint err = 0;\n-\n-\tif (!test_bit(__ICE_NEEDS_RESTART, vsi->state))\n-\t\treturn 0;\n-\n-\tclear_bit(__ICE_NEEDS_RESTART, vsi->state);\n-\n-\tif (vsi->netdev && vsi->type == ICE_VSI_PF) {\n-\t\tif (netif_running(vsi->netdev)) {\n-\t\t\tif (!locked)\n-\t\t\t\trtnl_lock();\n-\n-\t\t\terr = ice_open(vsi->netdev);\n-\n-\t\t\tif (!locked)\n-\t\t\t\trtnl_unlock();\n-\t\t}\n-\t}\n-\n-\treturn err;\n-}\n-\n-/**\n- * ice_pf_ena_all_vsi - Resume all VSIs on a PF\n- * @pf: the PF\n- * @locked: is the rtnl_lock already held\n- */\n-#ifdef CONFIG_DCB\n-int ice_pf_ena_all_vsi(struct ice_pf *pf, bool locked)\n-{\n-\tint v;\n-\n-\tice_for_each_vsi(pf, v)\n-\t\tif (pf->vsi[v])\n-\t\t\tif (ice_ena_vsi(pf->vsi[v], locked))\n-\t\t\t\treturn -EIO;\n-\n-\treturn 0;\n-}\n-#endif /* CONFIG_DCB */\n-\n /**\n * ice_vsi_rebuild_by_type - Rebuild VSI of a given type\n * @pf: pointer to the PF instance\n", "prefixes": [ "S32", "v3", "01/15" ] }