Skip to contentSkip to conversation

vhost-net: initialize zcopy packet counters

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Dec 3, 2012

Subsystems (5)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 vhost-net: initialize zcopy packet counters

These packet counters are used to drive the zercopy selection heuristic so nothing too bad happens if they are off a bit - and they are also reset once in a while.
But it's cleaner to clear them when backend is set so that we start in a known state.

---
 drivers/vhost/net.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/vhost/net.c +3 -0
index 67898fa..ff6c9199 100644
@@ -823,6 +823,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
 		r = vhost_init_used(vq);
 		if (r)
 			goto err_vq;
+
+		n->tx_packets = 0;
+		n->tx_zcopy_err = 0;
 	}
 
 	mutex_unlock(&vq->mutex);
Signature · 1 line
MST
maintainer Applied
#1 lore raw

From: "Michael S. Tsirkin" <[email protected]>
Date: Mon, 3 Dec 2012 19:31:51 +0200

Quoted 7 lines

These packet counters are used to drive the zercopy selection heuristic so nothing too bad happens if they are off a bit - and they are also reset once in a while.
But it's cleaner to clear them when backend is set so that we start in a known state.

Applied to net-next, thanks.