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 2A16FA0C43; Thu, 7 Oct 2021 22:49:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E7D0411F9; Thu, 7 Oct 2021 22:49:23 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 5937F41155 for ; Thu, 7 Oct 2021 22:49:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289858061" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="289858061" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 13:49:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="657543606" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2021 13:49:20 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 13:49:20 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.12; Thu, 7 Oct 2021 13:49:20 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 7 Oct 2021 13:49:20 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 13:49:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lmajyp+6/QEJfZDC3tvNWRXfE+XHyG3jI9eIp7owk8oQ5iqY7/InJOVaF0OXtouIKGV+pmLn7byIenf4XeKUK02IDvPZ04C+QZSjEs+N6Y9E16uaeNhx+1EODtU8KZhue0SEkupX2hF9eruaW1QMqPyyzXoOBEKkLXvJOeRSm9T59cSbMneKr3E6iIYEHiHKyScDNnB8uAX3TJ5DdcRVZrmVg6qbFBHZxBipTNGEE/Hw+Ss//0/Pzs1gkPNud2rshXXiasuzbLD+qzHdGcMeHugfdWBFDrMqaS5LXopqnZtuAots9RIcWAPeN513F9Pv/LWK2ZX/eOFZBhY1w/Mq6Q== 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=5PkhBkBRvHo7T+ofWVKLuq7GCwqfwNWeuacUNUUYtyY=; b=nZlPoo0VPeOMCdozyXj2DpjvMr5HTn8EDvqy8g95kihHOEiLb0G0WYtjU8HhjiLQkBz+wFOb04ccAa40/lHkrw9REqYsF44MDeFpnrFaiZEqgZTSkv0X6oV8S5cTa/MZt4LylNWw5N6L6sK07BCjlCUVgsPt/+BoxjqaU10T4h1szNUNm8pIcXew1HGcywoe0BbUvPl1VXFPYAcOTuMuT3dIxCISHuIYVxS8JoLOzV6EzNG7UQXdVThap5AlkI8hzs61v61IdhyqvqzK3bK9upEsXF+OmIjmP/4iZo5LiIL8rmfgEq76F86QP4OC9vEQxK3cRDoypKpeG5C3C8h4nQ== 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=5PkhBkBRvHo7T+ofWVKLuq7GCwqfwNWeuacUNUUYtyY=; b=ZecY65l+zQNyZUXogXFMfC9nGxPlq1jmbNARAFJ/A1MoVW4Is4gQDuj0zOJePdmE1BQwA/Ye2OctGu0QmjX5iLas9vArBQIntNrfk3YvcNrTDwrOII6FIPaHUlwgUl2kl92FJpqjWmrqW6/nzpkK6z3Zjj0ywmQd89mXRNvY+s0= Received: from SA2PR11MB5196.namprd11.prod.outlook.com (2603:10b6:806:119::18) by SN6PR11MB2589.namprd11.prod.outlook.com (2603:10b6:805:53::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Thu, 7 Oct 2021 20:49:17 +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.4587.020; Thu, 7 Oct 2021 20:49:17 +0000 From: "Carrillo, Erik G" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 11/14] eventdev: move timer adapters memory to hugepage Thread-Index: AQHXun6aUDZahjbJtUm2J+HQ1hXTDKvH+J2Q Date: Thu, 7 Oct 2021 20:49:17 +0000 Message-ID: References: <20211003082710.8398-1-pbhagavatula@marvell.com> <20211006065012.16508-1-pbhagavatula@marvell.com> <20211006065012.16508-11-pbhagavatula@marvell.com> In-Reply-To: <20211006065012.16508-11-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: 6982a966-f5e5-40e7-c3cc-08d989d3ee0a x-ms-traffictypediagnostic: SN6PR11MB2589: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: J/NUujL4Zt+bn1se9qCeM0TFP22ruvSdaqxId4/i9rcg1jCqyWmI+uwqFyYVgg690Ll+ByiSMU2QXK2t6a2AKFzAzdcjCXUN3TX1ADIQtey8vO/MQhQmh87XAkarF3w7MfcuhpIj0nNYzctWdVpPkL7ZXJMqtMj6fvoMAzEhShPUOx/+ztKX6DBTXRIdPdNblBUWOOA0Q0LXGi6+UZn7Nc2W708+xDzoF+sBYSwY6Bx5tHlYWNwp8sfPcGVJgLZczIKRSOiIVoQp+XAviI9qKx15xvbB529C026UxrWe1LrJC6EonVsXQuzAWVeD1uAy1KFmQB+am/7njCtawjtSiO3/EaD3UUctiOotbPHvJzPGY7bfP9WjtMNksyCf8VoGGNkn79FIYcMDzubtXhfC/4+JQvrWhkuL+70o0+gr7woJEmAyiGO12YliseOrVWaLGjRUu+YKGgD5ME7LNmYXLDfLgRZPLw44yJjoi+BHsXuSVzvJMWzJUq0LxaOiMVM1swVuCugk3IovROTIy0cEqdQ++4gge0L/gtuIwvKMbVz6rLjUJzD2PKOB4t0IaZayxx8mCgy4q3ChRVCBg02TkZ2yyqYgo1bFOHLxCysySAULTMcOL/4vxMrLZK2j60AZ49zNFMXsjH3a7Lf9K8lENrxM+UY5ZejtyZ7niVh93QzWbADcviw5I3Nv31bPourGPE603Jn+L6UQ3hEjXW6agQ== 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:(4636009)(366004)(86362001)(64756008)(8676002)(38070700005)(316002)(186003)(83380400001)(66946007)(508600001)(5660300002)(8936002)(52536014)(38100700002)(6506007)(66476007)(9686003)(66446008)(26005)(66556008)(110136005)(71200400001)(53546011)(7696005)(76116006)(55016002)(2906002)(122000001)(33656002)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Uk6P8LfBhL0Vua8emLlrALlzLEKZ9S6tE9DaGIotIZrgYB+EquQLgFXMQSWC?= =?us-ascii?Q?DB2vyNX+Xb9DKowJWNjsp1TdyCual7hHbd6Kt0HGno98KKcPZiGA9M4/Kp2R?= =?us-ascii?Q?zaMGuH69i4l+94RHAqa1NVj/oLl3M6QoZiSmW7bCqvPQ8TCJu+MmMTdB/Bd7?= =?us-ascii?Q?6VWVvYTtlobkBvDZfiG6qUEa770Ow3InrJJecxZscSUw/Fva0VqOdT96k53R?= =?us-ascii?Q?CY4LA8gwflUjAMhgSfyuZEFxSKN3+bKS0P3W7Mk1qtQqQhQmLIRVhJGGkgZ2?= =?us-ascii?Q?oV192aYMpxPaw2TdNnCiKjwwPdXxuDETWHI0LByxFEnCzgPgvqLwEn5C6b4e?= =?us-ascii?Q?73Aj34dFmR9XbpfiOaYiIulthmUPwXRmgnwfdXgP13RFtV1jzgmbtYosNhRy?= =?us-ascii?Q?Zh93npH2wOIPGnbsoQj6hXpPNKVRz5Q+XswC4/JuSrgsEVeiGVO/5KmwY7rj?= =?us-ascii?Q?Xw1ydhdSNxBF0QhGSEr1Fo/NpdX2hQiDN0iJlUeXXZUy9Mz5iXhq/vCQnW8j?= =?us-ascii?Q?6UJOuVEkEtmzWL2xo+SKvtMHrbk3l/9TT/0fs4fWO39QXYAF+h8lB2JIAJIY?= =?us-ascii?Q?yepzLzRutOLD2ooXtmRI8cUYHlxreW6p/JxHKJEL7LU+ztNevMm8me34ZdDi?= =?us-ascii?Q?m7+LwffXcLuZv3bxvalCFhFHcLRkgzZsc7upXiT2nUptw8FbgjWP4OgkGZnn?= =?us-ascii?Q?GnXX4tjmu/Vz8e2J3oK/YPikq58sQgDrJk+Bnk2F38V4FdtefbBTaC4BbpUX?= =?us-ascii?Q?QBjdLDMedNxp2QlijY3wkOiyriluzK3QPLeOHVRTcHfY80ihEAXhMZtgym/a?= =?us-ascii?Q?juUBXy+vdwH3kNXU/cCMe8l8A1N83vlD0ICn3C0QhQvnb07EGN5fXwJFQgyx?= =?us-ascii?Q?qEziSd1xpmJROp6nk0bTCjE2h9So9T8Bt1hnz5HOQIBNubmBlxrnpFrIlJVc?= =?us-ascii?Q?tm66vZ27P8pzMzFx5IWFYnwHcvKOvFsMJMV3l7rUGMnM7fgMwwSeuCVLwlNH?= =?us-ascii?Q?B2v+Ts8bykttsJp2AHzqXaa5qqnkpZd85dVWX1ciYc3Qe9nNEZ3FgHWMCAg/?= =?us-ascii?Q?XKzPrsnqEolE8bM86OEx+nBxNhFNDwkcqEVvM3IQ/LBpzpBVRD8V882Z1hVg?= =?us-ascii?Q?6wJWJOALr39RMZIDnuHWYqGqh0+ZkbqUQsU+Xh6Z4+SW3eSQbPccmrGPcVPQ?= =?us-ascii?Q?McF7XHlx1CASSEEeHMMRCxdgkByl1SlwT3rO4Sd7IcghYmHlTAJdhtUqgeP5?= =?us-ascii?Q?CHmSwa6ON7WLbgb8LGU+ohPQHSzQWCbtWafPH743hY+UrIlqUYjX8WsBdqmN?= =?us-ascii?Q?Cgguugf4hMBthwpYT6PQnpis?= 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: SA2PR11MB5196.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6982a966-f5e5-40e7-c3cc-08d989d3ee0a X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 20:49:17.2163 (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: NmQ+UKL9e6xpv15NWO6t3tF7JAvwtDF6qUdICxyhA/BJf/NANXeivy7/Fd2ujcHj4Qay5aB45YPw2ooaZQal3kS3kGS3IHSeGZ8CqB/Bygs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2589 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 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, Some comments below: > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Wednesday, October 6, 2021 1:50 AM > To: jerinj@marvell.com; Carrillo, Erik G > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 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 > --- > lib/eventdev/rte_event_timer_adapter.c | 24 > +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/eventdev/rte_event_timer_adapter.c > b/lib/eventdev/rte_event_timer_adapter.c > index ae55407042..c4dc7a5fd4 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 > -- > 2.17.1 The rte_event_timer_adapter struct has several fields that have per-process= values. =20 For example, there are three fast path function pointers and each will be a= ssigned distinct addresses for each process in a multi-process scenario. T= he "allocated" field is also per-process. With the changes above, if a sec= ondary process did a lookup() after a primary process did a create(), the = secondary would get a reference to an object with function pointers that ar= e invalid in the secondary process. To fully move the adapter object table into shared hugepage memory, those "= per-process" members would need to be collected into a per-process data str= ucture that could be independently allocated for each process. However, th= at would add one more pointer dereference to get to the fast path functions= , and avoiding that was the original reason to put those pointers there. T= his is similar to the rte_eventdev struct. Thanks, Erik