From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53C3FA0547 for ; Wed, 19 May 2021 17:14:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFB2340041; Wed, 19 May 2021 17:14:48 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 7F13F4003F for ; Wed, 19 May 2021 17:14:46 +0200 (CEST) IronPort-SDR: ElNpd7qS/E5WR6D3/zmdQ/oPyAH4oRdwWgMXan855Tl3Zkku/gOgSumFybeht1jZqZ5KVks0yt I8UGwtv4qVhg== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="201047742" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="201047742" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 08:14:45 -0700 IronPort-SDR: qD4rPR7U0hjA2C9GbJHpNuPvVo47oPKzCyd/X5Gc66BmaN/ep/zSfoA1gLw8M4lTfqQxcyQ2pA GrbZ/kwffGbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="544590328" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 19 May 2021 08:14:45 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 19 May 2021 08:14:44 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Wed, 19 May 2021 08:14:44 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Wed, 19 May 2021 08:14:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jUgXKSx9+W0lvL/w0Pc+DSZxXGuFwjAxliZkGsvw3nqdvUTLMyA6JZkcAvFlDJQ3L04C6wNUGLuUHtwz+Y3ETWiy7sharvwadVWAfbri6zISg61+9W2HNW465lq7hakZ1JabAGoBydswsNWSVh8aKPmiTVPZJHtmuBZ8ZJtYZ/FSf4CLJX+KdKY7YjGrTNcyCg6C57Wf5j4Gx93KhbJH0DGS3woRcvGGXejFDlqcv61VLareTHmX1O4HGDG24qvTiCJS8Y27WUkwZOVLmi3CnQeIX9QNgx895TsVwwo6F4EUCLkuXELSt0ktQSWK0hQSBM12OlFnx+0AT5luHGqlRw== 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=bb159w6Fg7AGY3ZRofRZF5nCM//hz2mYU2OHU5zI0kI=; b=d73JR9aIOcuVk421hSniPuYi1U+iE58vqGP0GOXFG9wWBYa43T/u0rrPEpThnOOLByTDGNDIlehXnTyWdfs8l0a2cFTHp25y/5lPgfHelmyb6zBsEwoYEacmjxRPh/3rKrozxK5DjR0R0YfH+PAF16kQI/uTbnHkl+7biywdWFaVCIliU0ua14j4SlYdlxX+Wp2fVykPNXk1AxUs5fsfvPXFfhfSh+Sd5UARdIcCWegM4/pHjERJ70KAOhzzYDJMFdRvzUumd+l2tWUe4ixzvvcK48bTMAvZtcSOJqeATdw1i0C4Xvgf/wtdXRR9gI6aUlguTBlqxr3xvIt/EE1+tg== 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=bb159w6Fg7AGY3ZRofRZF5nCM//hz2mYU2OHU5zI0kI=; b=M0k1+TUjIV1vwjaGiwabwWIsdb2XniJm8wtZesR2my/fFAfE15raEXWnVg+B5MIjeAddfAoErcW5Q4YLR8XsqFmGCecC+DkP9RMl/7/iu/N8LChYQMyHRONY8IStfxzTxobPvehUDlRIYY3mxK/AF8utng8PmNOpioDWMo3rtWo= Received: from BYAPR11MB3143.namprd11.prod.outlook.com (2603:10b6:a03:92::32) by BY5PR11MB4417.namprd11.prod.outlook.com (2603:10b6:a03:1c0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 19 May 2021 15:14:39 +0000 Received: from BYAPR11MB3143.namprd11.prod.outlook.com ([fe80::5412:f015:db6d:9fab]) by BYAPR11MB3143.namprd11.prod.outlook.com ([fe80::5412:f015:db6d:9fab%5]) with mapi id 15.20.4129.033; Wed, 19 May 2021 15:14:38 +0000 From: "Van Haaren, Harry" To: Filip Janiszewski , "users@dpdk.org" Thread-Topic: [dpdk-users] Performance of rte_eth_stats_get Thread-Index: AQHXTLBsdY6t/CYuPUiKL+QTXetD5Krq5opA Date: Wed, 19 May 2021 15:14:38 +0000 Message-ID: References: <01e2ccbe-a2c8-be7c-7f9d-af43f609e75f@filipjaniszewski.com> In-Reply-To: <01e2ccbe-a2c8-be7c-7f9d-af43f609e75f@filipjaniszewski.com> 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: filipjaniszewski.com; dkim=none (message not signed) header.d=none;filipjaniszewski.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [86.40.59.136] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4c2e461c-d656-4387-ed3a-08d91ad8d217 x-ms-traffictypediagnostic: BY5PR11MB4417: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: X/bDYj46QbRYwCmij9CmPgHpRaFP8KLRJJfGP/D5uXapQP73VSBsqJw4yhye7dBqfvkf9zPWgwb05l6/l/TNpbcQSYwdNOaCP4tHKZzRKxP1LWK+PAnUJLrwIXS0ceqawie+soEHh23lUhgLmSewEfbgVoxPxCrwxE8P74SzJV/G47hY/ecm/tvnWkdM//uKO693d19fvzhqhHqPlmaRggbwzFCoSOi4BCEqjni1HeM+n7ex+WiSt/Kjwc+x0iLYMpEZFa+dukduw8eo0LsRt/5yilKwRfHb4bEbNCbKID8kDpidX5QdzuALaGZ3V8KbKbiazcdziG4xXMbQNeminmxGYuxlRr30JnM03sPx7NzUlhrZd2Nw+IBYVUdq6aKVsX4oMpvM7Y8hNloeGFV236pR8ArDd1aEqocXzIneR5lQf1KWBjoKshQQmOIiITRabWvfNFTOM10ZsLE5WEKz/hiayXpaifQdZEad+rvrgBABIs6GkSNWIZmGI9rWhPCUUPURQAQjMnt7JUiVrNF+64Suf+q+acod34NduegE9VzFMdYcBeZnyBgQnHMdYqR11svEG5pOugMaf381zO7yw4TlgSjbhpjE89fRw9L+/jyo4RPhM/Jh+ufhCAHAZdnCEW8CMotKTcho45GlV1bYxdde2onx/1Z4jB71bUAV7x6VxBlJXhDEXpbmAXAYRDimZVMXThs2k2ADb9B26G1Y2LfovQw/kPs4OUYIASaLtW0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3143.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(136003)(376002)(346002)(366004)(396003)(86362001)(186003)(478600001)(2906002)(7696005)(110136005)(316002)(83380400001)(26005)(66476007)(8676002)(66556008)(53546011)(64756008)(66446008)(8936002)(52536014)(122000001)(38100700002)(55016002)(71200400001)(6506007)(5660300002)(66946007)(76116006)(966005)(9686003)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?RUeB0yf99JvEGDKlZWpSixfsI6nm3VOdsFxoMTPv0dg0Qw6+iGI3DuS2yXJa?= =?us-ascii?Q?MQNpuwo3+7a+yvzFocY+ZOSZlidj9Xyai6kdhLzmiJwG6FDNEql8/0olzHZP?= =?us-ascii?Q?Gyfon6H79KKWF3PqmP/5+Lzw2zNPfUPfeJ2OH6hMoN/X/LShnWLFOgBrM2C0?= =?us-ascii?Q?mtiP5d5Dv2gyRDxtxl/AA1ldb10IJTNNckwN76o3749I45T3haNs/AZcNL6c?= =?us-ascii?Q?mvalLT305lcTwzlKgHMSuAl1londeHYxU4EIImReKGDHyr6Uxz2q8DNCIjjz?= =?us-ascii?Q?OR0nLLc8G8+gGdeBFFtvZJo8UgCZQnTDigtyyBnBv0ccRVXltDghEoXGGGpY?= =?us-ascii?Q?ktEtT0vvLOMFhxvhjieBr7SnLR17wPYNaaQArzwVdB4z6329Ye9uYZ0E1Wwk?= =?us-ascii?Q?AwXM1JMcIve3mkhoZMSODY1tCDvacfxEJeXUKx8G+33p+FGLMjl8jBmA/nxu?= =?us-ascii?Q?GAY4W1mjO4/E8oqUU+WsDJ7EhWtc31Fzx69g6FRGvolbKNYfo4uScmyalBGz?= =?us-ascii?Q?GDsJIP1qFuQRZHQZdAIxLQOyq1Lu16aI6iG2jORPr7/1rKKjSuqWCeou4qOF?= =?us-ascii?Q?f0FCvsGku1+u18qDBZVOBGWR1Wz7I9N76Zcov9Ai7+DJvPjY1yVRmnrCyZ1Y?= =?us-ascii?Q?fD4IAKOtwaPRJz+ALCbrNPkkkIVySwWDI3F1I4WHozts4ohvsUdQLCKj0Rst?= =?us-ascii?Q?eu9ReKrG+CsMnBmLMwsUE5oZO+HR/jTHwIoRhClCibsR3NWvusJYCzZXkpOI?= =?us-ascii?Q?nQ7YVbukpI1lROE2fEJA6onuxCJ6+fBY5fuUAJyItt0e3kg2zc+EzP/YlUgV?= =?us-ascii?Q?nRXJYI/PAaUiX3MRI4UHOtApOBW6K+e5BjgJJNszoZAKeS7loBp2dwjdV+uX?= =?us-ascii?Q?GGjmAMwWmci6Tzp9uDzsW/cT55zu1V63S3COM0qJuGPDp5Q/DQtupP51ZW8y?= =?us-ascii?Q?WdI2uwRA9z+N212vebupLXxmNsOLF1HxjDZqGhUdDofpqyAxtsQeiTMHIYTa?= =?us-ascii?Q?875IqA7YuKpWoB9OY635Lk0blmd3+fAqstJ7PJummFGawaIOA9nYj06iQmXx?= =?us-ascii?Q?HpJb8SFMtNTa9U3eoNhmn8bYcTUlvo7UYRY+MnTYO2sCm01T+FtHV56rKMK1?= =?us-ascii?Q?u/chh2DPSisaO+s52cjJKscb02HkcxD/lFTcqYb8+TcYcamEWHU40qX5SUGt?= =?us-ascii?Q?5wYSi39Ig4EW5Nq8m6Cf3tk/smPHfRCA+HdlV0GUxWGs5Jz6XcdVb74fVnmS?= =?us-ascii?Q?iXic6aBNJtg0Iy5SXDhYozt7Dh9xkOkoSVWwB6+YRllg2NAt1LZANhxzfmPp?= =?us-ascii?Q?awA=3D?= x-ms-exchange-transport-forked: True 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: BYAPR11MB3143.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c2e461c-d656-4387-ed3a-08d91ad8d217 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2021 15:14:38.7348 (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: Iutw4LKrFv2age/LeFw/f7AgJKiSW7bI57CEMEElAGmVL4P+X+zMpn7zeOpTmavfiZgYS31dqKQf7Bbh34VrfWtDOulVZFB310cqeLJH7Y4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4417 X-OriginatorOrg: intel.com Subject: Re: [dpdk-users] Performance of rte_eth_stats_get X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" > -----Original Message----- > From: users On Behalf Of Filip Janiszewski > Sent: Wednesday, May 19, 2021 2:10 PM > To: users@dpdk.org > Subject: [dpdk-users] Performance of rte_eth_stats_get >=20 > Hi, >=20 > Is it safe to call rte_eth_stats_get while capturing from the port? >=20 > I'm mostly concerned about performance, if rte_eth_stats_get will in any > way impact the port performance, in the application I plan to call the > function from a thread that is not directly involved in the capture, > there's another worker responsible for rx bursting, but I wonder if the > NIC might get upset if I call it too frequently (say 10 times per > second) and potentially cause some performance issues. >=20 > The question is really Nic agnostic, but if the Nic vendor is actually > relevant then I'm running Intel 700 series nic and Mellanox ConnectX-4/5. To understand what really goes on when getting stats, it might help to list= the steps involved in getting statistics from the NIC HW. 1) CPU sends an MMIO read (Memory Mapped I/O, aka, sometimes referred to as a "pci read") to the NIC. 2) The PCI bus has to handle extra TLPs (pci transactions) to satisfy read 3) NIC has to send a reply based on accessing its internal counters 4) CPU gets a result from the PCI read. Notice how elegantly this whole process is abstracted from SW? In code, rea= ding a stat value is just dereferencing a pointer that is mapped to the NIC HW a= ddress. In practice from a CPU performance point of view, doing an MMIO-read is one= of the slowest things you can do. You say the stats-reads are occurring from a= thread that is not handling rx/datapath, so perhaps the CPU cycle cost itself isn'= t a concern. Do note however, that when reading a full set of extended stats from the NI= C, there could be many 10's to 100's of MMIO reads (depending on the statistics requ= ested, and how the PMD itself is implemented to handle stats updates). The PCI bus does become more busy with reads to the NIC HW when doing lots = of statistic updates, so there is some more contention/activity to be expected= there. The PCM tool can be very useful to see MMIO traffic, you could measure how = many extra PCI transactions are occurring due to reading stats every X ms? https://github.com/opcm/pcm I can recommend measuring pkt latency/jitter as a histogram, as then outlie= rs in performance can be identified. If you specifically want to identify if these are due st= ats reads, compare with a "no stats reads" latency/jitter histogram, and graphically see the i= mpact. In the end if it doesn't affect packet latency/jitter, then it has no impac= t right? Ultimately, I can't give a generic answer - best steps are to measure caref= ully and find out! > Thanks Hope the above helps and doesn't add confusion :) Regards, -Harry