DPDK patches and discussions
 help / color / mirror / Atom feed
From: Igor Ryzhov <iryzhov@nfware.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] virtio: don't count broadcast packets in multicast packets counter
Date: Fri, 26 Feb 2016 18:01:23 +0300	[thread overview]
Message-ID: <1456498883-58648-1-git-send-email-iryzhov@nfware.com> (raw)

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
 drivers/net/virtio/virtio_rxtx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 41a1366..fe18e1d 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -543,8 +543,13 @@ 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.6.4

             reply	other threads:[~2016-02-26 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 15:01 Igor Ryzhov [this message]
2016-02-26 15:14 ` Van Haaren, Harry
2016-02-29  3:52 ` Yuanhan Liu
2016-03-09 15:12 ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456498883-58648-1-git-send-email-iryzhov@nfware.com \
    --to=iryzhov@nfware.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).