* [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
@ 2025-06-26 8:33 Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 1/9] net: splice: Drop unused @pipe Michal Luczaj
` (9 more replies)
0 siblings, 10 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
Couple of cleanup patches to get rid of unused function parameters around
skbuff.c, plus little things spotted along the way.
Offshoot 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>
---
Changes in v2:
- Fix typos in commit messages
- Remove one more unused parameter in skbuff.c (patch 9)
- Collect R-b, add a one-line cleanup of smc_rx_splice() (patch 7) [Simon]
- Link to v1: https://lore.kernel.org/r/20250624-splice-drop-unused-v1-0-cf641a676d04@rbox.co
---
Michal Luczaj (9):
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/smc: Drop nr_pages_max initialization
net: skbuff: Drop unused @skb
net: skbuff: Drop unused @skb
.../chelsio/inline_crypto/chtls/chtls_io.c | 3 +-
include/linux/skbuff.h | 5 ++-
net/core/skbuff.c | 37 ++++++++--------------
net/ipv4/ip_output.c | 3 +-
net/ipv4/tcp.c | 7 ++--
net/ipv6/ip6_output.c | 3 +-
net/kcm/kcmsock.c | 5 ++-
net/smc/smc_rx.c | 1 -
net/tls/tls_sw.c | 2 +-
net/unix/af_unix.c | 7 ++--
10 files changed, 26 insertions(+), 47 deletions(-)
---
base-commit: a9b24b3583ae1da7dbda031f141264f2da260219
change-id: 20250618-splice-drop-unused-0e4ea8a12681
Best regards,
--
Michal Luczaj <mhal@rbox.co>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next v2 1/9] net: splice: Drop unused @pipe
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 2/9] net: splice: Drop unused @flags Michal Luczaj
` (8 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, 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.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 2/9] net: splice: Drop unused @flags
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 1/9] net: splice: Drop unused @pipe Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 3/9] tcp: Drop tcp_splice_state::flags Michal Luczaj
` (7 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, 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.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 3/9] tcp: Drop tcp_splice_state::flags
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 1/9] net: splice: Drop unused @pipe Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 2/9] net: splice: Drop unused @flags Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 4/9] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
` (6 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
Since skb_splice_bits() does not accept @flags anymore, struct's field
became unused. Remove it.
No functional change indented.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 4/9] af_unix: Drop unix_stream_read_state::splice_flags
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (2 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 3/9] tcp: Drop tcp_splice_state::flags Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 5/9] net: splice: Drop unused @gfp Michal Luczaj
` (5 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
Since skb_splice_bits() does not accept the @flags argument anymore,
struct's field became unused. Remove it.
No functional change indented.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 5/9] net: splice: Drop unused @gfp
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (3 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 4/9] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 6/9] net: splice: Drop nr_pages_max initialization Michal Luczaj
` (4 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, 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.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 6/9] net: splice: Drop nr_pages_max initialization
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (4 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 5/9] net: splice: Drop unused @gfp Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
` (3 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
splice_pipe_desc::nr_pages_max was initialized unnecessarily 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.
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
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] 19+ messages in thread
* [PATCH net-next v2 7/9] net/smc: Drop nr_pages_max initialization
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (5 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 6/9] net: splice: Drop nr_pages_max initialization Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 13:25 ` Sidraya Jayagond
` (2 more replies)
2025-06-26 8:33 ` [PATCH net-next v2 8/9] net: skbuff: Drop unused @skb Michal Luczaj
` (2 subsequent siblings)
9 siblings, 3 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
splice_pipe_desc::nr_pages_max was initialized unnecessarily in
commit b8d199451c99 ("net/smc: Allow virtually contiguous sndbufs or RMBs
for SMC-R"). Struct's field is unused in this context.
Remove the assignment. No functional change intended.
Suggested-by: Simon Horman <horms@kernel.org>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/smc/smc_rx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
index e7f1134453ef40dd81a9574d6df4ead95acd8ae5..bbba5d4dc7eb0dbb31a9800023b0caab33e87842 100644
--- a/net/smc/smc_rx.c
+++ b/net/smc/smc_rx.c
@@ -202,7 +202,6 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
offset = 0;
}
}
- spd.nr_pages_max = nr_pages;
spd.nr_pages = nr_pages;
spd.pages = pages;
spd.partial = partial;
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH net-next v2 8/9] net: skbuff: Drop unused @skb
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (6 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 9/9] " Michal Luczaj
2025-07-01 1:18 ` [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Jakub Kicinski
9 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, 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.
Reviewed-by: Simon Horman <horms@kernel.org>
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] 19+ messages in thread
* [PATCH net-next v2 9/9] net: skbuff: Drop unused @skb
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (7 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 8/9] net: skbuff: Drop unused @skb Michal Luczaj
@ 2025-06-26 8:33 ` Michal Luczaj
2025-06-26 11:19 ` Simon Horman
2025-07-01 1:18 ` [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Jakub Kicinski
9 siblings, 1 reply; 19+ messages in thread
From: Michal Luczaj @ 2025-06-26 8:33 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,
Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390, Michal Luczaj
Since its introduction in commit 6fa01ccd8830 ("skbuff: Add pskb_extract()
helper function"), pskb_carve_frag_list() never used the argument @skb.
Drop it and adapt the only caller.
No functional change intended.
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
net/core/skbuff.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b5f685b6611c177c199f70bb16fd3940bce8cded..f8553c674fe5052e7c1ea53022e252a54a9d6c72 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6756,8 +6756,7 @@ static int pskb_carve(struct sk_buff *skb, const u32 off, gfp_t gfp);
/* carve out the first eat bytes from skb's frag_list. May recurse into
* pskb_carve()
*/
-static int pskb_carve_frag_list(struct sk_buff *skb,
- struct skb_shared_info *shinfo, int eat,
+static int pskb_carve_frag_list(struct skb_shared_info *shinfo, int eat,
gfp_t gfp_mask)
{
struct sk_buff *list = shinfo->frag_list;
@@ -6862,7 +6861,7 @@ static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,
skb_clone_fraglist(skb);
/* split line is in frag list */
- if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) {
+ if (k == 0 && pskb_carve_frag_list(shinfo, off - pos, gfp_mask)) {
/* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */
if (skb_has_frag_list(skb))
kfree_skb_list(skb_shinfo(skb)->frag_list);
--
2.49.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 9/9] net: skbuff: Drop unused @skb
2025-06-26 8:33 ` [PATCH net-next v2 9/9] " Michal Luczaj
@ 2025-06-26 11:19 ` Simon Horman
0 siblings, 0 replies; 19+ messages in thread
From: Simon Horman @ 2025-06-26 11:19 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, Wenjia Zhang,
Jan Karcher, D. Wythe, Tony Lu, Wen Gu, netdev, linux-kernel,
linux-rdma, linux-s390
On Thu, Jun 26, 2025 at 10:33:42AM +0200, Michal Luczaj wrote:
> Since its introduction in commit 6fa01ccd8830 ("skbuff: Add pskb_extract()
> helper function"), pskb_carve_frag_list() never used the argument @skb.
> Drop it and adapt the only caller.
>
> No functional change intended.
>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 7/9] net/smc: Drop nr_pages_max initialization
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
@ 2025-06-26 13:25 ` Sidraya Jayagond
2025-06-27 11:45 ` Simon Horman
2025-06-27 12:59 ` Dust Li
2 siblings, 0 replies; 19+ messages in thread
From: Sidraya Jayagond @ 2025-06-26 13:25 UTC (permalink / raw)
To: Michal Luczaj, 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, Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390
On 26/06/25 2:03 pm, Michal Luczaj wrote:
> splice_pipe_desc::nr_pages_max was initialized unnecessarily in
> commit b8d199451c99 ("net/smc: Allow virtually contiguous sndbufs or RMBs
> for SMC-R"). Struct's field is unused in this context.
>
> Remove the assignment. No functional change intended.
>
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
> ---
> net/smc/smc_rx.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
> index e7f1134453ef40dd81a9574d6df4ead95acd8ae5..bbba5d4dc7eb0dbb31a9800023b0caab33e87842 100644
> --- a/net/smc/smc_rx.c
> +++ b/net/smc/smc_rx.c
> @@ -202,7 +202,6 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
> offset = 0;
> }
> }
> - spd.nr_pages_max = nr_pages;
> spd.nr_pages = nr_pages;
> spd.pages = pages;
> spd.partial = partial;
>
LGTM.
Reviewed-by: Sidraya Jayagond <sidraya@linux.ibm.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 7/9] net/smc: Drop nr_pages_max initialization
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
2025-06-26 13:25 ` Sidraya Jayagond
@ 2025-06-27 11:45 ` Simon Horman
2025-06-27 12:59 ` Dust Li
2 siblings, 0 replies; 19+ messages in thread
From: Simon Horman @ 2025-06-27 11:45 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, Wenjia Zhang,
Jan Karcher, D. Wythe, Tony Lu, Wen Gu, netdev, linux-kernel,
linux-rdma, linux-s390
On Thu, Jun 26, 2025 at 10:33:40AM +0200, Michal Luczaj wrote:
> splice_pipe_desc::nr_pages_max was initialized unnecessarily in
> commit b8d199451c99 ("net/smc: Allow virtually contiguous sndbufs or RMBs
> for SMC-R"). Struct's field is unused in this context.
>
> Remove the assignment. No functional change intended.
>
> Suggested-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 7/9] net/smc: Drop nr_pages_max initialization
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
2025-06-26 13:25 ` Sidraya Jayagond
2025-06-27 11:45 ` Simon Horman
@ 2025-06-27 12:59 ` Dust Li
2 siblings, 0 replies; 19+ messages in thread
From: Dust Li @ 2025-06-27 12:59 UTC (permalink / raw)
To: Michal Luczaj, 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, Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu, Wen Gu
Cc: netdev, linux-kernel, linux-rdma, linux-s390
On 2025-06-26 10:33:40, Michal Luczaj wrote:
>splice_pipe_desc::nr_pages_max was initialized unnecessarily in
>commit b8d199451c99 ("net/smc: Allow virtually contiguous sndbufs or RMBs
>for SMC-R"). Struct's field is unused in this context.
>
>Remove the assignment. No functional change intended.
>
>Suggested-by: Simon Horman <horms@kernel.org>
>Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
>---
> net/smc/smc_rx.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
>index e7f1134453ef40dd81a9574d6df4ead95acd8ae5..bbba5d4dc7eb0dbb31a9800023b0caab33e87842 100644
>--- a/net/smc/smc_rx.c
>+++ b/net/smc/smc_rx.c
>@@ -202,7 +202,6 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,
> offset = 0;
> }
> }
>- spd.nr_pages_max = nr_pages;
> spd.nr_pages = nr_pages;
> spd.pages = pages;
> spd.partial = partial;
>
>--
>2.49.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
` (8 preceding siblings ...)
2025-06-26 8:33 ` [PATCH net-next v2 9/9] " Michal Luczaj
@ 2025-07-01 1:18 ` Jakub Kicinski
2025-07-01 7:27 ` Michal Luczaj
9 siblings, 1 reply; 19+ messages in thread
From: Jakub Kicinski @ 2025-07-01 1:18 UTC (permalink / raw)
To: Michal Luczaj
Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, Wenjia Zhang,
Jan Karcher, D. Wythe, Tony Lu, Wen Gu, netdev, linux-kernel,
linux-rdma, linux-s390
On Thu, 26 Jun 2025 10:33:33 +0200 Michal Luczaj wrote:
> Couple of cleanup patches to get rid of unused function parameters around
> skbuff.c, plus little things spotted along the way.
>
> Offshoot 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.
I feel a little ambivalent about the removal of the flags arguments.
I understand that they are unused now, but theoretically the operation
as a whole has flags so it's not crazy to pass them along.. Dunno.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
2025-07-01 1:18 ` [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Jakub Kicinski
@ 2025-07-01 7:27 ` Michal Luczaj
2025-07-01 9:02 ` Paolo Abeni
0 siblings, 1 reply; 19+ messages in thread
From: Michal Luczaj @ 2025-07-01 7:27 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, Wenjia Zhang,
Jan Karcher, D. Wythe, Tony Lu, Wen Gu, netdev, linux-kernel,
linux-rdma, linux-s390
On 7/1/25 03:18, Jakub Kicinski wrote:
> On Thu, 26 Jun 2025 10:33:33 +0200 Michal Luczaj wrote:
>> Couple of cleanup patches to get rid of unused function parameters around
>> skbuff.c, plus little things spotted along the way.
>>
>> Offshoot 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.
>
> I feel a little ambivalent about the removal of the flags arguments.
> I understand that they are unused now, but theoretically the operation
> as a whole has flags so it's not crazy to pass them along.. Dunno.
I suspect you can say the same about @gfp. Even though they've both became
irrelevant for the functions that define them. But I understand your
hesitation. Should I post v3 without this/these changes?
What's netdev's stance on using __always_unused in such cases?
Thanks,
Michal
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
2025-07-01 7:27 ` Michal Luczaj
@ 2025-07-01 9:02 ` Paolo Abeni
2025-07-01 23:52 ` Jakub Kicinski
0 siblings, 1 reply; 19+ messages in thread
From: Paolo Abeni @ 2025-07-01 9:02 UTC (permalink / raw)
To: Michal Luczaj, Jakub Kicinski
Cc: David S. Miller, Eric Dumazet, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, David Ahern, Boris Pismenny, John Fastabend,
Ayush Sawal, Andrew Lunn, Wenjia Zhang, Jan Karcher, D. Wythe,
Tony Lu, Wen Gu, netdev, linux-kernel, linux-rdma, linux-s390
On 7/1/25 9:27 AM, Michal Luczaj wrote:
> On 7/1/25 03:18, Jakub Kicinski wrote:
>> On Thu, 26 Jun 2025 10:33:33 +0200 Michal Luczaj wrote:
>>> Couple of cleanup patches to get rid of unused function parameters around
>>> skbuff.c, plus little things spotted along the way.
>>>
>>> Offshoot 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.
>>
>> I feel a little ambivalent about the removal of the flags arguments.
>> I understand that they are unused now, but theoretically the operation
>> as a whole has flags so it's not crazy to pass them along.. Dunno.
>
> I suspect you can say the same about @gfp. Even though they've both became
> irrelevant for the functions that define them. But I understand your
> hesitation. Should I post v3 without this/these changes?
Yes please, I think it would make the series less controversial.
Also I feel like the gfp flag removal is less controversial, as is IMHO
reasonable that skb_splice_from_iter() would not allocate any memory.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
2025-07-01 9:02 ` Paolo Abeni
@ 2025-07-01 23:52 ` Jakub Kicinski
2025-07-02 13:44 ` Michal Luczaj
0 siblings, 1 reply; 19+ messages in thread
From: Jakub Kicinski @ 2025-07-01 23:52 UTC (permalink / raw)
To: Paolo Abeni
Cc: Michal Luczaj, David S. Miller, Eric Dumazet, Simon Horman,
Neal Cardwell, Kuniyuki Iwashima, David Ahern, Boris Pismenny,
John Fastabend, Ayush Sawal, Andrew Lunn, Wenjia Zhang,
Jan Karcher, D. Wythe, Tony Lu, Wen Gu, netdev, linux-kernel,
linux-rdma, linux-s390
On Tue, 1 Jul 2025 11:02:50 +0200 Paolo Abeni wrote:
> >> I feel a little ambivalent about the removal of the flags arguments.
> >> I understand that they are unused now, but theoretically the operation
> >> as a whole has flags so it's not crazy to pass them along.. Dunno.
> >
> > I suspect you can say the same about @gfp. Even though they've both became
> > irrelevant for the functions that define them. But I understand your
> > hesitation. Should I post v3 without this/these changes?
>
> Yes please, I think it would make the series less controversial.
>
> Also I feel like the gfp flag removal is less controversial, as is IMHO
> reasonable that skb_splice_from_iter() would not allocate any memory.
+1, FWIW, gfp flags are more as need be the callee.
> > What's netdev's stance on using __always_unused in such cases?
Subjectively, I find the unused argument warnings in the kernel
to usually be counter-productive. If a maintainer of a piece of code
wants to clean them up -- perfectly fine. But taking cleanup patches
and annotating with __always_unused doesn't see very productive.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c
2025-07-01 23:52 ` Jakub Kicinski
@ 2025-07-02 13:44 ` Michal Luczaj
0 siblings, 0 replies; 19+ messages in thread
From: Michal Luczaj @ 2025-07-02 13:44 UTC (permalink / raw)
To: Jakub Kicinski, Paolo Abeni
Cc: David S. Miller, Eric Dumazet, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, David Ahern, Boris Pismenny, John Fastabend,
Ayush Sawal, Andrew Lunn, Wenjia Zhang, Jan Karcher, D. Wythe,
Tony Lu, Wen Gu, netdev, linux-kernel, linux-rdma, linux-s390
On 7/2/25 01:52, Jakub Kicinski wrote:
> On Tue, 1 Jul 2025 11:02:50 +0200 Paolo Abeni wrote:
>>>> I feel a little ambivalent about the removal of the flags arguments.
>>>> I understand that they are unused now, but theoretically the operation
>>>> as a whole has flags so it's not crazy to pass them along.. Dunno.
>>>
>>> I suspect you can say the same about @gfp. Even though they've both became
>>> irrelevant for the functions that define them. But I understand your
>>> hesitation. Should I post v3 without this/these changes?
>>
>> Yes please, I think it would make the series less controversial.
>>
>> Also I feel like the gfp flag removal is less controversial, as is IMHO
>> reasonable that skb_splice_from_iter() would not allocate any memory.
>
> +1, FWIW, gfp flags are more as need be the callee.
OK, here's v3 with @flags untouched:
https://lore.kernel.org/netdev/20250702-splice-drop-unused-v3-0-55f68b60d2b7@rbox.co/
>>> What's netdev's stance on using __always_unused in such cases?
>
> Subjectively, I find the unused argument warnings in the kernel
> to usually be counter-productive. If a maintainer of a piece of code
> wants to clean them up -- perfectly fine. But taking cleanup patches
> and annotating with __always_unused doesn't see very productive.
Go it, thanks.
Michal
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-07-02 13:45 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 8:33 [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 1/9] net: splice: Drop unused @pipe Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 2/9] net: splice: Drop unused @flags Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 3/9] tcp: Drop tcp_splice_state::flags Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 4/9] af_unix: Drop unix_stream_read_state::splice_flags Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 5/9] net: splice: Drop unused @gfp Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 6/9] net: splice: Drop nr_pages_max initialization Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 7/9] net/smc: " Michal Luczaj
2025-06-26 13:25 ` Sidraya Jayagond
2025-06-27 11:45 ` Simon Horman
2025-06-27 12:59 ` Dust Li
2025-06-26 8:33 ` [PATCH net-next v2 8/9] net: skbuff: Drop unused @skb Michal Luczaj
2025-06-26 8:33 ` [PATCH net-next v2 9/9] " Michal Luczaj
2025-06-26 11:19 ` Simon Horman
2025-07-01 1:18 ` [PATCH net-next v2 0/9] net: Remove unused function parameters in skbuff.c Jakub Kicinski
2025-07-01 7:27 ` Michal Luczaj
2025-07-01 9:02 ` Paolo Abeni
2025-07-01 23:52 ` Jakub Kicinski
2025-07-02 13:44 ` Michal Luczaj
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).