Skip to contentSkip to conversation

vhost: fix dirty page logging missing

PATCH Applied Marvin Liu 2 participants 3 messages Nov 4, 2019 – Nov 6, 2019

lore
Share & tools
lore

Marvin Liu

author
#0 lore raw

PATCH 1/1 vhost: fix dirty page logging missing

Packets data are directly copied when doing batch enqueue, add missed dirty page logging after memory copy.

Fixes ad3df6dcc0fc ("vhost: add packed ring batch enqueue")
---
 lib/librte_vhost/virtio_net.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_vhost/virtio_net.c +4 -0
index eae7825f0..0c33af7b1 100644
@@ -1107,6 +1107,10 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,
 			   pkts[i]->pkt_len);
 	}
 
+	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
+		vhost_log_cache_write_iova(dev, vq, descs[avail_idx + i].addr,
+					   lens[i]);
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		ids[i] = descs[avail_idx + i].id;
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Marvin Liu

Packets data are directly copied when doing batch enqueue, add missed dirty page logging after memory copy.

Fixes ad3df6dcc0fc ("vhost: add packed ring batch enqueue")
---
 lib/librte_vhost/virtio_net.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_vhost/virtio_net.c +0 -0
index eae7825f0..0c33af7b1 100644

lib/librte_vhost/virtio_net.c virtio_dev_rx_batch_packed(struct virtio_net *dev, · line 1116

Quoted 10 lines
lib/librte_vhost/virtio_net.c +4 -0
@@ -1107,6 +1107,10 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,
 			   pkts[i]->pkt_len);
 	}
 
+	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
+		vhost_log_cache_write_iova(dev, vq, descs[avail_idx + i].addr,
+					   lens[i]);
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		ids[i] = descs[avail_idx + i].id;
 

Thanks,
Maxime

#2 lore raw
In reply to Marvin Liu
Quoted 9 lines · Marvin Liu

Packets data are directly copied when doing batch enqueue, add missed dirty page logging after memory copy.

Fixes ad3df6dcc0fc ("vhost: add packed ring batch enqueue")
---
 lib/librte_vhost/virtio_net.c | 4 ++++
 1 file changed, 4 insertions(+)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime