Commit b6067828 authored by Stefano Garzarella's avatar Stefano Garzarella Committed by Greg Kroah-Hartman

vhost/vsock: fix packet delivery order to monitoring devices

[ Upstream commit 107bc076 ]

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: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 96fc3559
...@@ -182,14 +182,14 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, ...@@ -182,14 +182,14 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
break; break;
} }
vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len); /* Deliver to monitoring devices all packets that we
added = true; * will transmit.
/* Deliver to monitoring devices all correctly transmitted
* packets.
*/ */
virtio_transport_deliver_tap_pkt(pkt); virtio_transport_deliver_tap_pkt(pkt);
vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len);
added = true;
pkt->off += payload_len; pkt->off += payload_len;
total_len += payload_len; total_len += payload_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment