From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B70A6548B for ; Fri, 9 Sep 2016 10:40:48 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 09 Sep 2016 01:40:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,304,1470726000"; d="scan'208";a="876778483" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga003.jf.intel.com with ESMTP; 09 Sep 2016 01:40:47 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.123]) by irsmsx110.ger.corp.intel.com ([169.254.15.113]) with mapi id 14.03.0248.002; Fri, 9 Sep 2016 09:40:45 +0100 From: "Van Haaren, Harry" To: "Yang, Zhiyong" , "dev@dpdk.org" CC: "yuanhan.liu@linux.intel.com" , "thomas.monjalon@6wind.com" , "\"mailto:pmatilai\"@redhat.com" <"mailto:pmatilai"@redhat.com>, "Yang, Zhiyong" Thread-Topic: [dpdk-dev] [PATCH v2] net/vhost: add pmd xstats Thread-Index: AQHSCnK5anZkcCRaqUi/LrgPYpx9saBw1Q+A Date: Fri, 9 Sep 2016 08:40:45 +0000 Message-ID: References: <1471608966-39077-1-git-send-email-zhiyong.yang@intel.com> <1473408927-40364-1-git-send-email-zhiyong.yang@intel.com> In-Reply-To: <1473408927-40364-1-git-send-email-zhiyong.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjc0MWFkN2ItNjg4OS00MzUxLTk5MzYtOTFjNmY2ODY3ZTZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpoNytIWUxtSHI2a1FtcTI0bGQ0ZmZlbmlseWdlWTBOb3B0WnFtYmVjMTg9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/vhost: add pmd xstats 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: Fri, 09 Sep 2016 08:40:49 -0000 Hi Zhiyong, > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2] net/vhost: add pmd xstats >=20 > +struct vhost_xstats { > + uint64_t stat[16]; > +}; Perhaps we could create an enum to access the stat array? enum VHOST_STAT { ... VHOST_STAT_64_PKT, ... }; > + {"broadcast_packets", > + offsetof(struct vhost_queue, xstats.stat[8])}, I think the "magic number" 8 here could be from the enum, and would be more= clear which statistic is being accessed. > + if (pkt_len =3D=3D 64) { > + xstats_update->stat[1]++; Similarly, incrementing the counters would be more representative if it loo= ked like xstats_update->stat[VHOST_STAT_64_PKT]++; /* or similar */ -Harry