Skip to content

Commit ff3edc9

Browse files
arndbdavem330
authored andcommitted
hns_enet: use cpumask_var_t for on-stack mask
On large SMP builds, we can run into a build warning: drivers/net/ethernet/hisilicon/hns/hns_enet.c: In function 'hns_set_irq_affinity.isra.27': drivers/net/ethernet/hisilicon/hns/hns_enet.c:1242:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] The solution here is to use cpumask_var_t, which can use dynamic allocation when CONFIG_CPUMASK_OFFSTACK is enabled. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ceef438 commit ff3edc9

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

drivers/net/ethernet/hisilicon/hns/hns_enet.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,43 +1202,48 @@ static void hns_set_irq_affinity(struct hns_nic_priv *priv)
12021202
struct hns_nic_ring_data *rd;
12031203
int i;
12041204
int cpu;
1205-
cpumask_t mask;
1205+
cpumask_var_t mask;
1206+
1207+
if (!alloc_cpumask_var(&mask, GFP_KERNEL))
1208+
return;
12061209

12071210
/*diffrent irq banlance for 16core and 32core*/
12081211
if (h->q_num == num_possible_cpus()) {
12091212
for (i = 0; i < h->q_num * 2; i++) {
12101213
rd = &priv->ring_data[i];
12111214
if (cpu_online(rd->queue_index)) {
1212-
cpumask_clear(&mask);
1215+
cpumask_clear(mask);
12131216
cpu = rd->queue_index;
1214-
cpumask_set_cpu(cpu, &mask);
1217+
cpumask_set_cpu(cpu, mask);
12151218
(void)irq_set_affinity_hint(rd->ring->irq,
1216-
&mask);
1219+
mask);
12171220
}
12181221
}
12191222
} else {
12201223
for (i = 0; i < h->q_num; i++) {
12211224
rd = &priv->ring_data[i];
12221225
if (cpu_online(rd->queue_index * 2)) {
1223-
cpumask_clear(&mask);
1226+
cpumask_clear(mask);
12241227
cpu = rd->queue_index * 2;
1225-
cpumask_set_cpu(cpu, &mask);
1228+
cpumask_set_cpu(cpu, mask);
12261229
(void)irq_set_affinity_hint(rd->ring->irq,
1227-
&mask);
1230+
mask);
12281231
}
12291232
}
12301233

12311234
for (i = h->q_num; i < h->q_num * 2; i++) {
12321235
rd = &priv->ring_data[i];
12331236
if (cpu_online(rd->queue_index * 2 + 1)) {
1234-
cpumask_clear(&mask);
1237+
cpumask_clear(mask);
12351238
cpu = rd->queue_index * 2 + 1;
1236-
cpumask_set_cpu(cpu, &mask);
1239+
cpumask_set_cpu(cpu, mask);
12371240
(void)irq_set_affinity_hint(rd->ring->irq,
1238-
&mask);
1241+
mask);
12391242
}
12401243
}
12411244
}
1245+
1246+
free_cpumask_var(mask);
12421247
}
12431248

12441249
static int hns_nic_init_irq(struct hns_nic_priv *priv)

0 commit comments

Comments
 (0)