netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice)
@ 2025-07-15 20:29 Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 1/3] ethernet: intel: fix building with large NR_CPUS Tony Nguyen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-07-15 20:29 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev; +Cc: Tony Nguyen

Arnd Bergmann resolves compile issues with large NR_CPUS for ixgbe, fm10k,
and i40e.

For ice:
Dave adds a NULL check for LAG netdev.

Michal corrects a pointer check in debugfs initialization.

The following are changes since commit 0e9418961f897be59b1fab6e31ae1b09a0bae902:
  selftests: net: increase inter-packet timeout in udpgro.sh
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Arnd Bergmann (1):
  ethernet: intel: fix building with large NR_CPUS

Dave Ertman (1):
  ice: add NULL check in eswitch lag check

Michal Swiatkowski (1):
  ice: check correct pointer in fwlog debugfs

 drivers/net/ethernet/intel/fm10k/fm10k.h     | 3 ++-
 drivers/net/ethernet/intel/i40e/i40e.h       | 2 +-
 drivers/net/ethernet/intel/ice/ice_debugfs.c | 2 +-
 drivers/net/ethernet/intel/ice/ice_lag.c     | 3 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe.h     | 3 ++-
 5 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/3] ethernet: intel: fix building with large NR_CPUS
  2025-07-15 20:29 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) Tony Nguyen
@ 2025-07-15 20:29 ` Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 2/3] ice: add NULL check in eswitch lag check Tony Nguyen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-07-15 20:29 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Arnd Bergmann, anthony.l.nguyen, horms, linux,
	Aleksandr Loktionov, Alexander Lobakin, Sunitha Mekala

From: Arnd Bergmann <arnd@arndb.de>

With large values of CONFIG_NR_CPUS, three Intel ethernet drivers fail to
compile like:

In function ‘i40e_free_q_vector’,
    inlined from ‘i40e_vsi_alloc_q_vectors’ at drivers/net/ethernet/intel/i40e/i40e_main.c:12112:3:
  571 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
include/linux/rcupdate.h:1084:17: note: in expansion of macro ‘BUILD_BUG_ON’
 1084 |                 BUILD_BUG_ON(offsetof(typeof(*(ptr)), rhf) >= 4096);    \
drivers/net/ethernet/intel/i40e/i40e_main.c:5113:9: note: in expansion of macro ‘kfree_rcu’
 5113 |         kfree_rcu(q_vector, rcu);
      |         ^~~~~~~~~

The problem is that the 'rcu' member in 'q_vector' is too far from the start
of the structure. Move this member before the CPU mask instead, in all three
drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k.h | 3 ++-
 drivers/net/ethernet/intel/i40e/i40e.h   | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe.h | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index 6119a4108838..65a2816142d9 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -189,13 +189,14 @@ struct fm10k_q_vector {
 	struct fm10k_ring_container rx, tx;
 
 	struct napi_struct napi;
+	struct rcu_head rcu;	/* to avoid race with update stats on free */
+
 	cpumask_t affinity_mask;
 	char name[IFNAMSIZ + 9];
 
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *dbg_q_vector;
 #endif /* CONFIG_DEBUG_FS */
-	struct rcu_head rcu;	/* to avoid race with update stats on free */
 
 	/* for dynamic allocation of rings associated with this q_vector */
 	struct fm10k_ring ring[] ____cacheline_internodealigned_in_smp;
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index c67963bfe14e..7c600d6e66ba 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -945,6 +945,7 @@ struct i40e_q_vector {
 	u16 reg_idx;		/* register index of the interrupt */
 
 	struct napi_struct napi;
+	struct rcu_head rcu;	/* to avoid race with update stats on free */
 
 	struct i40e_ring_container rx;
 	struct i40e_ring_container tx;
@@ -955,7 +956,6 @@ struct i40e_q_vector {
 	cpumask_t affinity_mask;
 	struct irq_affinity_notify affinity_notify;
 
-	struct rcu_head rcu;	/* to avoid race with update stats on free */
 	char name[I40E_INT_NAME_STR_LEN];
 	bool arm_wb_state;
 	bool in_busy_poll;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 47311b134a7a..e6acd791bf64 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -507,9 +507,10 @@ struct ixgbe_q_vector {
 	struct ixgbe_ring_container rx, tx;
 
 	struct napi_struct napi;
+	struct rcu_head rcu;	/* to avoid race with update stats on free */
+
 	cpumask_t affinity_mask;
 	int numa_node;
-	struct rcu_head rcu;	/* to avoid race with update stats on free */
 	char name[IFNAMSIZ + 9];
 
 	/* for dynamic allocation of rings associated with this q_vector */
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/3] ice: add NULL check in eswitch lag check
  2025-07-15 20:29 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 1/3] ethernet: intel: fix building with large NR_CPUS Tony Nguyen
@ 2025-07-15 20:29 ` Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 3/3] ice: check correct pointer in fwlog debugfs Tony Nguyen
  2025-07-17  0:00 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-07-15 20:29 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Dave Ertman, anthony.l.nguyen, horms, Aleksandr Loktionov,
	Sujai Buvaneswaran

