Skip to content

Commit 28b1208

Browse files
mpalczew96anguy11
authored andcommitted
i40e: Fix addition of RX filters after enabling FW LLDP agent
Fix addition of VLAN filter for PF after enabling FW LLDP agent. Changing LLDP Agent causes FW to re-initialize per NVM settings. Remove default PF filter and move "Enable/Disable" to currently used reset flag. Without this patch PF would try to add MAC VLAN filter with default switch filter present. This causes AQ error and sets promiscuous mode on. Fixes: c65e78f ("i40e: Further implementation of LLDP") Signed-off-by: Przemyslaw Patynowski <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Reviewed-by: Sylwester Dziedziuch <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 4cdb9f8 commit 28b1208

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4878,7 +4878,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
48784878
enum i40e_admin_queue_err adq_err;
48794879
struct i40e_vsi *vsi = np->vsi;
48804880
struct i40e_pf *pf = vsi->back;
4881-
bool is_reset_needed;
4881+
u32 reset_needed = 0;
48824882
i40e_status status;
48834883
u32 i, j;
48844884

@@ -4923,9 +4923,11 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
49234923
flags_complete:
49244924
changed_flags = orig_flags ^ new_flags;
49254925

4926-
is_reset_needed = !!(changed_flags & (I40E_FLAG_VEB_STATS_ENABLED |
4927-
I40E_FLAG_LEGACY_RX | I40E_FLAG_SOURCE_PRUNING_DISABLED |
4928-
I40E_FLAG_DISABLE_FW_LLDP));
4926+
if (changed_flags & I40E_FLAG_DISABLE_FW_LLDP)
4927+
reset_needed = I40E_PF_RESET_AND_REBUILD_FLAG;
4928+
if (changed_flags & (I40E_FLAG_VEB_STATS_ENABLED |
4929+
I40E_FLAG_LEGACY_RX | I40E_FLAG_SOURCE_PRUNING_DISABLED))
4930+
reset_needed = BIT(__I40E_PF_RESET_REQUESTED);
49294931

49304932
/* Before we finalize any flag changes, we need to perform some
49314933
* checks to ensure that the changes are supported and safe.
@@ -5057,7 +5059,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
50575059
case I40E_AQ_RC_EEXIST:
50585060
dev_warn(&pf->pdev->dev,
50595061
"FW LLDP agent is already running\n");
5060-
is_reset_needed = false;
5062+
reset_needed = 0;
50615063
break;
50625064
case I40E_AQ_RC_EPERM:
50635065
dev_warn(&pf->pdev->dev,
@@ -5086,8 +5088,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
50865088
/* Issue reset to cause things to take effect, as additional bits
50875089
* are added we will need to create a mask of bits requiring reset
50885090
*/
5089-
if (is_reset_needed)
5090-
i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED), true);
5091+
if (reset_needed)
5092+
i40e_do_reset(pf, reset_needed, true);
50915093

50925094
return 0;
50935095
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8537,18 +8537,17 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)
85378537
dev_dbg(&pf->pdev->dev, "PFR requested\n");
85388538
i40e_handle_reset_warning(pf, lock_acquired);
85398539

8540-
dev_info(&pf->pdev->dev,
8541-
pf->flags & I40E_FLAG_DISABLE_FW_LLDP ?
8542-
"FW LLDP is disabled\n" :
8543-
"FW LLDP is enabled\n");
8544-
85458540
} else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG) {
85468541
/* Request a PF Reset
85478542
*
85488543
* Resets PF and reinitializes PFs VSI.
85498544
*/
85508545
i40e_prep_for_reset(pf, lock_acquired);
85518546
i40e_reset_and_rebuild(pf, true, lock_acquired);
8547+
dev_info(&pf->pdev->dev,
8548+
pf->flags & I40E_FLAG_DISABLE_FW_LLDP ?
8549+
"FW LLDP is disabled\n" :
8550+
"FW LLDP is enabled\n");
85528551

85538552
} else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) {
85548553
int v;

0 commit comments

Comments
 (0)