Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1086462/?format=api
{ "id": 1086462, "url": "http://patchwork.ozlabs.org/api/patches/1086462/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416172439.27908-8-anirudh.venkataramanan@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": "<20190416172439.27908-8-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-04-16T17:24:31", "name": "[S19,07/15] ice: Refactor the LLDP MIB change event handling", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "47e3ef9c98833a158ea41ab0c7d78e135a8140be", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20190416172439.27908-8-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 103107, "url": "http://patchwork.ozlabs.org/api/series/103107/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103107", "date": "2019-04-16T17:24:38", "name": "Fixes and feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/103107/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1086462/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1086462/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;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 44kC1Y0y0cz9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:25:21 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id BBF1B87A43;\n\tTue, 16 Apr 2019 17:25:19 +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 S6U-7uZsrfgq; Tue, 16 Apr 2019 17:25:19 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2780A87A1D;\n\tTue, 16 Apr 2019 17:25:19 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2224F1C162E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:16 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1AD998796C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:16 +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 YdZsteGBt10U for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:13 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 63BB787648\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:13 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:25:11 -0700", "from shasta.jf.intel.com ([10.166.244.191])\n\tby orsmga001.jf.intel.com with ESMTP; 16 Apr 2019 10:25:11 -0700" ], "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.60,358,1549958400\"; d=\"scan'208\";a=\"224064170\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 16 Apr 2019 10:24:31 -0700", "Message-Id": "<20190416172439.27908-8-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>", "References": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S19 07/15] ice: Refactor the LLDP MIB\n\tchange event handling", "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: Usha Ketineni <usha.k.ketineni@intel.com>\n\nThis patch fixes the LLDP MIB change event handling code by removing\nthe workarounds in the current code. Added ice_dcb_need_recfg() to\nprint the DCB configuration changes detected via MIB change event.\n\nSigned-off-by: Usha Ketineni <usha.k.ketineni@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb.c | 5 +-\n drivers/net/ethernet/intel/ice/ice_dcb.h | 4 +-\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 153 ++++++++++++++++---\n 3 files changed, 140 insertions(+), 22 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c\nindex da35f1323c86..817ae688082b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.c\n@@ -624,7 +624,8 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)\n *\n * Parse DCB configuration from the LLDPDU\n */\n-enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)\n+static enum ice_status\n+ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)\n {\n \tstruct ice_lldp_org_tlv *tlv;\n \tenum ice_status ret = 0;\n@@ -674,7 +675,7 @@ enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)\n *\n * Query DCB configuration from the firmware\n */\n-static enum ice_status\n+enum ice_status\n ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,\n \t\t struct ice_dcbx_cfg *dcbcfg)\n {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.h b/drivers/net/ethernet/intel/ice/ice_dcb.h\nindex 0bf0cf54783f..8c79d12a459d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.h\n@@ -120,7 +120,9 @@ struct ice_cee_app_prio {\n \tu8 prio_map;\n } __packed;\n \n-enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg);\n+enum ice_status\n+ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,\n+\t\t struct ice_dcbx_cfg *dcbcfg);\n enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi);\n enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi);\n enum ice_status ice_init_dcb(struct ice_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 7da22f044d4a..b04295ab35d5 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -501,6 +501,55 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,\n \treturn 0;\n }\n \n+/**\n+ * ice_dcb_need_recfg - Check if DCB needs reconfig\n+ * @pf: board private structure\n+ * @old_cfg: current DCB config\n+ * @new_cfg: new DCB config\n+ */\n+static bool ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,\n+\t\t\t struct ice_dcbx_cfg *new_cfg)\n+{\n+\tbool need_reconfig = false;\n+\n+\t/* Check if ETS configuration has changed */\n+\tif (memcmp(&new_cfg->etscfg, &old_cfg->etscfg,\n+\t\t sizeof(new_cfg->etscfg))) {\n+\t\t/* If Priority Table has changed reconfig is needed */\n+\t\tif (memcmp(&new_cfg->etscfg.prio_table,\n+\t\t\t &old_cfg->etscfg.prio_table,\n+\t\t\t sizeof(new_cfg->etscfg.prio_table))) {\n+\t\t\tneed_reconfig = true;\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS UP2TC changed.\\n\");\n+\t\t}\n+\n+\t\tif (memcmp(&new_cfg->etscfg.tcbwtable,\n+\t\t\t &old_cfg->etscfg.tcbwtable,\n+\t\t\t sizeof(new_cfg->etscfg.tcbwtable)))\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TC BW Table changed.\\n\");\n+\n+\t\tif (memcmp(&new_cfg->etscfg.tsatable,\n+\t\t\t &old_cfg->etscfg.tsatable,\n+\t\t\t sizeof(new_cfg->etscfg.tsatable)))\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TSA Table changed.\\n\");\n+\t}\n+\n+\t/* Check if PFC configuration has changed */\n+\tif (memcmp(&new_cfg->pfc, &old_cfg->pfc, sizeof(new_cfg->pfc))) {\n+\t\tneed_reconfig = true;\n+\t\tdev_dbg(&pf->pdev->dev, \"PFC config change detected.\\n\");\n+\t}\n+\n+\t/* Check if APP Table has changed */\n+\tif (memcmp(&new_cfg->app, &old_cfg->app, sizeof(new_cfg->app))) {\n+\t\tneed_reconfig = true;\n+\t\tdev_dbg(&pf->pdev->dev, \"APP Table change detected.\\n\");\n+\t}\n+\n+\tdev_dbg(&pf->pdev->dev, \"dcb need_reconfig=%d\\n\", need_reconfig);\n+\treturn need_reconfig;\n+}\n+\n /**\n * ice_dcb_process_lldp_set_mib_change - Process MIB change\n * @pf: ptr to ice_pf\n@@ -510,29 +559,95 @@ void\n ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t\t\t\t struct ice_rq_event_info *event)\n {\n-\tif (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) {\n-\t\tstruct ice_dcbx_cfg *dcbcfg, *prev_cfg;\n-\t\tint err;\n-\n-\t\tprev_cfg = &pf->hw.port_info->local_dcbx_cfg;\n-\t\tdcbcfg = devm_kmemdup(&pf->pdev->dev, prev_cfg,\n-\t\t\t\t sizeof(*dcbcfg), GFP_KERNEL);\n-\t\tif (!dcbcfg)\n+\tstruct ice_aqc_port_ets_elem buf = { 0 };\n+\tstruct ice_aqc_lldp_get_mib *mib;\n+\tstruct ice_dcbx_cfg tmp_dcbx_cfg;\n+\tbool need_reconfig = false;\n+\tstruct ice_port_info *pi;\n+\tu8 type;\n+\tint ret;\n+\n+\t/* Not DCB capable or capability disabled */\n+\tif (!(test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)))\n+\t\treturn;\n+\n+\tif (pf->dcbx_cap & DCB_CAP_DCBX_HOST) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"MIB Change Event in HOST mode\\n\");\n+\t\treturn;\n+\t}\n+\n+\tpi = pf->hw.port_info;\n+\tmib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;\n+\t/* Ignore if event is not for Nearest Bridge */\n+\ttype = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) &\n+\t\tICE_AQ_LLDP_BRID_TYPE_M);\n+\tdev_dbg(&pf->pdev->dev, \"LLDP event MIB bridge type 0x%x\\n\", type);\n+\tif (type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID)\n+\t\treturn;\n+\n+\t/* Check MIB Type and return if event for Remote MIB update */\n+\ttype = mib->type & ICE_AQ_LLDP_MIB_TYPE_M;\n+\tdev_dbg(&pf->pdev->dev,\n+\t\t\"LLDP event mib type %s\\n\", type ? \"remote\" : \"local\");\n+\tif (type == ICE_AQ_LLDP_MIB_REMOTE) {\n+\t\t/* Update the remote cached instance and return */\n+\t\tret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE,\n+\t\t\t\t\t ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID,\n+\t\t\t\t\t &pi->remote_dcbx_cfg);\n+\t\tif (ret) {\n+\t\t\tdev_err(&pf->pdev->dev, \"Failed to get remote DCB config\\n\");\n \t\t\treturn;\n+\t\t}\n+\t}\n \n-\t\terr = ice_lldp_to_dcb_cfg(event->msg_buf, dcbcfg);\n-\t\tif (!err)\n-\t\t\tice_pf_dcb_cfg(pf, dcbcfg, false);\n+\t/* store the old configuration */\n+\ttmp_dcbx_cfg = pf->hw.port_info->local_dcbx_cfg;\n \n-\t\tdevm_kfree(&pf->pdev->dev, dcbcfg);\n+\t/* Reset the old DCBx configuration data */\n+\tmemset(&pi->local_dcbx_cfg, 0, sizeof(pi->local_dcbx_cfg));\n \n-\t\t/* Get updated DCBx data from firmware */\n-\t\terr = ice_get_dcb_cfg(pf->hw.port_info);\n-\t\tif (err)\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Failed to get DCB config\\n\");\n-\t} else {\n+\t/* Get updated DCBx data from firmware */\n+\tret = ice_get_dcb_cfg(pf->hw.port_info);\n+\tif (ret) {\n+\t\tdev_err(&pf->pdev->dev, \"Failed to get DCB config\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* No change detected in DCBX configs */\n+\tif (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) {\n \t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"MIB Change Event in HOST mode\\n\");\n+\t\t\t\"No change detected in DCBX configuration.\\n\");\n+\t\treturn;\n \t}\n+\n+\tneed_reconfig = ice_dcb_need_recfg(pf, &tmp_dcbx_cfg,\n+\t\t\t\t\t &pi->local_dcbx_cfg);\n+\tif (!need_reconfig)\n+\t\treturn;\n+\n+\t/* Enable DCB tagging only when more than one TC */\n+\tif (ice_dcb_get_num_tc(&pi->local_dcbx_cfg) > 1) {\n+\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging enabled (num TC > 1)\\n\");\n+\t\tset_bit(ICE_FLAG_DCB_ENA, pf->flags);\n+\t} else {\n+\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging disabled (num TC = 1)\\n\");\n+\t\tclear_bit(ICE_FLAG_DCB_ENA, pf->flags);\n+\t}\n+\n+\trtnl_lock();\n+\tice_pf_dis_all_vsi(pf, true);\n+\n+\tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n+\tif (ret) {\n+\t\tdev_err(&pf->pdev->dev, \"Query Port ETS failed\\n\");\n+\t\trtnl_unlock();\n+\t\treturn;\n+\t}\n+\n+\t/* changes in configuration update VSI */\n+\tice_pf_dcb_recfg(pf);\n+\n+\tice_pf_ena_all_vsi(pf, true);\n+\trtnl_unlock();\n }\n", "prefixes": [ "S19", "07/15" ] }