From 64a7619ee82a8215db060bcf9b6e04fed51f794f Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Fri, 26 Feb 2016 18:01:23 +0300 Subject: [PATCH] virtio: remove broadcast packets from multicast statistics Signed-off-by: Igor Ryzhov Acked-by: Harry van Haaren Acked-by: Yuanhan Liu Applied with coding standards fixes: Signed-off-by: Bruce Richardson --- drivers/net/virtio/virtio_rxtx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index a7a58be630..12da0aa839 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -557,8 +557,12 @@ virtio_update_packet_stats(struct virtqueue *vq, struct rte_mbuf *mbuf) } ea = rte_pktmbuf_mtod(mbuf, struct ether_addr *); - vq->multicast += is_multicast_ether_addr(ea); - vq->broadcast += is_broadcast_ether_addr(ea); + if (is_multicast_ether_addr(ea)) { + if (is_broadcast_ether_addr(ea)) + vq->broadcast++; + else + vq->multicast++; + } } #define VIRTIO_MBUF_BURST_SZ 64 -- 2.20.1