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 527685A72 for ; Fri, 9 Sep 2016 10:55:29 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 09 Sep 2016 01:55:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,304,1470726000"; d="scan'208";a="1047778126" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 09 Sep 2016 01:55:25 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 9 Sep 2016 01:54:53 -0700 Received: from bgsmsx151.gar.corp.intel.com (10.224.48.42) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 9 Sep 2016 01:54:52 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.182]) by BGSMSX151.gar.corp.intel.com ([169.254.3.213]) with mapi id 14.03.0248.002; Fri, 9 Sep 2016 14:24:50 +0530 From: "Yang, Zhiyong" To: "Van Haaren, Harry" , "dev@dpdk.org" CC: "yuanhan.liu@linux.intel.com" , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH v2] net/vhost: add pmd xstats Thread-Index: AQHSCnKpomteripApkeAP15w8lsg66Bwep2AgABd53A= Date: Fri, 9 Sep 2016 08:54:50 +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: 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: [10.223.10.10] 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:55:29 -0000 Hi, Harry: Your idea looks very good. Thanks --Zhiyong > -----Original Message----- > From: Van Haaren, Harry > Sent: Friday, September 9, 2016 4:41 PM > To: Yang, Zhiyong ; dev@dpdk.org > Cc: yuanhan.liu@linux.intel.com; thomas.monjalon@6wind.com; > "mailto:pmatilai"@redhat.com; Yang, Zhiyong > Subject: RE: [dpdk-dev] [PATCH v2] net/vhost: add pmd xstats >=20 > Hi Zhiyong, >=20 > > 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 > > > > +struct vhost_xstats { > > + uint64_t stat[16]; > > +}; >=20 > Perhaps we could create an enum to access the stat array? >=20 > enum VHOST_STAT { > ... > VHOST_STAT_64_PKT, > ... > }; >=20 > > + {"broadcast_packets", > > + offsetof(struct vhost_queue, xstats.stat[8])}, >=20 > I think the "magic number" 8 here could be from the enum, and would be > more clear which statistic is being accessed. >=20 > > + if (pkt_len =3D=3D 64) { > > + xstats_update->stat[1]++; >=20 > Similarly, incrementing the counters would be more representative if it > looked like >=20 > xstats_update->stat[VHOST_STAT_64_PKT]++; /* or similar */ >=20 > -Harry