Sasha Levin
2020-May-14 18:50 UTC
[PATCH AUTOSEL 5.6 13/62] vhost/vsock: fix packet delivery order to monitoring devices
From: Stefano Garzarella <sgarzare at redhat.com> [ Upstream commit 107bc0766b9feb5113074c753735a3f115c2141f ] We want to deliver packets to monitoring devices before it is put in the virtqueue, to avoid that replies can appear in the packet capture before the transmitted packet. Signed-off-by: Stefano Garzarella <sgarzare at redhat.com> Signed-off-by: David S. Miller <davem at davemloft.net> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/vhost/vsock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb3f63386b475..53294c2f8cff4 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -181,14 +181,14 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, break; } - vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len); - added = true; - - /* Deliver to monitoring devices all correctly transmitted - * packets. + /* Deliver to monitoring devices all packets that we + * will transmit. */ virtio_transport_deliver_tap_pkt(pkt); + vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len); + added = true; + pkt->off += payload_len; total_len += payload_len; -- 2.20.1
Reasonably Related Threads
- [PATCH AUTOSEL 5.6 111/606] vhost/vsock: fix packet delivery order to monitoring devices
- [PATCH AUTOSEL 5.4 12/49] vhost/vsock: fix packet delivery order to monitoring devices
- [PATCH AUTOSEL 4.19 10/31] vhost/vsock: fix packet delivery order to monitoring devices
- [PATCH AUTOSEL 4.14 17/39] vhost/vsock: fix packet delivery order to monitoring devices
- [PATCH net v2 1/2] vhost/vsock: fix packet delivery order to monitoring devices