Skip to content

Commit 7b63435

Browse files
dmertmanJeff Kirsher
authored andcommitted
i40e: i40e: Change ethtool check from MAC to HW flag
The MAC, FW Version and NPAR check used to determine if shutting off the FW LLDP engine is supported is not using the usual feature check mechanism. This patch fixes the problem by moving the feature check to i40e_sw_init in order to set a flag in pf->hw_features that ethtool will use for priv_flags disable operation. Signed-off-by: Dave Ertman <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 7363115 commit 7b63435

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ struct i40e_pf {
507507
#define I40E_HW_STOP_FW_LLDP BIT(16)
508508
#define I40E_HW_PORT_ID_VALID BIT(17)
509509
#define I40E_HW_RESTART_AUTONEG BIT(18)
510+
#define I40E_HW_STOPPABLE_FW_LLDP BIT(19)
510511

511512
u64 flags;
512513
#define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(0)

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,17 +4426,9 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
44264426
* unsupported FW versions.
44274427
*/
44284428
if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP) {
4429-
if (pf->hw.func_caps.npar_enable) {
4429+
if (!(pf->hw_features & I40E_HW_STOPPABLE_FW_LLDP)) {
44304430
dev_warn(&pf->pdev->dev,
4431-
"Unable to change FW LLDP if NPAR active\n");
4432-
return -EOPNOTSUPP;
4433-
}
4434-
4435-
if (pf->hw.aq.api_maj_ver < 1 ||
4436-
(pf->hw.aq.api_maj_ver == 1 &&
4437-
pf->hw.aq.api_min_ver < 7)) {
4438-
dev_warn(&pf->pdev->dev,
4439-
"FW ver does not support changing FW LLDP\n");
4431+
"Device does not support changing FW LLDP\n");
44404432
return -EOPNOTSUPP;
44414433
}
44424434
}

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11089,6 +11089,16 @@ static int i40e_sw_init(struct i40e_pf *pf)
1108911089
/* IWARP needs one extra vector for CQP just like MISC.*/
1109011090
pf->num_iwarp_msix = (int)num_online_cpus() + 1;
1109111091
}
11092+
/* Stopping the FW LLDP engine is only supported on the
11093+
* XL710 with a FW ver >= 1.7. Also, stopping FW LLDP
11094+
* engine is not supported if NPAR is functioning on this
11095+
* part
11096+
*/
11097+
if (pf->hw.mac.type == I40E_MAC_XL710 &&
11098+
!pf->hw.func_caps.npar_enable &&
11099+
(pf->hw.aq.api_maj_ver > 1 ||
11100+
(pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver > 6)))
11101+
pf->hw_features |= I40E_HW_STOPPABLE_FW_LLDP;
1109211102

1109311103
#ifdef CONFIG_PCI_IOV
1109411104
if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) {

0 commit comments

Comments
 (0)