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 7A345A04B8; Tue, 5 May 2020 12:45:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D68331D158; Tue, 5 May 2020 12:45:52 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4BD4D1D14F for ; Tue, 5 May 2020 12:45:51 +0200 (CEST) IronPort-SDR: kShXuUXg2r+VG/wI5g0rEqkAmm9LMpIudMpTFxncQfI8oEmswannhVan4J0BSmYMBvNM0rT+Mh /IeAfZ0RrPZw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 03:45:44 -0700 IronPort-SDR: YTrH27taWLde/HjnjwortnAautcftl9Tuf3sSOvW+wSH0Q828xAobB+225/LBKBJlsi8B4y5Zq LTCPaRQ8Bjjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,354,1583222400"; d="scan'208";a="304438580" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by FMSMGA003.fm.intel.com with ESMTP; 05 May 2020 03:45:43 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 03:45:43 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 03:45:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UPqUuFXqsHwdKDrLZKpbIt/2otVZ08ZlUcgS6CPwAWNv9qtRA9c2hfk13I2wOTvWU+dYNeflTUa/eaJkqVw2iezRPIc1MOoi2wOEeITmUufl/T28OP7cLKJql2EwYH6hTXsKtDYKCR3CXCsKzEz4f088VURx2J1jLyv0z0+s6JuhL1FtMMGk7DSTUwH6pzWHJvHMz1V8JYgvF6uvGScOf6ny82KWgDjduyd0ywgeusFZf9knh3L+Z1Ch1XD2QsObUifPPhnPmFPJpuMGlg+RRBmBSUoTN522KMCVsPkEhnOSASuKMQmYWl+4HVOC3I/wsqH48VmM3oxlOG36F3TmHw== 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=RMA3+ZXLzRxxvuZuem3MPRc9i2F0g1HuZqFlSZF7jeY=; b=jZJJw0vdxqqaw009OLPsm8jXgThqBaa+9W5AkmVexFwhsey4KzCiJ6guTTY6bdNpCkpPGwRuiU17tDvHNFdTnvM2tX9l9TE+uzJHJHCNh3jGClUtPU0mHlcLeL/fYUVZiTAE1TfXpRN+z6lz2hrEV/r3QCVDbxV69An5DANJ+GX6Bt08rKfcBQ1/9ESHB/43fhrscz4dBm64sRAcpnfmmDsmQVfydQjrMZvQk1/BTizvbU5cjCEHYuhcwPjSkFvLIruELm/3+q5IYS9qzVESkasNoobtqiSx/ARgzSxkTjWm8m8W2ri2QsB5xmprC4JXwEzkTgYrtiz4PvgqxqSaAw== 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=RMA3+ZXLzRxxvuZuem3MPRc9i2F0g1HuZqFlSZF7jeY=; b=YqrkyZp0DjamQC7pskmGU+1m6CK5zzXUjW+C3RS4ipy0KwIMr8rNu3tS1f+VP4iFaDW4xXD3PHBofEe/IkPvoTHwiUfIF0KLqu6grpBC1hKeB79WcAzb2RmjR6hR0xuSKKP27hmjiROLAmXMXs0FmaWVgrUEzxksYM7qJUT3l44= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB2693.namprd11.prod.outlook.com (2603:10b6:a02:cc::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Tue, 5 May 2020 10:45:38 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.2958.030; Tue, 5 May 2020 10:45:38 +0000 From: "Ananyev, Konstantin" To: Anoob Joseph , Akhil Goyal , "Nicolau, Radu" CC: Narayana Prasad Raju Athreya , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: add per core packet stats Thread-Index: AQHWGXBRHnAN9ZG/YUWBcq2OgLQJpaiIFpRggA0ZrgCABC/t4A== Date: Tue, 5 May 2020 10:45:38 +0000 Message-ID: References: <1587444633-17996-1-git-send-email-anoobj@marvell.com> <1587647245-10524-1-git-send-email-anoobj@marvell.com> In-Reply-To: Accept-Language: en-GB, 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.2.0.6 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6f577d52-3f8c-41ce-74f6-08d7f0e17340 x-ms-traffictypediagnostic: BYAPR11MB2693: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0394259C80 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ke9yykgeyA1ZF281+jrrHMcE20E/0KufE1eI5P83GZw1KmJU5cXRyXV7Q6muXttBXkwPnbOJadbMgnqMWNeDUf6IMRr3f/RTRgNBPAxzys6fbaZPU69OXX+sw3lFFe1fo4Zw0brKe+2WTEirpKh+P0vDdsQXqZl+IMC9K77hMngwMWi9l1yQ38SyDeDNqvRUXA29+c3ocSFqR6G+seW3HGLeJEyFpiXCgk1S/FDuxUzXuJpvlc4H/fxTnSsFhKCRYDygGG4xLqR9+jnegNyXzebblPjEJ5N4sUOz1Dkj3mf+S/9nNuUZWgikjIsK1MKU5a/8+zF9ojnMZ/VXud9hGdytBDV3hq0ZdSnJZgB5ttpLSxJ484JVUYRFCNQreaAmrplNGvISzAKl+P0su+Q3Qx/62UzORTmlLMJxTbMEVAULw+c+jy/Y5g2qXf4tNbrdc1VEuRrg763j4bGEQPJ5CL7Rzi+24AAhn3D8RtTOnGNij0TXmmlz8nrEaKY7EfRvGyi2KGDfrR8yTEbxGN2ceQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(396003)(39860400002)(346002)(376002)(366004)(33430700001)(5660300002)(4326008)(86362001)(33440700001)(6636002)(33656002)(55016002)(9686003)(478600001)(7696005)(110136005)(26005)(66946007)(8936002)(76116006)(54906003)(186003)(316002)(71200400001)(66556008)(66476007)(64756008)(66446008)(2906002)(52536014)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: wr1jx/vnXvyG5mgvuOcW0ElJJkWZ+F5Ixw48NAqcSV0UqXspDmRdfocwJwqSz1XNgMUWh/d5usTwsYiLhXQwOzCeJkfRpcQSUWj+59QqBmZbHLRxFwWapF+2xZgyvO2msPAZkn/8RvoKysqmwPesmgHoDlJ8lRnQs7AwrmVw/6d/iUOCKJQD2bvamCPMvGZysLlWM/DYXzBPjjFnnp32G4DL+NDM4El0Pccoc17CMuWACeldsgaSVaBlG3BgMlTKZ0CFVRROiHwbDK2AxNH9xv0F40ophGQYClMPhw2J4v8rq2FwpvDmGLyTjvki6t2GHucNg5z3OEgaJAhYWgR7YIKhFRci/N7rEnkZCSDP9rMnEm8JR2la4vfXhww42IyyOfU3zt+e1AwjCc3S+Yc7BAuuWIseRByInMhNdYzZGksbakWCo2qmENV4XEY0r8AwIcsC8ww8B/tlzAX4H9I1X/ER/HbJc49LYmJvNl4l1byiNnM/SvoDQzKVoV14OvTTOOAbCHzqyjA0IwYPExMBaZ5dSs2LiS4w988hUIwcvyiAWgLAl23aTOe42q+Mr0MTZEPOHNNL+TkZ7MO7ICaRy6YR5FxztyNeaVscyW0INQh7keQi2swgrqJ773BypajZRf2RVexFNsUSO4gItOQycPZNARjDxqmYk3HQ+UmLkdRYdlzgsR/uJWuuaHGhHMSVo0NlaRGFDgmHr9K3KB8N3N23q/pVyEhh7Uyl6Rf7PKv1fv7s8S6Xxo243xOGf7Un3MhfW8FzS04kzb47/mBmQ8baPVEO6MN2L3ILO2faEpYFPfuxQs5oDMnM2jMcl1FS Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6f577d52-3f8c-41ce-74f6-08d7f0e17340 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2020 10:45:38.6727 (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: NsoUyUYOS9k5NXaldM8n9+78EBlNmd4g1qYecemPa9pjh408kYgXI43NUX25d113+5+H3xFy2ZvCFSFRyeNqdnDkk82FxRyswhTJe2Uox/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2693 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: add per core packet stats 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" > > > @@ -1159,6 +1243,19 @@ ipsec_poll_mode_worker(void) > > > drain_tx_buffers(qconf); > > > drain_crypto_buffers(qconf); > > > prev_tsc =3D cur_tsc; > > > +#ifdef ENABLE_STATS > > > + if (lcore_id =3D=3D rte_get_master_lcore()) { > > > + /* advance the timer */ > > > + timer_tsc +=3D diff_tsc; > > > + > > > + /* if timer has reached its timeout */ > > > + if (unlikely(timer_tsc >=3D timer_period)) { > > > + print_stats(); > > > + /* reset the timer */ > > > + timer_tsc =3D 0; > > > + } > > > + } > > > +#endif /* ENABLE_STATS */ > > > > > > Why to do stats collection/display inside data-path? > > Why not use rte_timer/rte_alarm and make it happen in control thread? > > Another option - make stats printing at some signal to the process. > > In that case we don't need to bother with time period at all - it will = be user to > > decide. > > Again if we remove that print_stats() from data-path it might become ch= eap > > enough to always collect it, and we will not need ENABLE_STATS macro at= all. >=20 > [Anoob] The stats collection will not be cheap because we are updating a = common structure from multiple cores. What I am saying - per-lcore stats collection (updating lcore stats by lcor= e itself) - should be cheap enough and can stay in data-path (probably even always, not only when particular c= ompile flag is enabled).=20 Global stats collection and display is quite expensive operation, so we shouldn't keep it in data-path. We have a control thread within dpdk (for alarms, signals, timers, etc.),=20 why not to call print_stats from there? > And the idea is not to > have a very efficient stats mechanism. When we have more cores engaged, I= Psec performance is directly dependent on ability of RSS to > split traffic to multiple cores. Such stats would come handy in understan= ding per core distribution of incoming traffic. >=20 > >