diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2020-04-24 18:08:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 18:37:32 +0300 |
commit | b6067828fd4aad5a6c24882a0f429260942e745c (patch) | |
tree | 72f4ae7b3fbbd483171a38863f98bb2d81e88085 /drivers | |
parent | 96fc3559de8d439a2f5032993442b55869f0c05c (diff) | |
download | linux-b6067828fd4aad5a6c24882a0f429260942e745c.tar.xz |
vhost/vsock: fix packet delivery order to monitoring devices
[ 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@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vhost/vsock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bac1365cc81b..7891bd40ebd8 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -182,14 +182,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; |