From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A029A1C52 for ; Thu, 29 Sep 2016 14:38:08 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 29 Sep 2016 05:38:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,415,1470726000"; d="scan'208";a="885063274" Received: from dpdk2.bj.intel.com ([172.16.182.65]) by orsmga003.jf.intel.com with ESMTP; 29 Sep 2016 05:38:06 -0700 From: Zhiyong Yang To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, ciara.loftus@intel.com Date: Thu, 29 Sep 2016 20:35:47 +0800 Message-Id: <1475152549-12295-1-git-send-email-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1475069208-137698-2-git-send-email-zhiyong.yang@intel.com> References: <1475069208-137698-2-git-send-email-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH v8 0/2] net/vhost: add pmd xstats support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2016 12:38:09 -0000 Patch 1 moves all stats counters to a new defined struct vhost_stats, in order to manage all stats counters in a consistent way. Patch 2 adds the pmd xstats support from per port perspective. RX/TX xstats count the byte without CRC. Changes in V8: Patch 1 fix the build error. Changes in V7: Patch 2 Removed the "_portX" prepend to the xstat names. Keep vhost xstats name consistent with physical NIC i40e, ixgbe, etc. Changes in V6: Patch 2: 1. Change xstats from per queue to per port. Keep vhost consistent with physical NIC i40e, ixgbe, etc. 2. Added the release note. Changes in V5: Patch 2: for vhost_count_multicast_broadcast, passing struct rte_mbuf *buf instead of struct rte_mbuf **buf and remove the 3th parameter uint16_t count;. Changes in v4: Patch 1: A queue can be only used as TX or RX, So, we can use pkts instead of rx_pkts and tx_pkts, the same to rx_bytes and tx_bytes. Before modification: struct vhost_stats { uint64_t rx_pkts; uint64_t tx_pkts; uint64_t missed_pkts; uint64_t rx_bytes; uint64_t tx_bytes; }; New struct vhost_stats definition as follows: struct vhost_stats { uint64_t pkts; uint64_t bytes; uint64_t missed_pkts; }; Patch 2: 1. add a member VHOST_XSTATS_MAX in enum vhost_xstats_pkts, So, we can define uint64_t xstats[VHOST_XSTATS_MAX]; instead of xstats[16]. 2. restore unicast_packets and update it in the function vhost_dev_xstats_get 3. move the loop out of function vhost_count_multicast_broadcast in order to reduce the computation. Changes in v3: 1. rework the vhost_update_packet_xstats and separate it into two parts. One function deals with the generic packets update, another one deals with increasing the broadcast and multicast with failure packets sent according to RFC2863 page42 ifHCOutMulticastPkts ifHCOutBroadcastPkts. 2. define enum vhost_stat_pkts to replace the magic numbers and enhance the code readability. 3. remove some unnecessary type casts and fix one format issue. Changes in v2: 1. remove the compiling switch. 2. fix two code bugs. --- Zhiyong Yang (2): net/vhost: add a new defined stats struct net/vhost: add pmd xstats doc/guides/rel_notes/release_16_11.rst | 3 + drivers/net/vhost/rte_eth_vhost.c | 312 ++++++++++++++++++++++++++++++--- 2 files changed, 295 insertions(+), 20 deletions(-) -- 2.5.5