aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatryk Małek <patryk.malek@intel.com>2018-10-30 13:50:47 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-11-14 13:56:33 -0500
commit5734fe87486e858124ec30d73be0a265e02c042c (patch)
treecfe62bbebcf8b24482e91041d716bb99fdc2ba40
parentc95cb7b25f25b8145407cf89ae45dfac113760e4 (diff)
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: Patryk Małek <patryk.malek@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c3
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c13
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c15
4 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 5595a4614206..cda37d7ae5d6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -495,7 +495,6 @@ struct i40e_pf {
495#define I40E_HW_STOP_FW_LLDP BIT(16) 495#define I40E_HW_STOP_FW_LLDP BIT(16)
496#define I40E_HW_PORT_ID_VALID BIT(17) 496#define I40E_HW_PORT_ID_VALID BIT(17)
497#define I40E_HW_RESTART_AUTONEG BIT(18) 497#define I40E_HW_RESTART_AUTONEG BIT(18)
498#define I40E_HW_STOPPABLE_FW_LLDP BIT(19)
499 498
500 u32 flags; 499 u32 flags;
501#define I40E_FLAG_RX_CSUM_ENABLED BIT(0) 500#define I40E_FLAG_RX_CSUM_ENABLED BIT(0)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 85f75b5978fc..97a9b1fb4763 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -3723,6 +3723,9 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
3723 (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw; 3723 (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
3724 i40e_status status; 3724 i40e_status status;
3725 3725
3726 if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
3727 return I40E_ERR_DEVICE_NOT_SUPPORTED;
3728
3726 i40e_fill_default_direct_cmd_desc(&desc, 3729 i40e_fill_default_direct_cmd_desc(&desc,
3727 i40e_aqc_opc_set_dcb_parameters); 3730 i40e_aqc_opc_set_dcb_parameters);
3728 3731
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 9c1211ad2c6b..311edac272aa 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -4660,14 +4660,15 @@ flags_complete:
4660 return -EOPNOTSUPP; 4660 return -EOPNOTSUPP;
4661 4661
4662 /* If the driver detected FW LLDP was disabled on init, this flag could 4662 /* If the driver detected FW LLDP was disabled on init, this flag could
4663 * be set, however we do not support _changing_ the flag if NPAR is 4663 * be set, however we do not support _changing_ the flag:
4664 * enabled or FW API version < 1.7. There are situations where older 4664 * - on XL710 if NPAR is enabled or FW API version < 1.7
4665 * FW versions/NPAR enabled PFs could disable LLDP, however we _must_ 4665 * - on X722 with FW API version < 1.6
4666 * not allow the user to enable/disable LLDP with this flag on 4666 * There are situations where older FW versions/NPAR enabled PFs could
4667 * unsupported FW versions. 4667 * disable LLDP, however we _must_ not allow the user to enable/disable
4668 * LLDP with this flag on unsupported FW versions.
4668 */ 4669 */
4669 if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP) { 4670 if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP) {
4670 if (!(pf->hw_features & I40E_HW_STOPPABLE_FW_LLDP)) { 4671 if (!(pf->hw.flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) {
4671 dev_warn(&pf->pdev->dev, 4672 dev_warn(&pf->pdev->dev,
4672 "Device does not support changing FW LLDP\n"); 4673 "Device does not support changing FW LLDP\n");
4673 return -EOPNOTSUPP; 4674 return -EOPNOTSUPP;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index dbd6fffd9b85..d4461eec26bd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11331,16 +11331,15 @@ static int i40e_sw_init(struct i40e_pf *pf)
11331 /* IWARP needs one extra vector for CQP just like MISC.*/ 11331 /* IWARP needs one extra vector for CQP just like MISC.*/
11332 pf->num_iwarp_msix = (int)num_online_cpus() + 1; 11332 pf->num_iwarp_msix = (int)num_online_cpus() + 1;
11333 } 11333 }
11334 /* Stopping the FW LLDP engine is only supported on the 11334 /* Stopping FW LLDP engine is supported on XL710 and X722
11335 * XL710 with a FW ver >= 1.7. Also, stopping FW LLDP 11335 * starting from FW versions determined in i40e_init_adminq.
11336 * engine is not supported if NPAR is functioning on this 11336 * Stopping the FW LLDP engine is not supported on XL710
11337 * part 11337 * if NPAR is functioning so unset this hw flag in this case.
11338 */ 11338 */
11339 if (pf->hw.mac.type == I40E_MAC_XL710 && 11339 if (pf->hw.mac.type == I40E_MAC_XL710 &&
11340 !pf->hw.func_caps.npar_enable && 11340 pf->hw.func_caps.npar_enable &&
11341 (pf->hw.aq.api_maj_ver > 1 || 11341 (pf->hw.flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
11342 (pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver > 6))) 11342 pf->hw.flags &= ~I40E_HW_FLAG_FW_LLDP_STOPPABLE;
11343 pf->hw_features |= I40E_HW_STOPPABLE_FW_LLDP;
11344 11343
11345#ifdef CONFIG_PCI_IOV 11344#ifdef CONFIG_PCI_IOV
11346 if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) { 11345 if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) {