Hello,

I noticed tx packet count /dashboard/traces/ in OSv GUI is not consistent 
with actual packet count that observed by packet capturing. 
The virtio_net_tx_packet query reports packet count, however, even though 
the GUI is frequently updating, the count is as low as zero, except when 
responding to a new page request. (attached file is a screenshot to show 
that)

I've found that `void net::txq::xmit_one_locked(void* _req)` seems not to 
always be called in every time packet is sent. Occasionally `mbuf* 
net::txq::offload(mbuf* m, net_hdr* hdr)` is called instead.

I think packet counting macro (trace_virtio_net_tx_packet()) should be 
called also in net::txq::offload() like patch below. With this patch, it 
seems to be reporting actual packet count for me.

How do you think whether this quick hack is ok?


diff --git a/drivers/virtio-net.cc b/drivers/virtio-net.cc
index dc31e81..2edd4f4 100644
--- a/drivers/virtio-net.cc
+++ b/drivers/virtio-net.cc
@@ -748,6 +748,8 @@ mbuf* net::txq::offload(mbuf* m, net_hdr* hdr)
         eth_type = ntohs(evh->evl_proto);
     }
 
+    trace_virtio_net_tx_packet(_parent->_ifn->if_index, 
vqueue->_sg_vec.size());
+
     switch (eth_type) {
     case ETHERTYPE_IP:
         if (m->m_hdr.mh_len < ip_offset + (int)sizeof(struct ip)) {

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to