From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0042.outbound.protection.outlook.com [104.47.34.42]) by dpdk.org (Postfix) with ESMTP id 5E2071B91F for ; Thu, 26 Oct 2017 17:46:34 +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=LHo3MHpbilvXFfNS6dN9qhCjPIzYjbgLwoxpP0IL/RQ=; b=h7lrfth5oh0ri+xJu9wsoRmYx3qommZxyqB/Xd7BdVD0C99RGQYAfPoBQxOqGlF0CE7aQCgjRqK/dR6IpPwHn20J4vtoRKRIyJw1MLOnQJpJP3KTLXoyiWtRfSiDbpj9umwA969tUr8erq7Y7LyjMSxF/zrllcOs5vQdV1n3BnQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 26 Oct 2017 15:46:30 +0000 Date: Thu, 26 Oct 2017 21:15:40 +0530 From: Pavan Nikhilesh Bhagavatula To: "Carrillo, Erik G" Cc: dev@dpdk.org Message-ID: <20171026154539.GA5511@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> <20171016123708.GA21136@PBHAGAVATULA-LT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0096.INDPRD01.PROD.OUTLOOK.COM (10.174.144.12) To MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 209d0ed1-96a9-4764-6698-08d51c88baf0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:MWHPR07MB3472; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 3:5Cvo9MT21CQpQ5nyDX7Q/MJIVJinG6e0MEN8XSWCbdPpKl+NnikcVb2zxwsrYhYCzQh4rkRIygwAIC6NRw95d13iLkZOeP5Mxwf1ZffjNxCoSNeQ/FfItCOmwrk9y9wUymbofaTK3tpD1UFlYdAYFwBOC5tdVYKquS7yKeXqjc8+O60/lZBfviHmsuXZp0cs/8ZnPBf7i0xJwHTCey40TtyjQnEbDbQbcFRWulawNJs47E1caJPFO1w5WB0Ujk41; 25:YNbuKP67JNvzhiY2cu6BJOgmgvzK0KxX746wIGpIw3eumgyhm3V93cRM7D8Wxx1eKL5FAcKTnzaqST9Ww1jT1V+LY9jTk5iPuWtrg0tqH0oG4cZqT2VYT/WdScGCCAoiuFwksmxmmxG3JnF9JEmoVTM3YxO5ZyXwnK9S+N+hY9qToJ5ThsZjTNRLrnlHn96Ol7/cAFf2gnqjv+dcTouyBTtv1L9foEH2ujy3yjRMKXfvF8UTEqGtppyEF+MjtEgVlX5DBHVCS9d+x8/YJhpffuAXRKWdbc6k0Hif0jHavyQ2JhLN7ezVT5CkEedu2eWO+vSoyWAfROXRlY4/qqgVCw==; 31:Guq+SSJgmkTCNtVZ2T/uESxSIZQ+C0aVlca4gbr2Y0jb3hVfrOrHIHf5Qu2BnwDtflDPtYfDqV614EnKSFHohzrihxqY0B9HvX6a6yJKnhuQfWH8J9r1bM0Dqh8e0Srtm9OlSjh3UqGWz5R/Lml5NvbvJ4vtkygJNnHm2jIc3w8Qft3EONPqzHW26j+htV6HM7lE6ORWHhCfZCU5+ykPlImYe3pjFIWlDXZcE1wubRI= X-MS-TrafficTypeDiagnostic: MWHPR07MB3472: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 20:yo+e02lvfj9ugShmwUVJz1PlxTzclxO82Av5z4hCG+kLfNgMm9S21teJp0JFLZndZfna0yQhEp/sNqPN0s2fZfJM9jd+uFZ5QaIyMjdxkh9/ahA/P0MZ5l7zGK2GKNfOXxUOCQivci9OCS8Y51axXtk4s9zokkJuH78ZWjIzCaTMyMAiVeCW7NX4o5OeGdnJrMuVhm9jcgLcYeAboSHCs35knbj34+GLbjUpZj45K2dVZ7+WzK2+EedaCSLOvNq6ebfxjyQ82GD7KWTX0P1YXlOWNYikuxZ02QOZ/PG7fGRObrSfoqaGrlaeyqTu6RzIdcW3/MB04Ji7/3sQ1cNANAzfTXt7pR9lztS0WRqQXURU7dWF56m7d0vYPM+braRizC6XdnWDO11vXp7TXwbolx9azbhwYIT/PHepuGswe92rxCd+7PYZQzadiA9aUw6z9boRMY8cYQ9PH1S6ncHZl01zk0YgjEK11UCTuAuF9RXxcTnVbOdxMP2hURCZqRS/7UXm4Vmx4d+CdHOslzdC6+FJtoA2QwMMtIlnx1zgaYICsscO+ViN4rcNcPdAuOg57lXI12ZuRoQXi11IJMSZ0kcrxgkjYHlfRnd9fkW90Ew= X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(100000703101)(100105400095)(10201501046)(3231020)(3002001)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3472; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3472; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 4:BqsXD/weDe59eVJpILpoF5+zT7OIUvC8mu+SDHBFjSs9+wE8S5fXrXV+V9Ry2+u5TteqEAcQb9a1k8mbT2ei78sImejI2eGXvOfPWxLLuDkl71/taQhm1zpgbRE18EBAm1VH5oqudGaet/+wJKGlFk3VHYL8wRoVd/bIwdnb0Z/78a+EU4//e6eRc8QT/z+i+2i1nJid+Z4gGD3kHwzDUo+f5h/xoVSz86FviqTEvyM0QcyD+dm22qqD2CNT2SyaTEm3QrGrJXl8qlo2T1sMKt5ERgBefkWp9/c0uJEKAjnw9D1dUhNXNd7xcp4fl/Ddw6EWpWgGkYFWB6yk21RrwA== X-Forefront-PRVS: 04724A515E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(51914003)(24454002)(13464003)(199003)(54356999)(93886005)(4326008)(229853002)(6916009)(42882006)(8936002)(2950100002)(53546010)(6666003)(316002)(189998001)(6496005)(6116002)(16586007)(2906002)(58126008)(50466002)(81156014)(23726003)(6246003)(3846002)(66066001)(53936002)(105586002)(47776003)(106356001)(7736002)(97736004)(72206003)(76176999)(68736007)(55016002)(101416001)(8676002)(81166006)(33716001)(9686003)(305945005)(5009440100003)(50986999)(5660300001)(478600001)(16526018)(1076002)(33656002)(83506002)(25786009)(18370500001)(107986001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3472; H:PBHAGAVATULA-LT; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; MWHPR07MB3472; 23:G0bOQoofC8JDJim1wV4PKD+5zjjMt38epBe+8eRiy?= =?us-ascii?Q?P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ncQAR6Kf9aRmEGUfYbilQ==; 24:MTxc8g4P2JEH/kb3sGCSotzUnWwduaY07ZvtDuA079InfbDbNDEvmWS+U4pSZrfgpn9lXC8Pjy34nceLQf130DGHs1L43i++bkYuyBcy2cg=; 7:NrdDVGv8oskoX3/AxG/wkQvbP7WK4CmoWWaK7zKlABRaeNyj3uL610k0e19V9PdKgS7CNcuBR3CcZExx8Qy6WhoUrRym8ZLWrTlt2NTkiPV5ZkM8H8dxfbHxBoAqRV0IFTTODG+T2DlAoW+pOto2g4d3jV+ejYgUSf2+Y+VVdrzA6SBAG1sx79Y+BZc2iD8IZuOMlUkb/N8immV1K56ZZ5nGcXaBVrn9YPiK3mZMoMA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2017 15:46:30.9459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 209d0ed1-96a9-4764-6698-08d51c88baf0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3472 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: Thu, 26 Oct 2017 15:46:35 -0000 On Wed, Oct 18, 2017 at 09:48:04PM +0000, Carrillo, Erik G wrote: > > > > -----Original Message----- > > From: Pavan Nikhilesh Bhagavatula > > [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Monday, October 16, 2017 7:37 AM > > To: Carrillo, Erik G > > Cc: dev@dpdk.org > > Subject: Re: [RFC PATCH v2 0/1] eventtimer: introduce event timer adapter > > > > 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. > > Hi Pavan, > > OK, I think I see what you mean. We could have a global table of ops structs (one per plugin), where each entry contained function pointers valid in that process. We could save the ops_index in the shared data portion of the timer wheel, and in create() or lookup(), we could use that index to retrieve the ops struct, which could contain an operation to set the fastpath pointers for the timer wheel instance. I assume the *lookup() function would rely on the memzone having a predictable name (e.g. "timer_wheel_memzone_") so that it could locate it knowing only the wheel_id. Ack > > Thanks for the info, > Gabriel Cheers, Pavan >