From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7A08A1094 for ; Tue, 17 Jan 2017 12:19:27 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP; 17 Jan 2017 03:19:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,244,1477983600"; d="scan'208";a="53935126" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga005.jf.intel.com with ESMTP; 17 Jan 2017 03:19:25 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.230]) by IRSMSX153.ger.corp.intel.com ([169.254.9.160]) with mapi id 14.03.0248.002; Tue, 17 Jan 2017 11:19:23 +0000 From: "Van Haaren, Harry" To: "Horton, Remy" , "dev@dpdk.org" CC: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v7 4/6] app/test-pmd: add bitrate statistics calculation Thread-Index: AQHScBSHNfs871iZfk+GJQ09RBMRb6E8hmOA Date: Tue, 17 Jan 2017 11:19:23 +0000 Message-ID: References: <1484583573-30163-1-git-send-email-remy.horton@intel.com> <1484583573-30163-5-git-send-email-remy.horton@intel.com> In-Reply-To: <1484583573-30163-5-git-send-email-remy.horton@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjE3N2VkNjUtOTU4Mi00MTg3LTg5OGMtN2Q4NDNmOTQ3YTE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImZEbGJQQTRuK0FqY2VKbkVQVkJNNjZON1VGVndBcFVHWGZyOTlnRFc2bzA9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 4/6] app/test-pmd: add bitrate statistics calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 11:19:28 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton > Sent: Monday, January 16, 2017 4:20 PM > To: dev@dpdk.org > Cc: Thomas Monjalon > Subject: [dpdk-dev] [PATCH v7 4/6] app/test-pmd: add bitrate statistics c= alculation >=20 > Calculate bitrate statistics using the bitrate stats library. The > resulting statistics can be viewed via proc_info. >=20 > Signed-off-by: Remy Horton Inline > --- > app/test-pmd/testpmd.c | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) >=20 License year update, 2016 to 2017. Rest of changes looks good to me. > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index bfb2f8e..a0b7430 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -79,6 +79,10 @@ > #include > #endif > #include > +#include > +#ifdef RTE_LIBRTE_BITRATE > +#include > +#endif >=20 > #include "testpmd.h" >=20 > @@ -323,6 +327,9 @@ uint16_t nb_rx_queue_stats_mappings =3D 0; >=20 > unsigned max_socket =3D 0; >=20 > +/* Bitrate statistics */ > +struct rte_stats_bitrates_s *bitrate_data; > + > /* Forward function declarations */ > static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rt= e_port *port); > static void check_all_ports_link_status(uint32_t port_mask); > @@ -922,12 +929,32 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_f= wd_t pkt_fwd) > struct fwd_stream **fsm; > streamid_t nb_fs; > streamid_t sm_id; > +#ifdef RTE_LIBRTE_BITRATE > + uint64_t tics_per_1sec; > + uint64_t tics_datum; > + uint64_t tics_current; > + uint8_t idx_port, cnt_ports; > +#endif >=20 > +#ifdef RTE_LIBRTE_BITRATE > + cnt_ports =3D rte_eth_dev_count(); > + tics_datum =3D rte_rdtsc(); > + tics_per_1sec =3D rte_get_timer_hz(); > +#endif > fsm =3D &fwd_streams[fc->stream_idx]; > nb_fs =3D fc->stream_nb; > do { > for (sm_id =3D 0; sm_id < nb_fs; sm_id++) > (*pkt_fwd)(fsm[sm_id]); > +#ifdef RTE_LIBRTE_BITRATE > + tics_current =3D rte_rdtsc(); > + if (tics_current - tics_datum >=3D tics_per_1sec) { > + /* Periodic bitrate calculation */ > + for (idx_port =3D 0; idx_port < cnt_ports; idx_port++) > + rte_stats_bitrate_calc(bitrate_data, idx_port); > + tics_datum =3D tics_current; > + } > +#endif > } while (! fc->stopped); > } >=20 > @@ -2139,6 +2166,15 @@ main(int argc, char** argv) > FOREACH_PORT(port_id, ports) > rte_eth_promiscuous_enable(port_id); >=20 > + /* Setup bitrate stats */ > +#ifdef RTE_LIBRTE_BITRATE > + bitrate_data =3D rte_stats_bitrate_create(); > + if (bitrate_data =3D=3D NULL) > + rte_exit(EXIT_FAILURE, "Could not allocate bitrate data.\n"); > + rte_stats_bitrate_reg(bitrate_data); > +#endif > + > + > #ifdef RTE_LIBRTE_CMDLINE > if (interactive =3D=3D 1) { > if (auto_start) { > -- > 2.5.5