* [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c
@ 2025-06-24 9:53 Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 1/7] net: splice: Drop unused @pipe Michal Luczaj
` (6 more replies)
0 siblings, 7 replies; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Couple of cleanup patches to get rid of unused function parameters around
skbuff.c.
Offshot of my question in [1], but way more contained. Found by adding
"-Wunused-parameter -Wno-error" to KBUILD_CFLAGS and grepping for specific
skbuff.c warnings.
[1]: https://lore.kernel.org/netdev/972af569-0c90-4585-9e1f-f2266dab6ec6@rbox.co/
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
Michal Luczaj (7):
net: splice: Drop unused @pipe
net: splice: Drop unused @flags
tcp: Drop tcp_splice_state::flags
af_unix: Drop unix_stream_read_state::splice_flags
net: splice: Drop unused @gfp
net: splice: Drop nr_pages_max initialization
net: skbuff: Drop unused @skb
.../chelsio/inline_crypto/chtls/chtls_io.c | 3 +-
include/linux/skbuff.h | 5 ++--
net/core/skbuff.c | 32 ++++++++--------------
net/ipv4/ip_output.c | 3 +-
net/ipv4/tcp.c | 7 ++---
net/ipv6/ip6_output.c | 3 +-
net/kcm/kcmsock.c | 5 ++--
net/tls/tls_sw.c | 2 +-
net/unix/af_unix.c | 7 ++---
9 files changed, 24 insertions(+), 43 deletions(-)
---
base-commit: ee1a0c653f9cad7e2634a39f6c530e12edddf0fc
change-id: 20250618-splice-drop-unused-0e4ea8a12681
Best regards,
--
Michal Luczaj <mhal@rbox.co>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH net-next 1/7] net: splice: Drop unused @pipe
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:07 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 2/7] net: splice: Drop unused @flags Michal Luczaj
` (5 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since commit 41c73a0d44c9 ("net: speedup skb_splice_bits()"),
__splice_segment() and spd_fill_page() do not use the @pipe argument. Drop
it.
While adapting the callers, move one line to enforce reverse xmas tree
order.
No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/core/skbuff.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d6420b74ea9c6a9c53a7c16634cce82a1cd1bbd3..ae0f1aae3c91d914020c64e0703732b9c6cd8511 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3060,10 +3060,8 @@ static bool spd_can_coalesce(const struct splice_pipe_desc *spd,
/*
* Fill page/offset/length into spd, if it can hold more pages.
*/
-static bool spd_fill_page(struct splice_pipe_desc *spd,
- struct pipe_inode_info *pipe, struct page *page,
- unsigned int *len, unsigned int offset,
- bool linear,
+static bool spd_fill_page(struct splice_pipe_desc *spd, struct page *page,
+ unsigned int *len, unsigned int offset, bool linear,
struct sock *sk)
{
if (unlikely(spd->nr_pages == MAX_SKB_FRAGS))
@@ -3091,8 +3089,7 @@ static bool __splice_segment(struct page *page, unsigned int poff,
unsigned int plen, unsigned int *off,
unsigned int *len,
struct splice_pipe_desc *spd, bool linear,
- struct sock *sk,
- struct pipe_inode_info *pipe)
+ struct sock *sk)
{
if (!*len)
return true;
@@ -3111,8 +3108,7 @@ static bool __splice_segment(struct page *page, unsigned int poff,
do {
unsigned int flen = min(*len, plen);
- if (spd_fill_page(spd, pipe, page, &flen, poff,
- linear, sk))
+ if (spd_fill_page(spd, page, &flen, poff, linear, sk))
return true;
poff += flen;
plen -= flen;
@@ -3130,8 +3126,8 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
unsigned int *offset, unsigned int *len,
struct splice_pipe_desc *spd, struct sock *sk)
{
- int seg;
struct sk_buff *iter;
+ int seg;
/* map the linear part :
* If skb->head_frag is set, this 'linear' part is backed by a
@@ -3143,7 +3139,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
skb_headlen(skb),
offset, len, spd,
skb_head_is_locked(skb),
- sk, pipe))
+ sk))
return true;
/*
@@ -3160,7 +3156,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
if (__splice_segment(skb_frag_page(f),
skb_frag_off(f), skb_frag_size(f),
- offset, len, spd, false, sk, pipe))
+ offset, len, spd, false, sk))
return true;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 2/7] net: splice: Drop unused @flags
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 1/7] net: splice: Drop unused @pipe Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags Michal Luczaj
` (4 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since commit 79fddc4efd5d ("new helper: add_to_pipe()") which removed
`spd->flags` check in splice_to_pipe(), skb_splice_bits() does not use the
@flags argument.
Remove it and adapt callers. No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
include/linux/skbuff.h | 3 +--
net/core/skbuff.c | 3 +--
net/ipv4/tcp.c | 2 +-
net/kcm/kcmsock.c | 2 +-
net/tls/tls_sw.c | 2 +-
net/unix/af_unix.c | 2 +-
6 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4f6dcb37bae8ada524a1e8f8de44c259cfac695b..5b6f460c69b277124e788cfa0599486522e62c9c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -4157,8 +4157,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
int len);
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
- struct pipe_inode_info *pipe, unsigned int len,
- unsigned int flags);
+ struct pipe_inode_info *pipe, unsigned int len);
int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset,
int len);
int skb_send_sock_locked_with_flags(struct sock *sk, struct sk_buff *skb,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ae0f1aae3c91d914020c64e0703732b9c6cd8511..02ead44a82bb71d30d294a6931943d07cf7c7177 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3181,8 +3181,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
* the fragments, and the frag list.
*/
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
- struct pipe_inode_info *pipe, unsigned int tlen,
- unsigned int flags)
+ struct pipe_inode_info *pipe, unsigned int tlen)
{
struct partial_page partial[MAX_SKB_FRAGS];
struct page *pages[MAX_SKB_FRAGS];
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8a3c99246d2ed32ba45849b56830bf128e265763..46997793d87ab40dcd1e1dd041e4641e287e1b7e 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -766,7 +766,7 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
int ret;
ret = skb_splice_bits(skb, skb->sk, offset, tss->pipe,
- min(rd_desc->count, len), tss->flags);
+ min(rd_desc->count, len));
if (ret > 0)
rd_desc->count -= ret;
return ret;
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 24aec295a51cf737912f1aefe81556bd9f23331e..8140c9c9cc2cb7aa71eaceab8a019d882bc454aa 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1043,7 +1043,7 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos,
if (len > stm->full_len)
len = stm->full_len;
- copied = skb_splice_bits(skb, sk, stm->offset, pipe, len, flags);
+ copied = skb_splice_bits(skb, sk, stm->offset, pipe, len);
if (copied < 0) {
err = copied;
goto err_out;
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index fc88e34b7f33fefed8aa3c26e1f6eed07cd20853..5bca6cfce749aa9fd64da764b2a0d6a4c936efac 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2266,7 +2266,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
}
chunk = min_t(unsigned int, rxm->full_len, len);
- copied = skb_splice_bits(skb, sk, rxm->offset, pipe, chunk, flags);
+ copied = skb_splice_bits(skb, sk, rxm->offset, pipe, chunk);
if (copied < 0)
goto splice_requeue;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 1e320f89168d1cd4b5e8fa56565cce9f008ab857..235319a045a1238cf27791dfefa9e61b4a593551 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -3070,7 +3070,7 @@ static int unix_stream_splice_actor(struct sk_buff *skb,
{
return skb_splice_bits(skb, state->socket->sk,
UNIXCB(skb).consumed + skip,
- state->pipe, chunk, state->splice_flags);
+ state->pipe, chunk);
}
static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos,
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 1/7] net: splice: Drop unused @pipe Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 2/7] net: splice: Drop unused @flags Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since skb_splice_bits() does not accept @flags anymore, struct's field
became unused. Remove it.
No functional change indented.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/ipv4/tcp.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 46997793d87ab40dcd1e1dd041e4641e287e1b7e..b6285fb1369d32541b9f7d660ca33389b7e4da61 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -324,7 +324,6 @@ EXPORT_IPV6_MOD(tcp_sockets_allocated);
struct tcp_splice_state {
struct pipe_inode_info *pipe;
size_t len;
- unsigned int flags;
};
/*
@@ -803,7 +802,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
struct tcp_splice_state tss = {
.pipe = pipe,
.len = len,
- .flags = flags,
};
long timeo;
ssize_t spliced;
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (2 preceding siblings ...)
2025-06-24 9:53 ` [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 5/7] net: splice: Drop unused @gfp Michal Luczaj
` (2 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since skb_splice_bits() does not accept the @flags argument anymore,
struct's field became unused. Remove it.
No functional change indented.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/unix/af_unix.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 235319a045a1238cf27791dfefa9e61b4a593551..1e3a4db1a96a57c84c199e30c164f66409b04be4 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2674,7 +2674,6 @@ struct unix_stream_read_state {
struct pipe_inode_info *pipe;
size_t size;
int flags;
- unsigned int splice_flags;
};
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
@@ -3082,7 +3081,6 @@ static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos,
.socket = sock,
.pipe = pipe,
.size = size,
- .splice_flags = flags,
};
if (unlikely(*ppos))
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 5/7] net: splice: Drop unused @gfp
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (3 preceding siblings ...)
2025-06-24 9:53 ` [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:07 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 7/7] net: skbuff: Drop unused @skb Michal Luczaj
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since its introduction in commit 2e910b95329c ("net: Add a function to
splice pages into an skbuff for MSG_SPLICE_PAGES"), skb_splice_from_iter()
never used the @gfp argument. Remove it and adapt callers.
No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 3 +--
include/linux/skbuff.h | 2 +-
net/core/skbuff.c | 3 +--
net/ipv4/ip_output.c | 3 +--
net/ipv4/tcp.c | 3 +--
net/ipv6/ip6_output.c | 3 +--
net/kcm/kcmsock.c | 3 +--
net/unix/af_unix.c | 3 +--
8 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
index d567e42e176011d42b9549d0cc6292a06126d61d..465fa807796439b90c949f54e203a798f06acf1f 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
@@ -1096,8 +1096,7 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
copy = size;
if (msg->msg_flags & MSG_SPLICE_PAGES) {
- err = skb_splice_from_iter(skb, &msg->msg_iter, copy,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, copy);
if (err < 0) {
if (err == -EMSGSIZE)
goto new_buf;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5b6f460c69b277124e788cfa0599486522e62c9c..4952a6991c720a5001477a77d252567aa2c15ac2 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -5264,7 +5264,7 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb)
}
ssize_t skb_splice_from_iter(struct sk_buff *skb, struct iov_iter *iter,
- ssize_t maxsize, gfp_t gfp);
+ ssize_t maxsize);
#endif /* __KERNEL__ */
#endif /* _LINUX_SKBUFF_H */
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 02ead44a82bb71d30d294a6931943d07cf7c7177..c381a097aa6e087d1b5934f2d193a896a255bf83 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -7229,7 +7229,6 @@ static void skb_splice_csum_page(struct sk_buff *skb, struct page *page,
* @skb: The buffer to add pages to
* @iter: Iterator representing the pages to be added
* @maxsize: Maximum amount of pages to be added
- * @gfp: Allocation flags
*
* This is a common helper function for supporting MSG_SPLICE_PAGES. It
* extracts pages from an iterator and adds them to the socket buffer if
@@ -7240,7 +7239,7 @@ static void skb_splice_csum_page(struct sk_buff *skb, struct page *page,
* insufficient space in the buffer to transfer anything.
*/
ssize_t skb_splice_from_iter(struct sk_buff *skb, struct iov_iter *iter,
- ssize_t maxsize, gfp_t gfp)
+ ssize_t maxsize)
{
size_t frag_limit = READ_ONCE(net_hotdata.sysctl_max_skb_frags);
struct page *pages[8], **ppages = pages;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index a2705d454fd645b442b2901833afa51b26512512..5d75d60efcf361ed9c3b34eaa982f6c667c716f6 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1222,8 +1222,7 @@ static int __ip_append_data(struct sock *sk,
if (WARN_ON_ONCE(copy > msg->msg_iter.count))
goto error;
- err = skb_splice_from_iter(skb, &msg->msg_iter, copy,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, copy);
if (err < 0)
goto error;
copy = err;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b6285fb1369d32541b9f7d660ca33389b7e4da61..9d41113e3a68455f3cc7e067d72f3aa2485a21f2 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1295,8 +1295,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
if (!copy)
goto wait_for_space;
- err = skb_splice_from_iter(skb, &msg->msg_iter, copy,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, copy);
if (err < 0) {
if (err == -EMSGSIZE) {
tcp_mark_push(tp, skb);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7bd29a9ff0db8d74c79f50afa5c693231e0f82d5..618ed7d72b28f43ab6d7a02e5f8f53a4d22de87a 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1760,8 +1760,7 @@ static int __ip6_append_data(struct sock *sk,
if (WARN_ON_ONCE(copy > msg->msg_iter.count))
goto error;
- err = skb_splice_from_iter(skb, &msg->msg_iter, copy,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, copy);
if (err < 0)
goto error;
copy = err;
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 8140c9c9cc2cb7aa71eaceab8a019d882bc454aa..71fedf9cfac85b7cbcd8fd3dbacd74440fa556f4 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -835,8 +835,7 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
if (!sk_wmem_schedule(sk, copy))
goto wait_for_memory;
- err = skb_splice_from_iter(skb, &msg->msg_iter, copy,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, copy);
if (err < 0) {
if (err == -EMSGSIZE)
goto wait_for_memory;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 1e3a4db1a96a57c84c199e30c164f66409b04be4..c2d1a547b14650b53d16c18f239aeb7c5f50cc96 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2377,8 +2377,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
if (unlikely(msg->msg_flags & MSG_SPLICE_PAGES)) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
- err = skb_splice_from_iter(skb, &msg->msg_iter, size,
- sk->sk_allocation);
+ err = skb_splice_from_iter(skb, &msg->msg_iter, size);
if (err < 0)
goto out_free;
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (4 preceding siblings ...)
2025-06-24 9:53 ` [PATCH net-next 5/7] net: splice: Drop unused @gfp Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 7/7] net: skbuff: Drop unused @skb Michal Luczaj
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
splice_pipe_desc::nr_pages_max was initialized unnecessary in commit
41c73a0d44c9 ("net: speedup skb_splice_bits()"). spd_fill_page() compares
spd->nr_pages against a constant MAX_SKB_FRAGS, which makes setting
nr_pages_max redundant.
Remove the assignment. No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
Probably the same thing in net/smc/smc_rx.c:smc_rx_splice()?
---
net/core/skbuff.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c381a097aa6e087d1b5934f2d193a896a255bf83..b4f7843430a3f8f84aed387bf41ae761d97687ad 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3188,7 +3188,6 @@ int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
struct splice_pipe_desc spd = {
.pages = pages,
.partial = partial,
- .nr_pages_max = MAX_SKB_FRAGS,
.ops = &nosteal_pipe_buf_ops,
.spd_release = sock_spd_release,
};
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 7/7] net: skbuff: Drop unused @skb
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (5 preceding siblings ...)
2025-06-24 9:53 ` [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization Michal Luczaj
@ 2025-06-24 9:53 ` Michal Luczaj
2025-06-25 10:07 ` Simon Horman
6 siblings, 1 reply; 16+ messages in thread
From: Michal Luczaj @ 2025-06-24 9:53 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Neal Cardwell, Kuniyuki Iwashima, David Ahern,
Boris Pismenny, John Fastabend, Ayush Sawal, Andrew Lunn
Cc: netdev, linux-kernel, Michal Luczaj
Since its introduction in commit ce098da1497c ("skbuff: Introduce
slab_build_skb()"), __slab_build_skb() never used the @skb argument. Remove
it and adapt both callers.
No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/core/skbuff.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b4f7843430a3f8f84aed387bf41ae761d97687ad..b5f685b6611c177c199f70bb16fd3940bce8cded 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -384,8 +384,7 @@ static inline void __finalize_skb_around(struct sk_buff *skb, void *data,
skb_set_kcov_handle(skb, kcov_common_handle());
}
-static inline void *__slab_build_skb(struct sk_buff *skb, void *data,
- unsigned int *size)
+static inline void *__slab_build_skb(void *data, unsigned int *size)
{
void *resized;
@@ -418,7 +417,7 @@ struct sk_buff *slab_build_skb(void *data)
return NULL;
memset(skb, 0, offsetof(struct sk_buff, tail));
- data = __slab_build_skb(skb, data, &size);
+ data = __slab_build_skb(data, &size);
__finalize_skb_around(skb, data, size);
return skb;
@@ -435,7 +434,7 @@ static void __build_skb_around(struct sk_buff *skb, void *data,
* using slab buffer should use slab_build_skb() instead.
*/
if (WARN_ONCE(size == 0, "Use slab_build_skb() instead"))
- data = __slab_build_skb(skb, data, &size);
+ data = __slab_build_skb(data, &size);
__finalize_skb_around(skb, data, size);
}
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
2025-06-24 9:53 ` [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization Michal Luczaj
@ 2025-06-25 10:06 ` Simon Horman
2025-06-25 21:43 ` Michal Luczaj
0 siblings, 1 reply; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:06 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:53AM +0200, Michal Luczaj wrote:
> splice_pipe_desc::nr_pages_max was initialized unnecessary in commit
> 41c73a0d44c9 ("net: speedup skb_splice_bits()"). spd_fill_page() compares
> spd->nr_pages against a constant MAX_SKB_FRAGS, which makes setting
> nr_pages_max redundant.
>
> Remove the assignment. No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
> ---
> Probably the same thing in net/smc/smc_rx.c:smc_rx_splice()?
Yes, it seems so to me.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 2/7] net: splice: Drop unused @flags
2025-06-24 9:53 ` [PATCH net-next 2/7] net: splice: Drop unused @flags Michal Luczaj
@ 2025-06-25 10:06 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:06 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:49AM +0200, Michal Luczaj wrote:
> Since commit 79fddc4efd5d ("new helper: add_to_pipe()") which removed
> `spd->flags` check in splice_to_pipe(), skb_splice_bits() does not use the
> @flags argument.
>
> Remove it and adapt callers. No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags
2025-06-24 9:53 ` [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags Michal Luczaj
@ 2025-06-25 10:06 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:06 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:50AM +0200, Michal Luczaj wrote:
> Since skb_splice_bits() does not accept @flags anymore, struct's field
> became unused. Remove it.
>
> No functional change indented.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags
2025-06-24 9:53 ` [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
@ 2025-06-25 10:06 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:06 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:51AM +0200, Michal Luczaj wrote:
> Since skb_splice_bits() does not accept the @flags argument anymore,
> struct's field became unused. Remove it.
>
> No functional change indented.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 5/7] net: splice: Drop unused @gfp
2025-06-24 9:53 ` [PATCH net-next 5/7] net: splice: Drop unused @gfp Michal Luczaj
@ 2025-06-25 10:07 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:07 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:52AM +0200, Michal Luczaj wrote:
> Since its introduction in commit 2e910b95329c ("net: Add a function to
> splice pages into an skbuff for MSG_SPLICE_PAGES"), skb_splice_from_iter()
> never used the @gfp argument. Remove it and adapt callers.
>
> No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 1/7] net: splice: Drop unused @pipe
2025-06-24 9:53 ` [PATCH net-next 1/7] net: splice: Drop unused @pipe Michal Luczaj
@ 2025-06-25 10:07 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:07 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:48AM +0200, Michal Luczaj wrote:
> Since commit 41c73a0d44c9 ("net: speedup skb_splice_bits()"),
> __splice_segment() and spd_fill_page() do not use the @pipe argument. Drop
> it.
>
> While adapting the callers, move one line to enforce reverse xmas tree
> order.
>
> No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 7/7] net: skbuff: Drop unused @skb
2025-06-24 9:53 ` [PATCH net-next 7/7] net: skbuff: Drop unused @skb Michal Luczaj
@ 2025-06-25 10:07 ` Simon Horman
0 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2025-06-25 10:07 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On Tue, Jun 24, 2025 at 11:53:54AM +0200, Michal Luczaj wrote:
> Since its introduction in commit ce098da1497c ("skbuff: Introduce
> slab_build_skb()"), __slab_build_skb() never used the @skb argument. Remove
> it and adapt both callers.
>
> No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
2025-06-25 10:06 ` Simon Horman
@ 2025-06-25 21:43 ` Michal Luczaj
0 siblings, 0 replies; 16+ messages in thread
From: Michal Luczaj @ 2025-06-25 21:43 UTC (permalink / raw)
To: Simon Horman
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, netdev, linux-kernel
On 6/25/25 12:06, Simon Horman wrote:
> On Tue, Jun 24, 2025 at 11:53:53AM +0200, Michal Luczaj wrote:
>> splice_pipe_desc::nr_pages_max was initialized unnecessary in commit
>> 41c73a0d44c9 ("net: speedup skb_splice_bits()"). spd_fill_page() compares
>> spd->nr_pages against a constant MAX_SKB_FRAGS, which makes setting
>> nr_pages_max redundant.
>>
>> Remove the assignment. No functional change intended.
>>
>> Signed-off-by: Michal Luczaj <mhal@rbox.co>
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
>> ---
>> Probably the same thing in net/smc/smc_rx.c:smc_rx_splice()?
>
> Yes, it seems so to me.
OK, tomorrow I'll post v2 with smc_rx_splice() taken care of.
Thanks,
Michal
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-06-25 21:44 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 9:53 [PATCH net-next 0/7] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 1/7] net: splice: Drop unused @pipe Michal Luczaj
2025-06-25 10:07 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 2/7] net: splice: Drop unused @flags Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 3/7] tcp: Drop tcp_splice_state::flags Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 4/7] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 5/7] net: splice: Drop unused @gfp Michal Luczaj
2025-06-25 10:07 ` Simon Horman
2025-06-24 9:53 ` [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization Michal Luczaj
2025-06-25 10:06 ` Simon Horman
2025-06-25 21:43 ` Michal Luczaj
2025-06-24 9:53 ` [PATCH net-next 7/7] net: skbuff: Drop unused @skb Michal Luczaj
2025-06-25 10:07 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).