* [PATCH net-next] net: unify alloclen calculation for paged requests
@ 2022-08-25 12:06 Pavel Begunkov
2022-08-30 10:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2022-08-25 12:06 UTC (permalink / raw)
To: netdev; +Cc: David S . Miller, Jakub Kicinski, Pavel Begunkov,
Willem de Bruijn
Consolidate alloclen and pagedlen calculation for zerocopy and normal
paged requests. The current non-zerocopy paged version can a bit
overallocate and unnecessary copy a small chunk of data into the linear
part.
Cc: Willem de Bruijn <willemb@google•com>
Link: https://lore.kernel.org/netdev/CA+FuTSf0+cJ9_N_xrHmCGX_KoVCWcE0YQBdtgEkzGvcLMSv7Qw@mail.gmail.com/
Signed-off-by: Pavel Begunkov <asml.silence@gmail•com>
---
net/ipv4/ip_output.c | 5 +----
net/ipv6/ip6_output.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index d7bd1daf022b..14f7c4dadbf3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1109,10 +1109,7 @@ static int __ip_append_data(struct sock *sk,
(fraglen + alloc_extra < SKB_MAX_ALLOC ||
!(rt->dst.dev->features & NETIF_F_SG)))
alloclen = fraglen;
- else if (!zc) {
- alloclen = min_t(int, fraglen, MAX_HEADER);
- pagedlen = fraglen - alloclen;
- } else {
+ else {
alloclen = fragheaderlen + transhdrlen;
pagedlen = datalen - transhdrlen;
}
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index f152e51242cb..a60176e913a8 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1648,10 +1648,7 @@ static int __ip6_append_data(struct sock *sk,
(fraglen + alloc_extra < SKB_MAX_ALLOC ||
!(rt->dst.dev->features & NETIF_F_SG)))
alloclen = fraglen;
- else if (!zc) {
- alloclen = min_t(int, fraglen, MAX_HEADER);
- pagedlen = fraglen - alloclen;
- } else {
+ else {
alloclen = fragheaderlen + transhdrlen;
pagedlen = datalen - transhdrlen;
}
--
2.37.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: unify alloclen calculation for paged requests
2022-08-25 12:06 [PATCH net-next] net: unify alloclen calculation for paged requests Pavel Begunkov
@ 2022-08-30 10:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-30 10:20 UTC (permalink / raw)
To: Pavel Begunkov; +Cc: netdev, davem, kuba, willemb
Hello:
This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat•com>:
On Thu, 25 Aug 2022 13:06:31 +0100 you wrote:
> Consolidate alloclen and pagedlen calculation for zerocopy and normal
> paged requests. The current non-zerocopy paged version can a bit
> overallocate and unnecessary copy a small chunk of data into the linear
> part.
>
> Cc: Willem de Bruijn <willemb@google•com>
> Link: https://lore.kernel.org/netdev/CA+FuTSf0+cJ9_N_xrHmCGX_KoVCWcE0YQBdtgEkzGvcLMSv7Qw@mail.gmail.com/
> Signed-off-by: Pavel Begunkov <asml.silence@gmail•com>
>
> [...]
Here is the summary with links:
- [net-next] net: unify alloclen calculation for paged requests
https://git.kernel.org/netdev/net-next/c/47cf88993c91
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:[~2022-08-30 10:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25 12:06 [PATCH net-next] net: unify alloclen calculation for paged requests Pavel Begunkov
2022-08-30 10:20 ` 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