* [PATCH] vhost-net: initialize zcopy packet counters
@ 2012-12-03 17:31 Michael S. Tsirkin
2012-12-03 18:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2012-12-03 17:31 UTC (permalink / raw)
To: davem; +Cc: Michael S. Tsirkin, kvm, virtualization, netdev, linux-kernel
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.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/vhost/net.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 67898fa..ff6c9199 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -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);
--
MST
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vhost-net: initialize zcopy packet counters
2012-12-03 17:31 [PATCH] vhost-net: initialize zcopy packet counters Michael S. Tsirkin
@ 2012-12-03 18:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-12-03 18:42 UTC (permalink / raw)
To: mst; +Cc: kvm, virtualization, netdev, linux-kernel
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 3 Dec 2012 19:31:51 +0200
> 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.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-03 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-03 17:31 [PATCH] vhost-net: initialize zcopy packet counters Michael S. Tsirkin
2012-12-03 18:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).