From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v4 2/2] net/vhost: add pmd xstats Date: Wed, 21 Sep 2016 18:57:09 +0800 Message-ID: <20160921105709.GE23158@yliu-dev.sh.intel.com> References: <1474364205-111569-2-git-send-email-zhiyong.yang@intel.com> <1474452355-57106-1-git-send-email-zhiyong.yang@intel.com> <1474452355-57106-3-git-send-email-zhiyong.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, harry.van.haaren@intel.com, thomas.monjalon@6wind.com, pmatilai@redhat.com To: Zhiyong Yang Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id F2DB2374E for ; Wed, 21 Sep 2016 12:56:41 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1474452355-57106-3-git-send-email-zhiyong.yang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Sep 21, 2016 at 06:05:55PM +0800, Zhiyong Yang wrote: > +static inline void > +vhost_count_multicast_broadcast(struct vhost_queue *vq, > + struct rte_mbuf **bufs, > + uint16_t count) Hmm.. why not just passing "struct rte_mbuf *mbuf"? --yliu > +{ > + struct ether_addr *ea = NULL; > + struct vhost_stats *pstats = &vq->stats; > + > + ea = rte_pktmbuf_mtod(bufs[count], struct ether_addr *); > + if (is_multicast_ether_addr(ea)) { > + if (is_broadcast_ether_addr(ea)) > + pstats->xstats[VHOST_BROADCAST_PKT]++; > + else > + pstats->xstats[VHOST_MULTICAST_PKT]++; > + } > +} > +