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 53FCBA0C43; Wed, 20 Oct 2021 22:25:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19F7840150; Wed, 20 Oct 2021 22:25:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id C326A40142 for ; Wed, 20 Oct 2021 22:24:59 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10143"; a="229146264" X-IronPort-AV: E=Sophos;i="5.87,167,1631602800"; d="scan'208";a="229146264" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 13:24:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,167,1631602800"; d="scan'208";a="445063385" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 20 Oct 2021 13:24:56 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 20 Oct 2021 13:24:56 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 20 Oct 2021 13:24:55 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2242.12 via Frontend Transport; Wed, 20 Oct 2021 13:24:55 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 20 Oct 2021 13:24:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TZQfAU0Ubi2KI2OJCVlZfjY8BQNCwLegd5A1JC8zWvC4OnNl5s8HmTKu5IWEjpI2DsvkbtGt26pBR9d6irWS1oIncVAZR8Yw2VB1CtYptIpvAvlmEtdB4YdNoqsm9ITWr6aVRFh4MHdE282JaeC2Hwqjpu/hgd30v4hFrQZVhaDAhK4yhQlFdyJtnnTds21+Hj2Dkf3cu8HkoiMu0lfLqV7/q6AOPZCTvwfGDkcFizZmtcp0rSigRc9igxLAvEK6HPBE2V39ruTPm2XYDo5U//f/TcTyWN9ibl/MYwKehtqP7fvY7eCk7N56i+BBalYj1VOLhtqgC+1e5/IpMiZjQg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=82Ry7gDXES11MqYpHan9dn7TE9GekzN+UztUKoXbUFU=; b=XHGUDlYGMLrgR8GoVEbWLcem7zcGDpLpRL8JqYzlazlVRZCf0RGJJaGEab9L7Wuhbs6ygnirTR1Ou9bCm9lO6a1oXLQt4Ttwz7wW/DdJSIXVqE33uVzyzSkBf6zoLjzpfO2NBTnXkBKbYPJlnZf8/UQ6vFlxMR2uOa0CjysHUXXz+Sc27FhqIFVcsItgX6kbqTYwDDNq5Z9DHCkN6KEjybVEsIu4neEPQPzK42snceIg2AO0KpyUpwZSoZc/T4C5knlvI4LPXDDQVuZGcC6oT3hwhPXAD1U6aFIVs2yWAR3mgiWfUFi5EFmj6p+UNj4SqN+mseocU3C5nuVOwnv1Lw== 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=82Ry7gDXES11MqYpHan9dn7TE9GekzN+UztUKoXbUFU=; b=LSigyF8ae4v/FZ945zz8o+oWrcVGK1XoJoDsuyP/Ft6BXgTIIrZZU/FdnK2ctaZL3VdW6l8AL9H2PNvsMHiaXBGK8GGunE2clRmdbj+BGc4QPaWZnUMYPYceL80xSFlXv9zNSh0wH9FkjrcZOlBgubrqEWjkBkNsJQQkcxbhiFM= Received: from SA2PR11MB5196.namprd11.prod.outlook.com (2603:10b6:806:119::18) by SA1PR11MB5873.namprd11.prod.outlook.com (2603:10b6:806:228::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.15; Wed, 20 Oct 2021 20:24:53 +0000 Received: from SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::b8ae:106d:fe92:1996]) by SA2PR11MB5196.namprd11.prod.outlook.com ([fe80::b8ae:106d:fe92:1996%9]) with mapi id 15.20.4608.018; Wed, 20 Oct 2021 20:24:53 +0000 From: "Carrillo, Erik G" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 11/14] eventdev: move timer adapters memory to hugepage Thread-Index: AQHXxHkURY2oC2leBECZKD3hYhsl4avcV2sA Date: Wed, 20 Oct 2021 20:24:53 +0000 Message-ID: References: <20211015190221.2160-1-pbhagavatula@marvell.com> <20211018233610.5694-1-pbhagavatula@marvell.com> <20211018233610.5694-11-pbhagavatula@marvell.com> In-Reply-To: <20211018233610.5694-11-pbhagavatula@marvell.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.6.200.16 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b859f9e0-40b3-4994-40e2-08d99407ad02 x-ms-traffictypediagnostic: SA1PR11MB5873: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: f7bmbgkFIPJ9Vg79PRjmlagqyG5aAEh/Rd3VbPG+KnCmqUImSxTp4vKtb54XyjnTByD8CZfyCdzYZMeANsx4JISMgWKxXfaD22ypO0AaDLAXDe+6qyYWD/KPTotxnaMovYKmLHjJDYbPZSp7SRItz454himZvWsEM+ZeO7bpFo9PVJfPC9TKOq7s09uYoxQQQegB32rhwVjw6BOX3JDze1VOa2ghVNLuTyXiab27Ayth9TtkJQcAgAtGXcAPzmZL7abVIVQOtcjFSAlk+x5eqo6yPT6eyY1HfXQd/j0kFcqmFYAZup9U02PMcF3SXmeEcNIl6+xFoGSBKdPsR1CRDnTVdO1DwIoWWi6cPK/XlQO5/efcA1TU9RPRgt1gKVtidEnM8BleiOzSgxuO3fsfQ8IcjstvnNRMQPTALwGdL9mNbEtySM40a+a1tw0l2bO4WgEbb5RAZ0rMqHMGHBHRtYXB3j8PBJjaSqfwKQDPmwjmPpADoLMR81hiyxRUquWmH5eVim6YtpAquQYsQ8CKGQuyVc/e+S5A1evFYnXR/EF0UvUkY5VtAVpsQNqlnD+6BxbPCdoCmJYyZiAX+uP9eggC7hKcJZO3rFXHXRIWXJg5ct4SGnH4mLEfasBp475aYxH71LzG5yfGb+OUwdzbWFrjupsrLUkI19sJ1sgyshKDIzVBi7X4whlNwR1Wkv34ipSVUWIy/etnS/gSzmn/ZoVvUGBlcOP9XmnfnOtv01brB8po7RxWu/uH6GblbR/eUxghwHqVPY8LpnhJcf1+i9gYw7NDDkI5Ql7meBtzpB4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB5196.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6506007)(53546011)(966005)(316002)(33656002)(110136005)(122000001)(7696005)(38100700002)(5660300002)(8936002)(38070700005)(71200400001)(82960400001)(86362001)(2906002)(76116006)(66476007)(186003)(9686003)(55016002)(52536014)(508600001)(83380400001)(66946007)(4326008)(26005)(8676002)(64756008)(66556008)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3bAdYqKFhElr3d9lec+8FyTzuC81RFljvSK+VhkbTU/J1SUozhEUX3ul0spq?= =?us-ascii?Q?e2QzyiirKBMHJ5zGSx2jRhf6PpZ7ACO/u7HYgXEhEoqHUVqNkrIDxQwmVK88?= =?us-ascii?Q?xbXIOjmvaaIPNSVMgVedD8gfc101msyV0nlMp1KwOrE9dpogN6vZcCv75joL?= =?us-ascii?Q?DIekvZKo8KX0NzYUpZgO/l8DWJw8n0PJspl3wSyuBE7/57FyAgvenLPMy07c?= =?us-ascii?Q?RiCbnFkrcHEf9W2uuQ/wYAvp33e9KBPJJ5+nvKnCipFdGcvzSAHwQEs2zBlY?= =?us-ascii?Q?NrFnUrt4ErqQkAEzYCgWJ5v0CSir0+BM0ugfTWW6gTKOoPD7H4U6qUUyoXxz?= =?us-ascii?Q?68FBxYT4mXkeBjh0uTJeG6Ny1r3wcLAimgIBoTAJtcozHuF2IhCugbgtpA91?= =?us-ascii?Q?gFePGNYq2dVvps6Kifd5bScfKnd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= =?us-ascii?Q?y2MHD/3MFTVMi3LCDmhNiRJz2EKVltR+HVinSzCK0qkvkoiUz22UssWGLMEu?= =?us-ascii?Q?eOYSqQ6I4Y8bDHmojx2jy817FPLLfMjkOP7IE2vjtHi+b9158UrLzjOUfsdF?= =?us-ascii?Q?j709pSG35ZBUab93tINXcosI7T1bDG5M?= 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: SA2PR11MB5196.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b859f9e0-40b3-4994-40e2-08d99407ad02 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2021 20:24:53.6748 (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: erik.g.carrillo@intel.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB5873 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 11/14] eventdev: move timer adapters memory to hugepage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Hi Pavan and Jerin, > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Monday, October 18, 2021 6:36 PM > To: jerinj@marvell.com; Carrillo, Erik G > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v5 11/14] eventdev: move timer adapters > memory to hugepage >=20 > From: Pavan Nikhilesh >=20 > Move memory used by timer adapters to hugepage. > Allocate memory on the first adapter create or lookup to address both > primary and secondary process usecases. > This will prevent TLB misses if any and aligns to memory structure of oth= er > subsystems. >=20 > Signed-off-by: Pavan Nikhilesh > --- > doc/guides/rel_notes/release_21_11.rst | 2 ++ > lib/eventdev/rte_event_timer_adapter.c | 36 > ++++++++++++++++++++++++-- > 2 files changed, 36 insertions(+), 2 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index 6442c79977..9694b32002 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -226,6 +226,8 @@ API Changes > the crypto/security operation. This field will be used to communicate > events such as soft expiry with IPsec in lookaside mode. >=20 > +* eventdev: Move memory used by timer adapters to hugepage. This will > +prevent > + TLB misses if any and aligns to memory structure of other subsystems. >=20 > ABI Changes > ----------- > diff --git a/lib/eventdev/rte_event_timer_adapter.c > b/lib/eventdev/rte_event_timer_adapter.c > index ae55407042..894f532ef0 100644 > --- a/lib/eventdev/rte_event_timer_adapter.c > +++ b/lib/eventdev/rte_event_timer_adapter.c > @@ -33,7 +33,7 @@ RTE_LOG_REGISTER_SUFFIX(evtim_logtype, > adapter.timer, NOTICE); > RTE_LOG_REGISTER_SUFFIX(evtim_buffer_logtype, adapter.timer, NOTICE); > RTE_LOG_REGISTER_SUFFIX(evtim_svc_logtype, adapter.timer.svc, > NOTICE); >=20 > -static struct rte_event_timer_adapter > adapters[RTE_EVENT_TIMER_ADAPTER_NUM_MAX]; > +static struct rte_event_timer_adapter *adapters; >=20 > static const struct event_timer_adapter_ops swtim_ops; >=20 > @@ -138,6 +138,17 @@ rte_event_timer_adapter_create_ext( > int n, ret; > struct rte_eventdev *dev; >=20 > + if (adapters =3D=3D NULL) { > + adapters =3D rte_zmalloc("Eventdev", > + sizeof(struct rte_event_timer_adapter) * > + > RTE_EVENT_TIMER_ADAPTER_NUM_MAX, > + RTE_CACHE_LINE_SIZE); > + if (adapters =3D=3D NULL) { > + rte_errno =3D ENOMEM; > + return NULL; > + } > + } > + > if (conf =3D=3D NULL) { > rte_errno =3D EINVAL; > return NULL; > @@ -312,6 +323,17 @@ rte_event_timer_adapter_lookup(uint16_t > adapter_id) > int ret; > struct rte_eventdev *dev; >=20 > + if (adapters =3D=3D NULL) { > + adapters =3D rte_zmalloc("Eventdev", > + sizeof(struct rte_event_timer_adapter) * > + > RTE_EVENT_TIMER_ADAPTER_NUM_MAX, > + RTE_CACHE_LINE_SIZE); > + if (adapters =3D=3D NULL) { > + rte_errno =3D ENOMEM; > + return NULL; > + } > + } > + > if (adapters[adapter_id].allocated) > return &adapters[adapter_id]; /* Adapter is already loaded > */ >=20 > @@ -358,7 +380,7 @@ rte_event_timer_adapter_lookup(uint16_t > adapter_id) int rte_event_timer_adapter_free(struct > rte_event_timer_adapter *adapter) { > - int ret; > + int i, ret; >=20 > ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL); > FUNC_PTR_OR_ERR_RET(adapter->ops->uninit, -EINVAL); @@ - > 382,6 +404,16 @@ rte_event_timer_adapter_free(struct > rte_event_timer_adapter *adapter) > adapter->data =3D NULL; > adapter->allocated =3D 0; >=20 > + ret =3D 0; > + for (i =3D 0; i < RTE_EVENT_TIMER_ADAPTER_NUM_MAX; i++) > + if (adapters[i].allocated) > + ret =3D adapter[i].allocated; > + I found a typo here, but it looks like this series has already been accepte= d, so I submitted the following patch for the issue: http://patchwork.dpdk.org/project/dpdk/patch/20211020202021.1205135-1-erik.= g.carrillo@intel.com/ Besides that, this patch and the others I was copied on look good to me. Thanks, Erik > + if (!ret) { > + rte_free(adapters); > + adapters =3D NULL; > + } > + > rte_eventdev_trace_timer_adapter_free(adapter); > return 0; > } > -- > 2.17.1