Skip to contentSkip to conversation

Intel Wired LAN Driver Updates 2023-04-17 (i40e)

GIT PULL New Tony Nguyen 3 participants 5 messages Apr 17, 2023 – Apr 20, 2023

Subsystems (3)
lore
Share & tools
lore

Tony Nguyen

author maintainer
#0 lore raw

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.

The following are changes since commit 338469d677e5d426f5ada88761f16f6d2c7c1981:
net/sched: clear actions pointer in miss cookie init fail
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

Aleksandr Loktionov (2):
i40e: fix accessing vsi->active_filters without holding lock
i40e: fix i40e_setup_misc_vector() error handling

 drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.38.1
author maintainer
#1 lore raw

PATCH 1/2 i40e: fix accessing vsi->active_filters without holding lock

From: Aleksandr Loktionov <[email protected]>

Fix accessing vsi->active_filters without holding the mac_filter_hash_lock. Move vsi->active_filters = 0 inside critical section and
move clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state) after the critical section to ensure the new filters from other threads can be added only after filters cleaning in the critical section is finished.

Fixes 278e7d0b9d68 ("i40e: store MAC/VLAN filters in a hash with the MAC Address as key")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
index 228cd502bb48..6313575a4b6c 100644
@@ -14133,15 +14133,15 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
 		vsi->id = ctxt.vsi_number;
 	}
 
-	vsi->active_filters = 0;
-	clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
 	spin_lock_bh(&vsi->mac_filter_hash_lock);
+	vsi->active_filters = 0;
 	/* If macvlan filters already exist, force them to get loaded */
 	hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
 		f->state = I40E_FILTER_NEW;
 		f_count++;
 	}
 	spin_unlock_bh(&vsi->mac_filter_hash_lock);
+	clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
 
 	if (f_count) {
 		vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
Signature · 1 line
2.38.1
author maintainer
#2 lore raw

PATCH 2/2 i40e: fix i40e_setup_misc_vector() error handling

In reply to Tony Nguyen

From: Aleksandr Loktionov <[email protected]>

Add error handling of i40e_setup_misc_vector() in i40e_rebuild(). In case interrupt vectors setup fails do not re-open vsi-s and do not bring up vf-s, we have no interrupts to serve a traffic anyway.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +4 -1
index 6313575a4b6c..7c30abd0dfc2 100644
@@ -11059,8 +11059,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 					     pf->hw.aq.asq_last_status));
 	}
 	/* reinit the misc interrupt */
-	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
+	if (pf->flags & I40E_FLAG_MSIX_ENABLED) {
 		ret = i40e_setup_misc_vector(pf);
+		if (ret)
+			goto end_unlock;
+	}
 
 	/* Add a filter to drop all Flow control frames from any VSI from being
 	 * transmitted. By doing so we stop a malicious VF from sending out
Signature · 1 line
2.38.1
Reviewed-by
#3 lore raw
In reply to Tony Nguyen
Quoted 11 lines · Tony Nguyen

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.

The following are changes since commit 338469d677e5d426f5ada88761f16f6d2c7c1981:
net/sched: clear actions pointer in miss cookie init fail
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

Quoted 6 lines

Aleksandr Loktionov (2):
i40e: fix accessing vsi->active_filters without holding lock
i40e: fix i40e_setup_misc_vector() error handling

 drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

FWIIW, I reviewed the patches in this pull request and they look good to me.

#4 lore raw
In reply to Tony Nguyen
This series was applied to netdev/net.git (main) by Tony Nguyen <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Tony Nguyen <[email protected]>:

Quoted 6 lines · On Mon, 17 Apr 2023 13:52:43 -0700 you wrote:

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.

Quoted 6 lines

The following are changes since commit 338469d677e5d426f5ada88761f16f6d2c7c1981:
net/sched: clear actions pointer in miss cookie init fail
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE

[...]

Here is the summary with links:
- [net,1/2] i40e: fix accessing vsi->active_filters without holding lock

    https://git.kernel.org/netdev/net/c/8485d093b076
  - [net,2/2] i40e: fix i40e_setup_misc_vector() error handling
    https://git.kernel.org/netdev/net/c/c86c00c69355

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html