Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1049831/?format=api
{ "id": 1049831, "url": "http://patchwork.ozlabs.org/api/patches/1049831/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190228232432.31659-5-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": "<20190228232432.31659-5-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-28T23:24:25", "name": "[S16,04/11] ice: Add code for DCB initialization part 4/4", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3b765f960631488bc1a72bc1d8c0ac37521ba99b", "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/20190228232432.31659-5-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 94826, "url": "http://patchwork.ozlabs.org/api/series/94826/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=94826", "date": "2019-02-28T23:24:25", "name": "Add support for Data Center Bridging (DCB)", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/94826/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1049831/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1049831/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 449TCs5JJyz9s70\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Mar 2019 10:24:40 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 29A9D879B8;\n\tThu, 28 Feb 2019 23:24:38 +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 MqF6V7hqWXSR; Thu, 28 Feb 2019 23:24:37 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5E12087A04;\n\tThu, 28 Feb 2019 23:24:37 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9025A1BF410\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:36 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8DDAE877E2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:36 +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 l2fLrKfl-AH5 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:35 +0000 (UTC)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 180528786C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:35 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Feb 2019 15:24:34 -0800", "from shasta.jf.intel.com ([10.166.241.11])\n\tby FMSMGA003.fm.intel.com with ESMTP; 28 Feb 2019 15:24:33 -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.58,425,1544515200\"; d=\"scan'208\";a=\"137127721\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 28 Feb 2019 15:24:25 -0800", "Message-Id": "<20190228232432.31659-5-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.5", "In-Reply-To": "<20190228232432.31659-1-anirudh.venkataramanan@intel.com>", "References": "<20190228232432.31659-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S16 04/11] ice: Add code for DCB\n\tinitialization part 4/4", "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>", "MIME-Version": "1.0", "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": "When the firmware doesn't support LLDP or DCBX, the driver should switch\nto \"software LLDP mode\". This patch adds support for the same.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb.h | 1 +\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 82 +++++++++++++++++++++++++++-\n 2 files changed, 81 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.h b/drivers/net/ethernet/intel/ice/ice_dcb.h\nindex 068ec5b98708..03e310a679f0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.h\n@@ -6,6 +6,7 @@\n \n #include \"ice_type.h\"\n \n+#define ICE_DCBX_STATUS_NOT_STARTED\t0\n #define ICE_DCBX_STATUS_IN_PROGRESS\t1\n #define ICE_DCBX_STATUS_DONE\t\t2\n #define ICE_DCBX_STATUS_DIS\t\t7\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 102a9d7efb3c..67b3fab74f7a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -186,6 +186,50 @@ static int ice_dcb_init_cfg(struct ice_pf *pf)\n \treturn ret;\n }\n \n+/**\n+ * ice_dcb_sw_default_config - Apply a default DCB config\n+ * @pf: pf to apply config to\n+ */\n+static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf)\n+{\n+\tstruct ice_aqc_port_ets_elem buf = { 0 };\n+\tstruct ice_dcbx_cfg *dcbcfg;\n+\tstruct ice_port_info *pi;\n+\tstruct ice_hw *hw;\n+\tint ret;\n+\n+\thw = &pf->hw;\n+\tpi = hw->port_info;\n+\tdcbcfg = devm_kzalloc(&pf->pdev->dev, sizeof(*dcbcfg), GFP_KERNEL);\n+\n+\tmemset(dcbcfg, 0, sizeof(*dcbcfg));\n+\tmemset(&pi->local_dcbx_cfg, 0, sizeof(*dcbcfg));\n+\n+\tdcbcfg->etscfg.willing = 1;\n+\tdcbcfg->etscfg.maxtcs = 8;\n+\tdcbcfg->etscfg.tcbwtable[0] = 100;\n+\tdcbcfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;\n+\n+\tmemcpy(&dcbcfg->etsrec, &dcbcfg->etscfg,\n+\t sizeof(dcbcfg->etsrec));\n+\tdcbcfg->etsrec.willing = 0;\n+\n+\tdcbcfg->pfc.willing = 1;\n+\tdcbcfg->pfc.pfccap = IEEE_8021QAZ_MAX_TCS;\n+\n+\tdcbcfg->numapps = 1;\n+\tdcbcfg->app[0].selector = ICE_APP_SEL_ETHTYPE;\n+\tdcbcfg->app[0].priority = 3;\n+\tdcbcfg->app[0].prot_id = ICE_APP_PROT_ID_FCOE;\n+\n+\tret = ice_pf_dcb_cfg(pf, dcbcfg);\n+\tdevm_kfree(&pf->pdev->dev, dcbcfg);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn ice_query_port_ets(pi, &buf, sizeof(buf), NULL);\n+}\n+\n /**\n * ice_init_pf_dcb - initialize DCB for a PF\n * @pf: pf to initiialize DCB for\n@@ -195,6 +239,7 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \tstruct device *dev = &pf->pdev->dev;\n \tstruct ice_port_info *port_info;\n \tstruct ice_hw *hw = &pf->hw;\n+\tint sw_default = 0;\n \tint err;\n \n \tport_info = hw->port_info;\n@@ -223,8 +268,41 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \t}\n \n \terr = ice_init_dcb(hw);\n-\tif (err)\n-\t\tgoto dcb_init_err;\n+\tif (err) {\n+\t\t/* FW LLDP not in usable state, default to SW DCBx/LLDP */\n+\t\tdev_info(&pf->pdev->dev, \"FW LLDP not in usable state\\n\");\n+\t\thw->port_info->dcbx_status = ICE_DCBX_STATUS_NOT_STARTED;\n+\t\thw->port_info->is_sw_lldp = true;\n+\t}\n+\n+\tif (port_info->dcbx_status == ICE_DCBX_STATUS_DIS)\n+\t\tdev_info(&pf->pdev->dev, \"DCBX disabled\\n\");\n+\n+\t/* LLDP disabled in FW */\n+\tif (port_info->is_sw_lldp) {\n+\t\tsw_default = 1;\n+\t\tdev_info(&pf->pdev->dev, \"DCBx/LLDP in SW mode.\\n\");\n+\t}\n+\n+\tif (port_info->dcbx_status == ICE_DCBX_STATUS_NOT_STARTED) {\n+\t\tsw_default = 1;\n+\t\tdev_info(&pf->pdev->dev, \"DCBX not started\\n\");\n+\t}\n+\n+\tif (sw_default) {\n+\t\terr = ice_dcb_sw_dflt_cfg(pf);\n+\t\tif (err) {\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"Failed to set local DCB config %d\\n\", err);\n+\t\t\terr = -EIO;\n+\t\t\tgoto dcb_init_err;\n+\t\t}\n+\n+\t\tpf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;\n+\t\tset_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);\n+\t\tset_bit(ICE_FLAG_DCB_ENA, pf->flags);\n+\t\treturn 0;\n+\t}\n \n \t/* DCBX in FW and LLDP enabled in FW */\n \tpf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE;\n", "prefixes": [ "S16", "04/11" ] }