Skip to content

Commit 7b97174

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-04-17 (i40e) This series contains updates to i40e only. Alex moves setting of active filters to occur under lock and checks/takes error path in rebuild if re-initializing the misc interrupt vector failed. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: fix i40e_setup_misc_vector() error handling i40e: fix accessing vsi->active_filters without holding lock ==================== Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230417205245.1030733-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 67d47b9 + c86c00c commit 7b97174

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11059,8 +11059,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1105911059
pf->hw.aq.asq_last_status));
1106011060
}
1106111061
/* reinit the misc interrupt */
11062-
if (pf->flags & I40E_FLAG_MSIX_ENABLED)
11062+
if (pf->flags & I40E_FLAG_MSIX_ENABLED) {
1106311063
ret = i40e_setup_misc_vector(pf);
11064+
if (ret)
11065+
goto end_unlock;
11066+
}
1106411067

1106511068
/* Add a filter to drop all Flow control frames from any VSI from being
1106611069
* transmitted. By doing so we stop a malicious VF from sending out
@@ -14133,15 +14136,15 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
1413314136
vsi->id = ctxt.vsi_number;
1413414137
}
1413514138

14136-
vsi->active_filters = 0;
14137-
clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
1413814139
spin_lock_bh(&vsi->mac_filter_hash_lock);
14140+
vsi->active_filters = 0;
1413914141
/* If macvlan filters already exist, force them to get loaded */
1414014142
hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
1414114143
f->state = I40E_FILTER_NEW;
1414214144
f_count++;
1414314145
}
1414414146
spin_unlock_bh(&vsi->mac_filter_hash_lock);
14147+
clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
1414514148

1414614149
if (f_count) {
1414714150
vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;

0 commit comments

Comments
 (0)