On Mon, Sep 11, 2023 at 11:22:32PM +0300, Arseniy Krasnov wrote:
For non-linear skb use its pages from fragment array as buffers in virtio tx queue. These pages are already pinned by 'get_user_pages()' during such skb creation. Signed-off-by: Arseniy Krasnov <avkrasnov@xxxxxxxxxxxxxxxxx> --- Changelog: v2 -> v3: * Comment about 'page_to_virt()' is updated. I don't remove R-b, as this change is quiet small I guess. v6 -> v7: * Move arrays '*sgs' and 'bufs' to 'virtio_vsock' instead of being local variables. This allows to save stack space in cases of too big MAX_SKB_FRAGS. * Add 'WARN_ON_ONCE()' for handling nonlinear skbs - it checks that linear part of such skb contains only header. * R-b tag removed due to updates above. v7 -> v8: * Add comment in 'struct virtio_vsock' for both 'struct scatterlist' fields. * Rename '*sgs' and 'bufs' to '*out_sgs' and 'out_bufs'. * Initialize '*out_sgs' in 'virtio_vsock_probe()' by always pointing to the corresponding element of 'out_bufs'.
LGTM, thanks for addressing that comments!
net/vmw_vsock/virtio_transport.c | 60 ++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 7 deletions(-)
Reviewed-by: Stefano Garzarella <sgarzare@xxxxxxxxxx> _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization