Skip to content

Commit

Permalink
vsock/virtio: use skb_frag_*() helpers
Browse files Browse the repository at this point in the history
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.

Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Link: https://lore.kernel.org/r/20240102205905.793738-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Mina Almasry authored and Jakub Kicinski committed Jan 4, 2024
1 parent 5304969 commit 06d9b44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/vmw_vsock/virtio_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
Expand Down

0 comments on commit 06d9b44

Please sign in to comment.