[dpdk-dev] [PATCH v4 2/2] net/vhost: add pmd xstats

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Sep 21 12:57:09 CEST 2016


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]++;
> +	}
> +}
> +


More information about the dev mailing list