Skip to content

Commit a055d3b

Browse files
committed
Merge branch 'wireguard-fixes-for-6-17-rc6'
Jason A. Donenfeld says: ==================== wireguard fixes for 6.17-rc6 Please find three small fixes to wireguard: 1) A general simplification to the way wireguard chooses the next available cpu, by making use of cpumask_nth(), and covering an edge case. 2) A cleanup to the selftests kconfig. 3) A fix to the selftests kconfig so that it actually runs again. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 4094920 + ff78bfe commit a055d3b

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

drivers/net/wireguard/queueing.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,11 @@ static inline void wg_reset_packet(struct sk_buff *skb, bool encapsulating)
104104

105105
static inline int wg_cpumask_choose_online(int *stored_cpu, unsigned int id)
106106
{
107-
unsigned int cpu = *stored_cpu, cpu_index, i;
107+
unsigned int cpu = *stored_cpu;
108+
109+
while (unlikely(cpu >= nr_cpu_ids || !cpu_online(cpu)))
110+
cpu = *stored_cpu = cpumask_nth(id % num_online_cpus(), cpu_online_mask);
108111

109-
if (unlikely(cpu >= nr_cpu_ids ||
110-
!cpumask_test_cpu(cpu, cpu_online_mask))) {
111-
cpu_index = id % cpumask_weight(cpu_online_mask);
112-
cpu = cpumask_first(cpu_online_mask);
113-
for (i = 0; i < cpu_index; ++i)
114-
cpu = cpumask_next(cpu, cpu_online_mask);
115-
*stored_cpu = cpu;
116-
}
117112
return cpu;
118113
}
119114

tools/testing/selftests/wireguard/qemu/kernel.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ CONFIG_NETFILTER_XTABLES_LEGACY=y
2020
CONFIG_NETFILTER_XT_NAT=y
2121
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
2222
CONFIG_NETFILTER_XT_MARK=y
23-
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m
24-
CONFIG_IP_NF_TARGET_REJECT=m
25-
CONFIG_IP6_NF_TARGET_REJECT=m
23+
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
24+
CONFIG_IP_NF_TARGET_REJECT=y
25+
CONFIG_IP6_NF_TARGET_REJECT=y
26+
CONFIG_IP_NF_IPTABLES_LEGACY=y
2627
CONFIG_IP_NF_IPTABLES=y
2728
CONFIG_IP_NF_FILTER=y
2829
CONFIG_IP_NF_MANGLE=y
@@ -48,7 +49,6 @@ CONFIG_JUMP_LABEL=y
4849
CONFIG_FUTEX=y
4950
CONFIG_SHMEM=y
5051
CONFIG_SLUB=y
51-
CONFIG_SPARSEMEM_VMEMMAP=y
5252
CONFIG_SMP=y
5353
CONFIG_SCHED_SMT=y
5454
CONFIG_SCHED_MC=y

0 commit comments

Comments
 (0)