Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1049843/?format=api
{ "id": 1049843, "url": "http://patchwork.ozlabs.org/api/patches/1049843/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190228232432.31659-11-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-11-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-28T23:24:31", "name": "[S16,10/11] ice: Add code to control FW LLDP and DCBX", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "350e03c03b3e4dab0b8cc66c962ce7318dbc44d7", "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-11-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/1049843/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1049843/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.136; helo=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 449TD36jYdz9sMQ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Mar 2019 10:24:51 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 716C3226CF;\n\tThu, 28 Feb 2019 23:24:50 +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 GS-h1hSH5UgD; Thu, 28 Feb 2019 23:24:42 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 950FB226D7;\n\tThu, 28 Feb 2019 23:24:41 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C04421BF964\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:37 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BC1DD869F2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:37 +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 d0xDd0mk6S2V for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Feb 2019 23:24:35 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 2E8A386940\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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Feb 2019 15:24:35 -0800", "from shasta.jf.intel.com ([10.166.241.11])\n\tby FMSMGA003.fm.intel.com with ESMTP; 28 Feb 2019 15:24:34 -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=\"137127732\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 28 Feb 2019 15:24:31 -0800", "Message-Id": "<20190228232432.31659-11-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 10/11] ice: Add code to control FW\n\tLLDP and DCBX", "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": "This patch adds code to start or stop LLDP and DCBX in firmware through\nuse of ethtool private flags.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h | 2 +\n drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 12 ++++\n drivers/net/ethernet/intel/ice/ice_dcb.c | 28 +++++++-\n drivers/net/ethernet/intel/ice/ice_dcb.h | 23 ++++++\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 96 ++++++++++++++++++++++++-\n 5 files changed, 159 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 6ca1094cb24a..878a75182d6d 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -325,6 +325,8 @@ enum ice_pf_flags {\n \tICE_FLAG_DCB_CAPABLE,\n \tICE_FLAG_DCB_ENA,\n \tICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,\n+\tICE_FLAG_DISABLE_FW_LLDP,\n+\tICE_FLAG_ETHTOOL_CTXT,\t\t/* set when ethtool holds RTNL lock */\n \tICE_PF_FLAGS_NBITS\t\t/* must be last */\n };\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex cda93826a065..583f92d4db4c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -1200,6 +1200,16 @@ struct ice_aqc_lldp_set_mib_change {\n \tu8 reserved[15];\n };\n \n+/* Stop LLDP (direct 0x0A05) */\n+struct ice_aqc_lldp_stop {\n+\tu8 command;\n+#define ICE_AQ_LLDP_AGENT_STATE_MASK\tBIT(0)\n+#define ICE_AQ_LLDP_AGENT_STOP\t\t0x0\n+#define ICE_AQ_LLDP_AGENT_SHUTDOWN\tICE_AQ_LLDP_AGENT_STATE_MASK\n+#define ICE_AQ_LLDP_AGENT_PERSIST_DIS\tBIT(1)\n+\tu8 reserved[15];\n+};\n+\n /* Start LLDP (direct 0x0A06) */\n struct ice_aqc_lldp_start {\n \tu8 command;\n@@ -1529,6 +1539,7 @@ struct ice_aq_desc {\n \t\tstruct ice_aqc_pf_vf_msg virt;\n \t\tstruct ice_aqc_lldp_get_mib lldp_get_mib;\n \t\tstruct ice_aqc_lldp_set_mib_change lldp_set_event;\n+\t\tstruct ice_aqc_lldp_stop lldp_stop;\n \t\tstruct ice_aqc_lldp_start lldp_start;\n \t\tstruct ice_aqc_lldp_set_local_mib lldp_set_mib;\n \t\tstruct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;\n@@ -1639,6 +1650,7 @@ enum ice_adminq_opc {\n \t/* LLDP commands */\n \tice_aqc_opc_lldp_get_mib\t\t\t= 0x0A00,\n \tice_aqc_opc_lldp_set_mib_change\t\t\t= 0x0A01,\n+\tice_aqc_opc_lldp_stop\t\t\t\t= 0x0A05,\n \tice_aqc_opc_lldp_start\t\t\t\t= 0x0A06,\n \tice_aqc_opc_get_cee_dcb_cfg\t\t\t= 0x0A07,\n \tice_aqc_opc_lldp_set_local_mib\t\t\t= 0x0A08,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c\nindex ff8267f84c8c..70e0a5739c1d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.c\n@@ -60,7 +60,7 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,\n * Enable or Disable posting of an event on ARQ when LLDP MIB\n * associated with the interface changes (0x0A01)\n */\n-static enum ice_status\n+enum ice_status\n ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,\n \t\t\t struct ice_sq_cd *cd)\n {\n@@ -77,6 +77,32 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,\n \treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n }\n \n+/**\n+ * ice_aq_stop_lldp\n+ * @hw: pointer to the HW struct\n+ * @shutdown_lldp_agent: True if LLDP Agent needs to be Shutdown\n+ *\t\t\t False if LLDP Agent needs to be Stopped\n+ * @cd: pointer to command details structure or NULL\n+ *\n+ * Stop or Shutdown the embedded LLDP Agent (0x0A05)\n+ */\n+enum ice_status\n+ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,\n+\t\t struct ice_sq_cd *cd)\n+{\n+\tstruct ice_aqc_lldp_stop *cmd;\n+\tstruct ice_aq_desc desc;\n+\n+\tcmd = &desc.params.lldp_stop;\n+\n+\tice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_stop);\n+\n+\tif (shutdown_lldp_agent)\n+\t\tcmd->command |= ICE_AQ_LLDP_AGENT_SHUTDOWN;\n+\n+\treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n+}\n+\n /**\n * ice_aq_start_lldp\n * @hw: pointer to the HW struct\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.h b/drivers/net/ethernet/intel/ice/ice_dcb.h\nindex 5e2b67ee1131..41360e3dc07e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.h\n@@ -130,11 +130,25 @@ ice_query_port_ets(struct ice_port_info *pi,\n \t\t struct ice_aqc_port_ets_elem *buf, u16 buf_size,\n \t\t struct ice_sq_cd *cmd_details);\n #ifdef CONFIG_DCB\n+enum ice_status\n+ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,\n+\t\t struct ice_sq_cd *cd);\n enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd);\n enum ice_status\n ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,\n \t\t bool *dcbx_agent_status, struct ice_sq_cd *cd);\n+enum ice_status\n+ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,\n+\t\t\t struct ice_sq_cd *cd);\n #else /* CONFIG_DCB */\n+static inline enum ice_status\n+ice_aq_stop_lldp(struct ice_hw __always_unused *hw,\n+\t\t bool __always_unused shutdown_lldp_agent,\n+\t\t struct ice_sq_cd __always_unused *cd)\n+{\n+\treturn 0;\n+}\n+\n static inline enum ice_status\n ice_aq_start_lldp(struct ice_hw __always_unused *hw,\n \t\t struct ice_sq_cd __always_unused *cd)\n@@ -152,5 +166,14 @@ ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw,\n \n \treturn 0;\n }\n+\n+static inline enum ice_status\n+ice_aq_cfg_lldp_mib_change(struct ice_hw __always_unused *hw,\n+\t\t\t bool __always_unused ena_update,\n+\t\t\t struct ice_sq_cd __always_unused *cd)\n+{\n+\treturn 0;\n+}\n+\n #endif /* CONFIG_DCB */\n #endif /* _ICE_DCB_H_ */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex ea8558954cb4..64a4c4456ba0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -4,6 +4,8 @@\n /* ethtool support for ice */\n \n #include \"ice.h\"\n+#include \"ice_lib.h\"\n+#include \"ice_dcb_lib.h\"\n \n struct ice_stats {\n \tchar stat_string[ETH_GSTRING_LEN];\n@@ -132,6 +134,7 @@ struct ice_priv_flag {\n \n static const struct ice_priv_flag ice_gstrings_priv_flags[] = {\n \tICE_PRIV_FLAG(\"link-down-on-close\", ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA),\n+\tICE_PRIV_FLAG(\"disable-fw-lldp\", ICE_FLAG_DISABLE_FW_LLDP),\n };\n \n #define ICE_PRIV_FLAG_ARRAY_SIZE\tARRAY_SIZE(ice_gstrings_priv_flags)\n@@ -404,13 +407,19 @@ static u32 ice_get_priv_flags(struct net_device *netdev)\n static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n+\tDECLARE_BITMAP(change_flags, ICE_PF_FLAGS_NBITS);\n+\tDECLARE_BITMAP(orig_flags, ICE_PF_FLAGS_NBITS);\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_pf *pf = vsi->back;\n+\tint ret = 0;\n \tu32 i;\n \n \tif (flags > BIT(ICE_PRIV_FLAG_ARRAY_SIZE))\n \t\treturn -EINVAL;\n \n+\tset_bit(ICE_FLAG_ETHTOOL_CTXT, pf->flags);\n+\n+\tbitmap_copy(orig_flags, pf->flags, ICE_PF_FLAGS_NBITS);\n \tfor (i = 0; i < ICE_PRIV_FLAG_ARRAY_SIZE; i++) {\n \t\tconst struct ice_priv_flag *priv_flag;\n \n@@ -422,7 +431,79 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\tclear_bit(priv_flag->bitno, pf->flags);\n \t}\n \n-\treturn 0;\n+\tbitmap_xor(change_flags, pf->flags, orig_flags, ICE_PF_FLAGS_NBITS);\n+\n+\tif (test_bit(ICE_FLAG_DISABLE_FW_LLDP, change_flags)) {\n+\t\tif (test_bit(ICE_FLAG_DISABLE_FW_LLDP, pf->flags)) {\n+\t\t\tenum ice_status status;\n+\n+\t\t\tstatus = ice_aq_cfg_lldp_mib_change(&pf->hw, false,\n+\t\t\t\t\t\t\t NULL);\n+\t\t\t/* If unregistering for LLDP events fails, this is\n+\t\t\t * not an error state, as there shouldn't be any\n+\t\t\t * events to respond to.\n+\t\t\t */\n+\t\t\tif (status)\n+\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t\t \"Failed to unreg for LLDP events\\n\");\n+\n+\t\t\t/* The AQ call to stop the FW LLDP agent will generate\n+\t\t\t * an error if the agent is already stopped.\n+\t\t\t */\n+\t\t\tstatus = ice_aq_stop_lldp(&pf->hw, true, NULL);\n+\t\t\tif (status)\n+\t\t\t\tdev_warn(&pf->pdev->dev,\n+\t\t\t\t\t \"Fail to stop LLDP agent\\n\");\n+\t\t\t/* Use case for having the FW LLDP agent stopped\n+\t\t\t * will likely not need DCB, so failure to init is\n+\t\t\t * not a concern of ethtool\n+\t\t\t */\n+\t\t\tstatus = ice_init_pf_dcb(pf);\n+\t\t\tif (status)\n+\t\t\t\tdev_warn(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\t\t} else {\n+\t\t\tenum ice_status status;\n+\t\t\tbool dcbx_agent_status;\n+\n+\t\t\t/* AQ command to start FW LLDP agent will return an\n+\t\t\t * error if the agent is already started\n+\t\t\t */\n+\t\t\tstatus = ice_aq_start_lldp(&pf->hw, NULL);\n+\t\t\tif (status)\n+\t\t\t\tdev_warn(&pf->pdev->dev,\n+\t\t\t\t\t \"Fail to start LLDP Agent\\n\");\n+\n+\t\t\t/* AQ command to start FW DCBx agent will fail if\n+\t\t\t * the agent is already started\n+\t\t\t */\n+\t\t\tstatus = ice_aq_start_stop_dcbx(&pf->hw, true,\n+\t\t\t\t\t\t\t&dcbx_agent_status,\n+\t\t\t\t\t\t\tNULL);\n+\t\t\tif (status)\n+\t\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\t\t\"Failed to start FW DCBX\\n\");\n+\n+\t\t\tdev_info(&pf->pdev->dev, \"FW DCBX agent is %s\\n\",\n+\t\t\t\t dcbx_agent_status ? \"ACTIVE\" : \"DISABLED\");\n+\n+\t\t\t/* Failure to configure MIB change or init DCB is not\n+\t\t\t * relevant to ethtool. Print notification that\n+\t\t\t * registration/init failed but do not return error\n+\t\t\t * state to ethtool\n+\t\t\t */\n+\t\t\tstatus = ice_aq_cfg_lldp_mib_change(&pf->hw, false,\n+\t\t\t\t\t\t\t NULL);\n+\t\t\tif (status)\n+\t\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\t\t\"Fail to reg for MIB change\\n\");\n+\n+\t\t\tstatus = ice_init_pf_dcb(pf);\n+\t\t\tif (status)\n+\t\t\t\tdev_dbg(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\t\t}\n+\t}\n+\tclear_bit(ICE_FLAG_ETHTOOL_CTXT, pf->flags);\n+\treturn ret;\n }\n \n static int ice_get_sset_count(struct net_device *netdev, int sset)\n@@ -1854,12 +1935,15 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \tstruct ice_port_info *pi = np->vsi->port_info;\n \tstruct ice_aqc_get_phy_caps_data *pcaps;\n \tstruct ice_vsi *vsi = np->vsi;\n+\tstruct ice_dcbx_cfg *dcbx_cfg;\n \tenum ice_status status;\n \n \t/* Initialize pause params */\n \tpause->rx_pause = 0;\n \tpause->tx_pause = 0;\n \n+\tdcbx_cfg = &pi->local_dcbx_cfg;\n+\n \tpcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*pcaps),\n \t\t\t GFP_KERNEL);\n \tif (!pcaps)\n@@ -1874,6 +1958,10 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \tpause->autoneg = ((pcaps->caps & ICE_AQC_PHY_AN_MODE) ?\n \t\t\tAUTONEG_ENABLE : AUTONEG_DISABLE);\n \n+\tif (dcbx_cfg->pfc.pfcena)\n+\t\t/* PFC enabled so report LFC as off */\n+\t\tgoto out;\n+\n \tif (pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE)\n \t\tpause->tx_pause = 1;\n \tif (pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE)\n@@ -1894,6 +1982,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_link_status *hw_link_info;\n \tstruct ice_pf *pf = np->vsi->back;\n+\tstruct ice_dcbx_cfg *dcbx_cfg;\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_hw *hw = &pf->hw;\n \tstruct ice_port_info *pi;\n@@ -1904,6 +1993,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \n \tpi = vsi->port_info;\n \thw_link_info = &pi->phy.link_info;\n+\tdcbx_cfg = &pi->local_dcbx_cfg;\n \tlink_up = hw_link_info->link_info & ICE_AQ_LINK_UP;\n \n \t/* Changing the port's flow control is not supported if this isn't the\n@@ -1926,6 +2016,10 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n \t\tnetdev_info(netdev, \"Autoneg did not complete so changing settings may not result in an actual change.\\n\");\n \t}\n \n+\tif (dcbx_cfg->pfc.pfcena) {\n+\t\tnetdev_info(netdev, \"Priority flow control enabled. Cannot set link flow control.\\n\");\n+\t\treturn -EOPNOTSUPP;\n+\t}\n \tif (pause->rx_pause && pause->tx_pause)\n \t\tpi->fc.req_mode = ICE_FC_FULL;\n \telse if (pause->rx_pause && !pause->tx_pause)\n", "prefixes": [ "S16", "10/11" ] }