From: Dave Ertman <david.m.ertman@intel.com>

The function ice_lag_is_switchdev_running() is being called from outside of
the LAG event handler code.  This results in the lag->upper_netdev being
NULL sometimes.  To avoid a NULL-pointer dereference, there needs to be a
check before it is dereferenced.

Fixes: 776fe19953b0 ("ice: block default rule setting on LAG interface")
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lag.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 2410aee59fb2..d132eb477551 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -2226,7 +2226,8 @@ bool ice_lag_is_switchdev_running(struct ice_pf *pf)
 	struct ice_lag *lag = pf->lag;
 	struct net_device *tmp_nd;
 
-	if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) || !lag)
+	if (!ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) ||
+	    !lag || !lag->upper_netdev)
 		return false;
 
 	rcu_read_lock();
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 3/3] ice: check correct pointer in fwlog debugfs
  2025-07-15 20:29 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 1/3] ethernet: intel: fix building with large NR_CPUS Tony Nguyen
  2025-07-15 20:29 ` [PATCH net 2/3] ice: add NULL check in eswitch lag check Tony Nguyen
@ 2025-07-15 20:29 ` Tony Nguyen
  2025-07-17  0:00 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2025-07-15 20:29 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Michal Swiatkowski, anthony.l.nguyen, Przemek Kitszel,
	Paul Menzel, Rinitha S

From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

pf->ice_debugfs_pf_fwlog should be checked for an error here.

Fixes: 96a9a9341cda ("ice: configure FW logging")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_debugfs.c b/drivers/net/ethernet/intel/ice/ice_debugfs.c
index 9fc0fd95a13d..cb71eca6a85b 100644
--- a/drivers/net/ethernet/intel/ice/ice_debugfs.c
+++ b/drivers/net/ethernet/intel/ice/ice_debugfs.c
@@ -606,7 +606,7 @@ void ice_debugfs_fwlog_init(struct ice_pf *pf)
 
 	pf->ice_debugfs_pf_fwlog = debugfs_create_dir("fwlog",
 						      pf->ice_debugfs_pf);
-	if (IS_ERR(pf->ice_debugfs_pf))
+	if (IS_ERR(pf->ice_debugfs_pf_fwlog))
 		goto err_create_module_files;
 
 	fw_modules_dir = debugfs_create_dir("modules",
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice)
  2025-07-15 20:29 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) Tony Nguyen
                   ` (2 preceding siblings ...)
  2025-07-15 20:29 ` [PATCH net 3/3] ice: check correct pointer in fwlog debugfs Tony Nguyen
@ 2025-07-17  0:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-17  0:00 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev

Hello:

This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Tue, 15 Jul 2025 13:29:43 -0700 you wrote:
> Arnd Bergmann resolves compile issues with large NR_CPUS for ixgbe, fm10k,
> and i40e.
> 
> For ice:
> Dave adds a NULL check for LAG netdev.
> 
> Michal corrects a pointer check in debugfs initialization.
> 
> [...]

Here is the summary with links:
  - [net,1/3] ethernet: intel: fix building with large NR_CPUS
    https://git.kernel.org/netdev/net/c/24171a5a4a95
  - [net,2/3] ice: add NULL check in eswitch lag check
    https://git.kernel.org/netdev/net/c/3ce58b01ada4
  - [net,3/3] ice: check correct pointer in fwlog debugfs
    https://git.kernel.org/netdev/net/c/bedd0330a19b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-16 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 20:29 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) Tony Nguyen
2025-07-15 20:29 ` [PATCH net 1/3] ethernet: intel: fix building with large NR_CPUS Tony Nguyen
2025-07-15 20:29 ` [PATCH net 2/3] ice: add NULL check in eswitch lag check Tony Nguyen
2025-07-15 20:29 ` [PATCH net 3/3] ice: check correct pointer in fwlog debugfs Tony Nguyen
2025-07-17  0:00 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2025-07-15 (ixgbe, fm10k, i40e, ice) patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).