net/virtio: avoid double accounting of bytes

Message ID 20181220105624.31046-1-jfreimann@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/virtio: avoid double accounting of bytes |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Jens Freimann Dec. 20, 2018, 10:56 a.m. UTC
  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 <jfreimann@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Maxime Coquelin Dec. 20, 2018, 6:01 p.m. UTC | #1
On 12/20/18 11:56 AM, Jens Freimann wrote:
> 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 <jfreimann@redhat.com>
> ---
>   drivers/net/virtio/virtio_rxtx.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
> index 8564f18a7..8a08606fb 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -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 <maxime.coquelin@redhat.com>

Maxime
  
Maxime Coquelin Dec. 20, 2018, 6:20 p.m. UTC | #2
On 12/20/18 11:56 AM, Jens Freimann wrote:
> 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 <jfreimann@redhat.com>
> ---
>   drivers/net/virtio/virtio_rxtx.c | 1 -
>   1 file changed, 1 deletion(-)
> 


Applied to dpdk-next-virtio.

Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 8564f18a7..8a08606fb 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -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);
 	}