From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1BCCA09E4; Sat, 5 Dec 2020 14:16:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E77B4C7B; Sat, 5 Dec 2020 14:16:06 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 038412E81 for ; Sat, 5 Dec 2020 14:16:02 +0100 (CET) IronPort-SDR: SG9Qvi2rfIE0Ylt+t9PmWO/ZM2/siZcYH9b3ZpwGIVkp7RT9zsDigAejij8Ai7ggQmlJWIdxys xMw9V3bHED4Q== X-IronPort-AV: E=McAfee;i="6000,8403,9825"; a="160560689" X-IronPort-AV: E=Sophos;i="5.78,395,1599548400"; d="scan'208";a="160560689" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2020 05:16:02 -0800 IronPort-SDR: DMpIX61gr8X7u8RpzBwV7f+JHfT2IebJbqlP0wmO5R+021LQs+TXi500FHi9UCAPfCKBGLv8WT b9MJOJJ2n4PA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,395,1599548400"; d="scan'208";a="346906158" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga002.jf.intel.com with ESMTP; 05 Dec 2020 05:16:02 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 5 Dec 2020 05:15:59 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 5 Dec 2020 05:15:59 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 5 Dec 2020 05:15:59 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sat, 5 Dec 2020 05:15:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/Iw1lpiTQF5TO59uZJJ/ExXvGSYlu63ainliL1yuun75p4roS4xvn8CY1IpyoXRtbc7RmRrH79OowAbE2Gbbw/9tncIG4qBOGDggK6Sx//g8lNccrbwnSmuLTOVscVyVqIf1V0Pygz/bIHaaLc/n7PIgOXlU4pJoQTgKPoyRrsIorWhAPUbkxrkVQXrKVIPnT3al2bs1TyFfOlGeDYxQldEci4h5z/WPPLW913EDwN/SbVI1H55HOvgvW4NTiY5nGSE2OUPnzE667ST0KuYmOJvOWgBPT0sU3DVH8lBrMdLsv2MU1WrtcLeAz2aFm7O8jVtcVVVCYDnEB4ZoJ5Lvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t0XTpMwr4C0epr/oPgtz6DEdLI/Q7CXaifgWzqm7Sxg=; b=KJU5/LajSM6BkoOAnnByFofvSBV4x6g/exajOPlPw7LE9swY6n3p5hQVraRR6xQZ4fhO9AQyJ9J4WC9PCw2MfrqWpDudC4uVjZtd+gF1Tz/UiWliA2HYrqAs2tzmhA+NCH0iEiFfvfhRuuRT0tn+RxMcTgMCkfiQj2NJgJ+ywPIPUFM+Qi/tXuqCZ48L/C7UFamH6QFlp7zpd/kQfwfdQHlW3y8Pw243Nhfh512z1hit53ZhRgEQ9NJBspp40gbwMC6rOA//qf3x6p+1m4gPSfpvBq0KgpKEXo7mJ5zmlqGEuzT3wMrZApLypByxpqmWpwwL5HLWzANOjjDnf8Fiow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t0XTpMwr4C0epr/oPgtz6DEdLI/Q7CXaifgWzqm7Sxg=; b=kVLYyKCapN0LXtBTWTqPssrMm8f4zeyJ5Cv6pNVfWAwEWCZbIxtJAg680wdK1mYF1c+bowPVxwfxz7Vo8GsZb30t6D4VZ5RM6WDClEu8tHPxLa2nQAPwr7XM0/KpU5LPfSmc5VGdAZwjzUQtBkAbjddOKfpblPsfTPeXIovJfq4= Received: from MWHPR11MB1581.namprd11.prod.outlook.com (2603:10b6:301:d::9) by MWHPR11MB1902.namprd11.prod.outlook.com (2603:10b6:300:10f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.21; Sat, 5 Dec 2020 13:15:57 +0000 Received: from MWHPR11MB1581.namprd11.prod.outlook.com ([fe80::556:15d2:6ce4:d49d]) by MWHPR11MB1581.namprd11.prod.outlook.com ([fe80::556:15d2:6ce4:d49d%2]) with mapi id 15.20.3632.022; Sat, 5 Dec 2020 13:15:57 +0000 From: "Varghese, Vipin" To: Hideyuki Yamashita , "Tahhan, Maryam" , "Pattan, Reshma" CC: "dev@dpdk.org" , Hideyuki Yamashita Thread-Topic: [dpdk-dev] [PATCH 2/5] app/proc-info: add to use apistats Thread-Index: AQHWyhKXNG6ekj62Vki6qCMTsrNJL6noetkw Date: Sat, 5 Dec 2020 13:15:57 +0000 Message-ID: References: <20201204075109.14694-1-yamashita.hideyuki@ntt-tx.co.jp> <20201204075109.14694-3-yamashita.hideyuki@ntt-tx.co.jp> In-Reply-To: <20201204075109.14694-3-yamashita.hideyuki@ntt-tx.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: ntt-tx.co.jp; dkim=none (message not signed) header.d=none;ntt-tx.co.jp; dmarc=none action=none header.from=intel.com; x-originating-ip: [202.164.130.107] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 68b0a455-a225-40c2-b539-08d8991fe732 x-ms-traffictypediagnostic: MWHPR11MB1902: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1303; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1217lhywze2jYJ0Qr2whlJD7bxSJuWgt3VdUZZigLPIwtBVtKCWPrWldUKJDF/CzPcYXid7Z9mqq4x1eQX80gm4TM2O2jI0qUZpGa6ahj2w7kcSIf0iML08AJJZCS/VEn5inSUCayLoC30c158TNXkPU+NlBBtVAtjiO2Q8Mwhy9prU/zh6nSDzh8vHIQmGtRNOsiKjRZeXwfVbSOX1QIvK6ch5QLf8KJtfuAzflHGo9pSa6O/4hLGJusJcsaOHVheryBjK22SYfyYAKtI6sICKjmMXI/fkCZgeTMk3NFo9jq7yes1hxkueq84f1Tsr/c7rjvEsa8PjMdRMjyji0AQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1581.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(396003)(39860400002)(376002)(136003)(64756008)(66446008)(9686003)(66556008)(83380400001)(66476007)(66946007)(478600001)(33656002)(8676002)(2906002)(26005)(8936002)(76116006)(6636002)(5660300002)(4326008)(71200400001)(55016002)(52536014)(186003)(6506007)(86362001)(54906003)(7696005)(110136005)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?DKSEGwQDMIvibdWv0loLxN9pUAehcrPWU9QzzKX2s41ka0jj3NmwAFC/d/7f?= =?us-ascii?Q?kkt6pUd3NOi+/b/5Ei2yk6vcPwmEUaNbdxK+BHyRqJ9JIV7fsO2Qw65EM4Xr?= =?us-ascii?Q?SKlGcpMuOcMusKE73azmA+i2ducazdDRShFB9AfpNZ8lE4VQeWeh64lNaQYM?= =?us-ascii?Q?XHMBrk9UA2eChWYt2M8YL6jL8s3cnBwc0LQtOODJ2AHotQ3bexe5xdEhNu0a?= =?us-ascii?Q?rtq9veBLEv81D1+eWt19nTYxFNgDGjtNQGrwhJ+vm0HOxdIkPzV2DABDffjT?= =?us-ascii?Q?tljh1GpFAIFR1vCE2dulgxL+I92gPdXH72asHIOFc3AaW5+6FTIp3hi80GJ1?= =?us-ascii?Q?1tS/zCQNYzV3Mj9eZ2oNYNhD2BkLPfoJfPlS47mtUXDB8UTWkAsFeJ4WDGNz?= =?us-ascii?Q?YG1RQX7MRCQXxlwkU25fFjqqfy06x7306G1nk/T3pzI209j4G2iUFFnZ6tzP?= =?us-ascii?Q?32kwvP6I0a04Rkvag9eJqLUpxkH6OjGhLZAsoc+rYn9mKpD+Cs9LX7Mm+1qg?= =?us-ascii?Q?vXpOQDknT3kVu6LXZUlCRwf3GW37rsBRENt1cIiekK5ykhl7UHQF21uRuO45?= =?us-ascii?Q?Fzxv6aJimM8SRmwOL2lOR0ddoQcUn4R627uTYd0ok5zxt/94vwZCNv4hIC4A?= =?us-ascii?Q?Bb/5Ds3/We4zWcvtgvB9OSaZNlNQ5zNA/2amDsZDXvp8PdRwoMUC1YCP2Cwr?= =?us-ascii?Q?x0aBY4cU/rZav479rrKHcianaGKqkPXF9e0/U9pmanInYcYcK9EeptE0EEf3?= =?us-ascii?Q?xRHzJYeprEactss2fuJY1RG5GLn+k/n1Uiac+aRq0YKetqgdTsHz+UBIPit9?= =?us-ascii?Q?YP+h1kVKvmoff7shctbsiGwd93HC2TtQD8BragXvH7Inv/pLR6wmube0aSpT?= =?us-ascii?Q?eVtzMiY4k32lQ74Sq1ouUbWvLa3xlFCgl9azcXgh1zoYj+/xttiDCHFUJ97C?= =?us-ascii?Q?UpaEK1Yt/wcOn09Bk7v6XmAanFOKx0VQ0kR0cKCeRvs=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1581.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68b0a455-a225-40c2-b539-08d8991fe732 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2020 13:15:57.4301 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VEaemTOf5NK7uou1/bDDuzWSdf1EhDponrCF2JHBFmOT3hU+ESd+/q27fYVsXHatRKkgQ2np2+59HmQn82H32tFuw//DMbx2h7KLDKzVEwc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1902 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/5] app/proc-info: add to use apistats 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" snipped > " --xstats-ids IDLIST: to display xstat values by id. " > "The argument is comma-separated list of xstat ids to > print out.\n" > + " --apistats: to display api statistics, disabled by default\n" As per the code base the logic ` rte_apicounts->rx_burst_counts[lcore_id]++= ; and rte_apicounts->tx_burst_counts[lcore_id]++;`. This expect `apistats_i= nit` isn primary before `proc-info`. So I have 2 quereies 1. with this logic does all dpdk-examples will be updated to invoke `apista= ts_init`? 2. what is mechanism in place to inform all dpdk user that `just like rte_e= al_init one has to explicitly invoke apistats_init too`? since I am not clear with the code flow, please feel free to explain the lo= gic or expectation. snipped >=20 > +static void > +display_apistats(void) > +{ > + static const char *api_stats_border =3D "########################"; > + uint16_t i; > + struct rte_apistats t0_count, t1_count; > + memcpy(&t0_count, rte_apicounts, sizeof(struct rte_apistats)); Any specific reason not to use `rte_memcpy` and invoke system library call = `memcpy` > + sleep(1); > + memcpy(&t1_count, rte_apicounts, sizeof(struct rte_apistats)); > + for (i =3D 0; i < RTE_MAX_LCORE; i++) { I am against the idea of iterating RTE_MAX_LCORE, as for any valid DPDK pri= mary application the actual core count may vary between `1 to RTE_MAX_LCORE= ` > + if (t1_count.lcoreid_list[i] !=3D 0) { > + uint64_t rx_count_delta =3D t1_count.rx_burst_counts[i] > + - t0_count.rx_burst_counts[i]; > + uint64_t tx_count_delta =3D t1_count.tx_burst_counts[i] > + - t0_count.tx_burst_counts[i]; > + printf("\n %s api statistics for lcoreid: %d %s\n", > + api_stats_border, i, api_stats_border); Suggestion: Since most of DPDK application uses dedicated core to RX and TX= , would not it easier only display the lcores which does the operation. Tha= t is skip lcores where `count_delta` are 0? > + printf(" rx_burst_count: %13"PRIu64"" > + " rx_burst_count_delta: %13"PRIu64"\n", > + t1_count.rx_burst_counts[i], > + rx_count_delta); > + printf(" tx_burst_count: %13"PRIu64"" > + " tx_burst_count_delta: %13"PRIu64"\n", > + t1_count.tx_burst_counts[i], > + tx_count_delta); > + printf(" tx/rx_rate: %3.2f\n", > + (rx_count_delta) ? (double)tx_count_delta > + / rx_count_delta : 0.0); snipped > if (enable_iter_mempool) > iter_mempool(mempool_iter_name); > + if (enable_apistats) > + display_apistats(); >=20 > RTE_ETH_FOREACH_DEV(i) > rte_eth_dev_close(i); > -- > 2.18.0