[PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization

Michal Luczaj posted 7 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
Posted by Michal Luczaj 3 months, 2 weeks ago
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
Re: [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
Posted by Simon Horman 3 months, 2 weeks ago
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.
Re: [PATCH net-next 6/7] net: splice: Drop nr_pages_max initialization
Posted by Michal Luczaj 3 months, 2 weeks ago
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