Skip to content

Commit 24171a5

Browse files
arndbanguy11
authored andcommitted
ethernet: intel: fix building with large NR_CPUS
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 <[email protected]> Acked-by: David S. Miller <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Tested-by: Sunitha Mekala <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 0e94189 commit 24171a5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

drivers/net/ethernet/intel/fm10k/fm10k.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,14 @@ struct fm10k_q_vector {
189189
struct fm10k_ring_container rx, tx;
190190

191191
struct napi_struct napi;
192+
struct rcu_head rcu; /* to avoid race with update stats on free */
193+
192194
cpumask_t affinity_mask;
193195
char name[IFNAMSIZ + 9];
194196

195197
#ifdef CONFIG_DEBUG_FS
196198
struct dentry *dbg_q_vector;
197199
#endif /* CONFIG_DEBUG_FS */
198-
struct rcu_head rcu; /* to avoid race with update stats on free */
199200

200201
/* for dynamic allocation of rings associated with this q_vector */
201202
struct fm10k_ring ring[] ____cacheline_internodealigned_in_smp;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ struct i40e_q_vector {
945945
u16 reg_idx; /* register index of the interrupt */
946946

947947
struct napi_struct napi;
948+
struct rcu_head rcu; /* to avoid race with update stats on free */
948949

949950
struct i40e_ring_container rx;
950951
struct i40e_ring_container tx;
@@ -955,7 +956,6 @@ struct i40e_q_vector {
955956
cpumask_t affinity_mask;
956957
struct irq_affinity_notify affinity_notify;
957958

958-
struct rcu_head rcu; /* to avoid race with update stats on free */
959959
char name[I40E_INT_NAME_STR_LEN];
960960
bool arm_wb_state;
961961
bool in_busy_poll;

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,10 @@ struct ixgbe_q_vector {
507507
struct ixgbe_ring_container rx, tx;
508508

509509
struct napi_struct napi;
510+
struct rcu_head rcu; /* to avoid race with update stats on free */
511+
510512
cpumask_t affinity_mask;
511513
int numa_node;
512-
struct rcu_head rcu; /* to avoid race with update stats on free */
513514
char name[IFNAMSIZ + 9];
514515

515516
/* for dynamic allocation of rings associated with this q_vector */

0 commit comments

Comments
 (0)