net/virtio: avoid double accounting of bytes
PATCH 1/1 net/virtio: avoid double accounting of bytes
Accounting of bytes was moved to a common function, so at the moment we do it twice. This patches fixes it for sending packets with packed virtqueues.
Signed-off-by Jens Freimann <[email protected]>
--- drivers/net/virtio/virtio_rxtx.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/virtio/virtio_rxtx.c +0 -1
@@ -1931,7 +1931,6 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,/* Enqueue Packet buffers */ virtqueue_enqueue_xmit_packed (txvq, txm, slots, can_push); - txvq->stats.bytes += txm->pkt_len;virtio_update_packet_stats (&txvq->stats, txm); }
Signature · 1 line
2.17.2
Quoted 14 lines · Jens Freimann
Accounting of bytes was moved to a common function, so at the moment we do it twice. This patches fixes it for sending packets with packed virtqueues.
Signed-off-by Jens Freimann <[email protected]>--- drivers/net/virtio/virtio_rxtx.c | 1 - 1 file changed, 1 deletion(-)drivers/net/virtio/virtio_rxtx.c +0
-0
drivers/net/virtio/virtio_rxtx.c virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts, · line 1936
Quoted 7 lines
drivers/net/virtio/virtio_rxtx.c +0
-1@@ -1931,7 +1931,6 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,/* Enqueue Packet buffers */ virtqueue_enqueue_xmit_packed (txvq, txm, slots, can_push); - txvq->stats.bytes += txm->pkt_len;virtio_update_packet_stats (&txvq->stats, txm); }
Thanks Jens for the quick fix:
Reviewed-by Maxime Coquelin <[email protected]>
Maxime
Maxime Coquelin
AppliedQuoted 8 lines · Jens Freimann
Accounting of bytes was moved to a common function, so at the moment we do it twice. This patches fixes it for sending packets with packed virtqueues.
Signed-off-by Jens Freimann <[email protected]>--- drivers/net/virtio/virtio_rxtx.c | 1 - 1 file changed, 1 deletion(-)
Applied to dpdk-next-virtio.
Maxime