Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2024-01-02 Thread Stefano Garzarella

On Wed, Dec 20, 2023 at 01:45:00PM -0800, Mina Almasry wrote:

Minor fix for virtio: code wanting to access the fields inside an skb
frag should use the skb_frag_*() helpers, instead of accessing the
fields directly. This allows for extensions where the underlying
memory is not a page.

Signed-off-by: Mina Almasry 

---

v2:

- Also fix skb_frag_off() + skb_frag_size() (David)
- Did not apply the reviewed-by from Stefano since the patch changed
relatively much.


Sorry for the delay, I was off.

LGTM!

Acked-by: Stefano Garzarella 

Possibly we can also send this patch alone if the series is still under
discussion because it's definitely an improvement to the current code.

Thanks,
Stefano



---
net/vmw_vsock/virtio_transport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index f495b9e5186b..1748268e0694 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -153,10 +153,10 @@ virtio_transport_send_pkt_work(struct work_struct *work)
 * 'virt_to_phys()' later to fill the buffer 
descriptor.
 * We don't touch memory at "virtual" address 
of this page.
 */
-   va = page_to_virt(skb_frag->bv_page);
+   va = page_to_virt(skb_frag_page(skb_frag));
sg_init_one(sgs[out_sg],
-   va + skb_frag->bv_offset,
-   skb_frag->bv_len);
+   va + skb_frag_off(skb_frag),
+   skb_frag_size(skb_frag));
out_sg++;
}
}
--
2.43.0.472.g3155946c3a-goog






Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2023-12-21 Thread Shakeel Butt
On Wed, Dec 20, 2023 at 1:45 PM Mina Almasry  wrote:
>
> Minor fix for virtio: code wanting to access the fields inside an skb
> frag should use the skb_frag_*() helpers, instead of accessing the
> fields directly. This allows for extensions where the underlying
> memory is not a page.
>
> Signed-off-by: Mina Almasry 

Reviewed-by: Shakeel Butt 



Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2023-12-21 Thread Willem de Bruijn
Mina Almasry wrote:
> Minor fix for virtio: code wanting to access the fields inside an skb
> frag should use the skb_frag_*() helpers, instead of accessing the
> fields directly. This allows for extensions where the underlying
> memory is not a page.
> 
> Signed-off-by: Mina Almasry 
> 
> ---
> 
> v2:
> 
> - Also fix skb_frag_off() + skb_frag_size() (David)
> - Did not apply the reviewed-by from Stefano since the patch changed
> relatively much.
> 
> ---
>  net/vmw_vsock/virtio_transport.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/vmw_vsock/virtio_transport.c 
> b/net/vmw_vsock/virtio_transport.c
> index f495b9e5186b..1748268e0694 100644
> --- a/net/vmw_vsock/virtio_transport.c
> +++ b/net/vmw_vsock/virtio_transport.c
> @@ -153,10 +153,10 @@ virtio_transport_send_pkt_work(struct work_struct *work)
>* 'virt_to_phys()' later to fill the buffer 
> descriptor.
>* We don't touch memory at "virtual" address 
> of this page.
>*/
> - va = page_to_virt(skb_frag->bv_page);
> + va = page_to_virt(skb_frag_page(skb_frag));
>   sg_init_one(sgs[out_sg],
> - va + skb_frag->bv_offset,
> - skb_frag->bv_len);
> + va + skb_frag_off(skb_frag),
> + skb_frag_size(skb_frag));
>   out_sg++;
>   }
>   }

If there are requests for further revision in the series, can send
this virtio cleanup on its own to get it off the stack.

> -- 
> 2.43.0.472.g3155946c3a-goog
> 





[PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2023-12-20 Thread Mina Almasry
Minor fix for virtio: code wanting to access the fields inside an skb
frag should use the skb_frag_*() helpers, instead of accessing the
fields directly. This allows for extensions where the underlying
memory is not a page.

Signed-off-by: Mina Almasry 

---

v2:

- Also fix skb_frag_off() + skb_frag_size() (David)
- Did not apply the reviewed-by from Stefano since the patch changed
relatively much.

---
 net/vmw_vsock/virtio_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index f495b9e5186b..1748268e0694 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -153,10 +153,10 @@ virtio_transport_send_pkt_work(struct work_struct *work)
 * 'virt_to_phys()' later to fill the buffer 
descriptor.
 * We don't touch memory at "virtual" address 
of this page.
 */
-   va = page_to_virt(skb_frag->bv_page);
+   va = page_to_virt(skb_frag_page(skb_frag));
sg_init_one(sgs[out_sg],
-   va + skb_frag->bv_offset,
-   skb_frag->bv_len);
+   va + skb_frag_off(skb_frag),
+   skb_frag_size(skb_frag));
out_sg++;
}
}
-- 
2.43.0.472.g3155946c3a-goog