Commit 5734fe87 authored by Patryk Małek's avatar Patryk Małek Committed by Jeff Kirsher

i40e: Allow disabling FW LLDP on X722 devices

This patch allows disabling FW LLDP agent on X722 devices.
It also changes a source of information for this feature from
pf->hw_features to pf->hw.flags which are set in i40e_init_adminq.
Signed-off-by: default avatarPatryk Małek <patryk.malek@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent c95cb7b2
...@@ -495,7 +495,6 @@ struct i40e_pf { ...@@ -495,7 +495,6 @@ struct i40e_pf {
#define I40E_HW_STOP_FW_LLDP BIT(16) #define I40E_HW_STOP_FW_LLDP BIT(16)
#define I40E_HW_PORT_ID_VALID BIT(17) #define I40E_HW_PORT_ID_VALID BIT(17)
#define I40E_HW_RESTART_AUTONEG BIT(18) #define I40E_HW_RESTART_AUTONEG BIT(18)
#define I40E_HW_STOPPABLE_FW_LLDP BIT(19)
u32 flags; u32 flags;
#define I40E_FLAG_RX_CSUM_ENABLED BIT(0) #define I40E_FLAG_RX_CSUM_ENABLED BIT(0)
......
...@@ -3723,6 +3723,9 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable, ...@@ -3723,6 +3723,9 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
(struct i40e_aqc_set_dcb_parameters *)&desc.params.raw; (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
i40e_status status; i40e_status status;
if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
return I40E_ERR_DEVICE_NOT_SUPPORTED;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_dcb_parameters); i40e_aqc_opc_set_dcb_parameters);
......
...@@ -4660,14 +4660,15 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) ...@@ -4660,14 +4660,15 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* If the driver detected FW LLDP was disabled on init, this flag could /* If the driver detected FW LLDP was disabled on init, this flag could
* be set, however we do not support _changing_ the flag if NPAR is * be set, however we do not support _changing_ the flag:
* enabled or FW API version < 1.7. There are situations where older * - on XL710 if NPAR is enabled or FW API version < 1.7
* FW versions/NPAR enabled PFs could disable LLDP, however we _must_ * - on X722 with FW API version < 1.6
* not allow the user to enable/disable LLDP with this flag on * There are situations where older FW versions/NPAR enabled PFs could
* unsupported FW versions. * disable LLDP, however we _must_ not allow the user to enable/disable
* LLDP with this flag on unsupported FW versions.
*/ */
if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP) { if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP) {
if (!(pf->hw_features & I40E_HW_STOPPABLE_FW_LLDP)) { if (!(pf->hw.flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) {
dev_warn(&pf->pdev->dev, dev_warn(&pf->pdev->dev,
"Device does not support changing FW LLDP\n"); "Device does not support changing FW LLDP\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -11331,16 +11331,15 @@ static int i40e_sw_init(struct i40e_pf *pf) ...@@ -11331,16 +11331,15 @@ static int i40e_sw_init(struct i40e_pf *pf)
/* IWARP needs one extra vector for CQP just like MISC.*/ /* IWARP needs one extra vector for CQP just like MISC.*/
pf->num_iwarp_msix = (int)num_online_cpus() + 1; pf->num_iwarp_msix = (int)num_online_cpus() + 1;
} }
/* Stopping the FW LLDP engine is only supported on the /* Stopping FW LLDP engine is supported on XL710 and X722
* XL710 with a FW ver >= 1.7. Also, stopping FW LLDP * starting from FW versions determined in i40e_init_adminq.
* engine is not supported if NPAR is functioning on this * Stopping the FW LLDP engine is not supported on XL710
* part * if NPAR is functioning so unset this hw flag in this case.
*/ */
if (pf->hw.mac.type == I40E_MAC_XL710 && if (pf->hw.mac.type == I40E_MAC_XL710 &&
!pf->hw.func_caps.npar_enable && pf->hw.func_caps.npar_enable &&
(pf->hw.aq.api_maj_ver > 1 || (pf->hw.flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
(pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver > 6))) pf->hw.flags &= ~I40E_HW_FLAG_FW_LLDP_STOPPABLE;
pf->hw_features |= I40E_HW_STOPPABLE_FW_LLDP;
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) { if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment