From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0042.outbound.protection.outlook.com [104.47.42.42]) by dpdk.org (Postfix) with ESMTP id EFD8A1B669 for ; Mon, 16 Oct 2017 14:37:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=er8Gi2brslicbLRGGXCwJe4UaCiTDqjInc0aVszPZCE=; b=Z6aGlHBNDUtnuxSSQ0wx8nRc/hAoAmpjfAqZppLAreRRXBqtx5LdbAAKlhySZI1UzG+fHQR6gkDTVHq0Bs24GySSQ+4Pcbm9Z4wUQ8BXJgbjoU9YLhnmtpKCX1tDvl9DgcsTnWa2UxEgcWy2hNVKLTNh5AwKFudVdnUNwMHtTPM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 16 Oct 2017 12:37:30 +0000 Date: Mon, 16 Oct 2017 18:07:09 +0530 From: Pavan Nikhilesh Bhagavatula To: "Carrillo, Erik G" Cc: dev@dpdk.org Message-ID: <20171016123708.GA21136@PBHAGAVATULA-LT> References: <20170817161104.24293-1-jerin.jacob@caviumnetworks.com> <1506093431-57588-1-git-send-email-erik.g.carrillo@intel.com> <20171003143723.GB10493@jerin> <20171016120436.GA20698@PBHAGAVATULA-LT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171016120436.GA20698@PBHAGAVATULA-LT> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0037.INDPRD01.PROD.OUTLOOK.COM (10.174.214.23) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7630c088-b1eb-4898-413a-08d51492ab71 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:FP6FOREfAtyvhCOxMIuIEdg2nOVfcsIu+c4ib9jRA70S4mTmAbMljdYtgGgkGgCkmIu6VydxgjPQ46UhuLPeZG0gHKbY4e1K9ND5tAov1V5dXMlSwT9fYeGP+qRzscCcOW+PUXB0tjEIJ2zRa22n/PmiOSepLe8ud/GwCx6j1BnKCNasvhHrj8w/nJcf8RUwb3dztgXnaoqqpoT6Ddz5NzGU5j+qZpgh22R0x2xkP5amGREFXrbHpAfqYG3crdHT; 25:BYKg/JSCqOylM31tB8BdL6j0FtDMKKcdQKczKEtDPmMIb1sJ2utXRWDtVHZPSFugUDMp9Fi/qg4jmWgnQuMxwXHg6T9n2CI9sfwYPDEwhe0GREhCh5zvbVeMIV5FJWINFkeJ5xahXd9csS3Lx7wpS5FlypSdUWyk35+aY53wOf/m4+eUWoMXvvViULbBjaNfsGCH0Nss37i05Y2Qd/ohBOhweSKCHurEcEmeCYh2T/LVtoIMsVnjYLVrr+UKzRL/URu1vXN9rOb7+xDh52hB5hQfs6b1XeJa4fHdltsWypmr+k4eGDhQGMegMTH04hJmrVX3s00bdMAO/kevwX7EzK69PRzSGpBTfVle4orUHmQ=; 31:n+DL29MlvBD7I5waWBkx3CFZW8ZkrICsPqQiK6NLrITpJbo+wRgIUO/y6BjyhLnvS1HbBz4bxOZPAPhQxubesbeheBOXNJt3TsUlJnxeGpdVj1hygDJmhqv7jEJJDYYq1l7SrTy0imzIEeJQr0xgbNTK7XG/zSw8vzKHfGekGKA6hEP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(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(6041248)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0462918D61 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(199003)(189002)(24454002)(81166006)(81156014)(8676002)(9686003)(55016002)(316002)(8936002)(68736007)(6246003)(53936002)(66066001)(16586007)(54356999)(50986999)(72206003)(58126008)(50466002)(97736004)(229853002)(33716001)(6916009)(42882006)(2950100002)(478600001)(76176999)(47776003)(6666003)(33656002)(101416001)(23726003)(6116002)(3846002)(1076002)(16526018)(93886005)(6496005)(5009440100003)(5660300001)(4326008)(189998001)(83506001)(305945005)(105586002)(7736002)(106356001)(25786009)(2906002)(18370500001)(107986001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:PBHAGAVATULA-LT; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3466; 23:UhOsUsGgBAFfVA0TqEPUg7JEmn74FsCRCrTgQrto3?= =?us-ascii?Q?7UlrzPmF4OJzabjfFaa9dRtwCTK3XfWG2VqcPinDbV52TfWdUDK4aEa2gZuo?= =?us-ascii?Q?mOj0mJ5TkXt17zgGnNslOMGx5sUCWdu5wHwsFsVZogieeF89+/b+noyQukEU?= =?us-ascii?Q?0lqd651GWBoYpmjCaI8A1guoYTmzdpQDI/YMspvDwHnktQMVGySJ43KJfrrI?= =?us-ascii?Q?QP97riXgqkFcamlyxnZCaQYrI+cWjIBzFbuqLACFBlMHo2I0D9IvjAvLfarp?= =?us-ascii?Q?gmOBLumKVkvEiFQpjAlMDQe/X717RoNm7iRqjnH+9Xei8Q11xvLBkbMz/2a0?= =?us-ascii?Q?R7HDpRcacmrTiTDRHyJCpxFrxz2opvmtBVp+wZDDoKthEqARZKunUJWqev6z?= =?us-ascii?Q?nO3TkhvFfA1OcyL16WUt4a3n8pW36tORF2wgFL9x5p74rv2Pk3uSzQrpiFgq?= =?us-ascii?Q?yI2dHC1yhq3FKe2xH7VupRZP+7Nor+4Bhu+6Ci7ti9jfjZE6YcB/i24z6V7t?= =?us-ascii?Q?4/H+6qnoN/yg0pMYX1SDAQmU0oriOLb9KBdgUYG4Ibo0jIoaceg3IGc61SHZ?= =?us-ascii?Q?I8bPRw10LOhwoRfjL16v+LA2spBSfhl1NrCIeZGYMvMyoKSCEfi0+4JMkakT?= =?us-ascii?Q?G7kmFCsmrpEPaMYCG7ugOKeuWskcCvm39GfAG5/MA8A0rNixVsKyNBwjacjN?= =?us-ascii?Q?2rLYBRLqMfyr8/D1MZsepbEmq+pmAYV+ZhmYywI5c6jxsZOcuemVkUtFmlkO?= =?us-ascii?Q?nl1avf9M9IvbLf1RGiGP+x514bRUz8gjuXMCu7w4xl+ABs1ehpsniTahvV+s?= =?us-ascii?Q?61H9K96168ShXsGY/JembeEouAsVt/bx5W1yVzf2GAlb/4+MVEmOK3ALgFmw?= =?us-ascii?Q?qy9W7iacXjKwyplBsMh2nrmWQmwTKbWhKqA1Fvjgj9LxCrQaziW0Fe4KBc5o?= =?us-ascii?Q?kmJq7w38GLhHSPhmHHuy0asv81bnIVpRnZVfjgnvVB97SZHaXDdK7eGge2BV?= =?us-ascii?Q?pknc78ZWuF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UqLnkulWRQJSKNkxUkk09eASjCeLGOwcZKFUaZLsCM+3r6+0oqoLykDKnSA0Yf5iXT9AHeMeovzpMaCx4d69UhhCDWGTZjINYQ37nCWYL3uZ6pa+E2MgN2TG2k0/igrA7zuBgzO/b298Hn6nY7W6Ed25VU2ybFUverz2Yk8xnzx0LMFmmeU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2017 12:37:30.6587 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: Re: [dpdk-dev] [RFC PATCH v2 0/1] eventtimer: introduce event timer adapter 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: , X-List-Received-Date: Mon, 16 Oct 2017 12:37:34 -0000 On Mon, Oct 16, 2017 at 05:34:36PM +0530, Pavan Nikhilesh Bhagavatula wrote: > On Mon, Oct 09, 2017 at 08:30:35PM +0000, Carrillo, Erik G wrote: > > > > > > > > The second big change is to replace API parameters specifying pointer > > > > to rte_event_timer_adapter with ids, which seems more common > > > > throughout DPDK. > > > > > > > > Other changes include: > > > > - removed rte_event_timer_adapter_lookup() function, since APIs no > > > longer > > > > accept pointer to rte_event_timer_adapter > > > > > > There is one difference between ethdev rx adapter, where we have > > > rte_event_timer_arm_burst(), rte_event_timer_arm_tmo_tick_burst(), > > > rte_event_timer_cancel_burst(), > > > APIs in fastpath. So any multi process scheme where resolving the fastpath > > > API functions in _one_ or zero redirection is fine. > > > > I see, makes sense. > > > > > > > > I guess in we may need 2 or 3 indirection to resolve the fastpath functions > > > with id scheme. Please choose scheme with one 1 or no redirection. > > > I think, > > > - By allocating adapter memory from the heap and > > > > Just to check, are you talking about the heap (e.g., rte_malloc) in hugepage memory? > > Yes, If we use rte_memzone_reserve and create the adapter in the primary > process, the name can be used to do a lookup in the secondary. > > > > > - adapter hold the function pointers for multi process and > > > - mempool kind of pointer object scheme without id and lookup() Can > > > resolve function pointers without any indirection. > > > > > > > Can you elaborate here? In the mempool implementation, it looks like there's a per-process array of ops objects, and each mempool instance has an index into the array that it uses to select the ops object to call through. Since the ops structures are initialized per-process, they get function pointers valid in that process - which relates to the second point above. If the adapter holds function pointers for a primary process (for example), they'll be invalid in the secondary. Am I missing something? > > > > Once adapter is created using memzone in the Primary process, the secondary > process can use the memzone name to get the pointer to the adapter and use data > such as ops_id stored in the memzone to fixup the fastpath function pointers. > The slowpath could still use ops_id based function pointers(mempool). > > > Thanks, > > Gabriel > > > > > So please analyze on those lines as well. > > > > > > > > > > Pavan Adding to this Have a two level scheme such as: --Allocate this structure from a global array based on the adapter ID: struct rte_event_timer_wheel { event_timer_arm_burst arm_burst; /**< Pointer to driver arm_burst function. */ event_timer_arm_tmo_tick_burst arm_tmo_tick_burst; /**< Pointer to driver arm_tmo_tick_burst function. */ event_timer_cancel_burst cancel_burst; /**< Pointer to driver cancel function. */ --Allocate the data section using memzone reserve. struct rte_event_timer_wheel_data *data; /**< Pointer to timer wheel data*/ struct rte_event_timer_wheel_ops *ops; /**< Driver specific ops */ } __rte_cache_aligned; /** * Timer wheel data structure. */ struct rte_event_timer_wheel_data { void *wheel_priv; /**< Timer wheel private data*/ uint8_t ops_index; /**< Timer wheel ops index id. */ uint8_t wheel_id; /**< Timer wheel id. */ uint8_t event_port_id; /**< Optional Event port used when the inbuilt port is absent.*/ const struct rte_memzone *mz; /**< Timer wheel memzone pointer. */ struct rte_event_timer_wheel_config conf; /**< Configuration used to configure the wheel. */ RTE_STD_C11 uint8_t started : 1; /**< Flag to indicate wheel started. */ } __rte_cache_aligned; /* Primary process */ *_create(wheel_id, ...) { struct rte_event_timer_wheel *wl; /* do checks */ ... wl = &rte_event_timer_wheels[wheel_id]; ... /* Get ops ID based on eventdev */ ... ret = rte_event_dev_get_timer_wheel_capability(event_dev_id, &flags, &ops_id); mz = rte_memzone_reserve(name, ...); ... /* fill in data */ data = mz->addr; ... data = ops_id; ... /* Call the driver specific functions. */ } /*Secondaty process*/ struct rte_event_timer_wheel * rte_event_timer_wheel_lookup(uint16_t wheel_id) { ... struct rte_event_timer_wheel *wl; struct rte_event_timer_wheel_data *data; ... /* Do checks*/ ... /* Look up memzone created in primary. */ mz = rte_memzone_lookup(name); data = mz->addr; /* Setup up global array in secondary */ wl = &rte_event_timer_wheels[data->wheel_id]; wl->data = data; ... /* Use the ops_id set in primary to get the ops in secondary*/ wl->ops = rte_event_timer_wheel_get_ops(data->ops_index); /* Reset the ops*/ (*wl->ops->set_ops)(wl); return wl; } Hope this clears few things up.