* [PATCH] tcp: use kvmalloc_array() for BPF iterator batches
@ 2026-07-16 2:51 Weimin Xiong
2026-07-27 22:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Weimin Xiong @ 2026-07-16 2:51 UTC (permalink / raw)
To: Eric Dumazet, Neal Cardwell, Kuniyuki Iwashima
Cc: netdev, linux-kernel, David S . Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, Weimin Xiong
Use kvmalloc_array() instead of open-coding the element-size
multiplication when allocating the TCP BPF iterator batch.
Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
---
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 209ef7522..d184893e5 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2926,8 +2926,8 @@ static int bpf_iter_tcp_realloc_batch(struct bpf_tcp_iter_state *iter,
{
union bpf_tcp_iter_batch_item *new_batch;
- new_batch = kvmalloc(sizeof(*new_batch) * new_batch_sz,
- flags | __GFP_NOWARN);
+ new_batch = kvmalloc_array(new_batch_sz, sizeof(*new_batch),
+ flags | __GFP_NOWARN);
if (!new_batch)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] tcp: use kvmalloc_array() for BPF iterator batches
2026-07-16 2:51 [PATCH] tcp: use kvmalloc_array() for BPF iterator batches Weimin Xiong
@ 2026-07-27 22:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-27 22:40 UTC (permalink / raw)
To: Weimin Xiong
Cc: edumazet, ncardwell, kuniyu, netdev, linux-kernel, davem, kuba,
pabeni, horms
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Thu, 16 Jul 2026 10:51:02 +0800 you wrote:
> Use kvmalloc_array() instead of open-coding the element-size
> multiplication when allocating the TCP BPF iterator batch.
>
> Signed-off-by: Weimin Xiong <xiongwm2026@163.com>
> ---
Here is the summary with links:
- tcp: use kvmalloc_array() for BPF iterator batches
https://git.kernel.org/bpf/bpf-next/c/fcf741584a56
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] 2+ messages in thread
end of thread, other threads:[~2026-07-27 22:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 2:51 [PATCH] tcp: use kvmalloc_array() for BPF iterator batches Weimin Xiong
2026-07-27 22:40 ` 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