netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff
@ 2023-12-04 15:01 Lorenzo Bianconi
  2023-12-05  0:26 ` Yunsheng Lin
  2023-12-06  3:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2023-12-04 15:01 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, lorenzo.bianconi, linyunsheng,
	alexander.duyck, aleksander.lobakin, liangchen.linux

Based on the previous allocated packet, page_offset can be not null
in veth_convert_skb_to_xdp_buff routine.
Take into account page fragment offset during the skb paged area copy
in veth_convert_skb_to_xdp_buff().

Fixes: 2d0de67da51a ("net: veth: use newly added page pool API for veth with xdp")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/veth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 57efb3454c57..977861c46b1f 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -790,7 +790,8 @@ static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
 
 			skb_add_rx_frag(nskb, i, page, page_offset, size,
 					truesize);
-			if (skb_copy_bits(skb, off, page_address(page),
+			if (skb_copy_bits(skb, off,
+					  page_address(page) + page_offset,
 					  size)) {
 				consume_skb(nskb);
 				goto drop;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff
  2023-12-04 15:01 [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff Lorenzo Bianconi
@ 2023-12-05  0:26 ` Yunsheng Lin
  2023-12-06  3:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yunsheng Lin @ 2023-12-05  0:26 UTC (permalink / raw)
  To: Lorenzo Bianconi, netdev
  Cc: davem, edumazet, kuba, pabeni, lorenzo.bianconi, alexander.duyck,
	aleksander.lobakin, liangchen.linux

On 2023/12/4 23:01, Lorenzo Bianconi wrote:
> Based on the previous allocated packet, page_offset can be not null
> in veth_convert_skb_to_xdp_buff routine.
> Take into account page fragment offset during the skb paged area copy
> in veth_convert_skb_to_xdp_buff().
> 
> Fixes: 2d0de67da51a ("net: veth: use newly added page pool API for veth with xdp")

LGTM.
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>

Thanks for the fix.

> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/veth.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 57efb3454c57..977861c46b1f 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -790,7 +790,8 @@ static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
>  
>  			skb_add_rx_frag(nskb, i, page, page_offset, size,
>  					truesize);
> -			if (skb_copy_bits(skb, off, page_address(page),
> +			if (skb_copy_bits(skb, off,
> +					  page_address(page) + page_offset,
>  					  size)) {
>  				consume_skb(nskb);
>  				goto drop;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff
  2023-12-04 15:01 [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff Lorenzo Bianconi
  2023-12-05  0:26 ` Yunsheng Lin
@ 2023-12-06  3:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-06  3:30 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: netdev, davem, edumazet, kuba, pabeni, lorenzo.bianconi,
	linyunsheng, alexander.duyck, aleksander.lobakin, liangchen.linux

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  4 Dec 2023 16:01:48 +0100 you wrote:
> Based on the previous allocated packet, page_offset can be not null
> in veth_convert_skb_to_xdp_buff routine.
> Take into account page fragment offset during the skb paged area copy
> in veth_convert_skb_to_xdp_buff().
> 
> Fixes: 2d0de67da51a ("net: veth: use newly added page pool API for veth with xdp")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff
    https://git.kernel.org/netdev/net/c/a61f46e11025

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] 3+ messages in thread

end of thread, other threads:[~2023-12-06  3:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 15:01 [PATCH net] net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff Lorenzo Bianconi
2023-12-05  0:26 ` Yunsheng Lin
2023-12-06  3:30 ` 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;
as well as URLs for NNTP newsgroup(s).