Re: [dpdk-dev] [RFC 12/15] eventdev: move timer adapters memory to hugepage
From: Pavan Nikhilesh Bhagavatula <hidden>
Date: 2021-09-01 06:30:08
Hi Pavan,quoted
-----Original Message----- From: pbhagavatula@marvell.com <redacted> Sent: Monday, August 23, 2021 2:40 PM To: jerinj@marvell.com; Carrillo, Erik G <redacted> Cc: Ananyev, Konstantin <redacted>;dev@dpdk.org;quoted
Pavan Nikhilesh [off-list ref] Subject: [dpdk-dev] [RFC 12/15] eventdev: move timer adaptersmemory toquoted
hugepage From: Pavan Nikhilesh <redacted> 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.Is the motivation for this change performance or space improvement? Can we add something to the commit message to say?
This was supposed to be a perf improvement change, I will be dropping this for event device as it causes an additional load for getting the base address. For timer adapter I think we can make this change as we return the pointer to the adapter directly, so no additional lookup cost. I will update the commit message in the next version.
Thanks, Erik
Thanks, Pavan.
quoted
Signed-off-by: Pavan Nikhilesh <redacted> --- lib/eventdev/rte_event_timer_adapter.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)diff --git a/lib/eventdev/rte_event_timer_adapter.cb/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);quoted
RTE_LOG_REGISTER_SUFFIX(evtim_svc_logtype, adapter.timer.svc, NOTICE); -static struct rte_event_timer_adapter adapters[RTE_EVENT_TIMER_ADAPTER_NUM_MAX]; +static struct rte_event_timer_adapter *adapters; static const struct event_timer_adapter_ops swtim_ops;@@ -138,6 +138,17 @@ rte_event_timer_adapter_create_ext( int n, ret; struct rte_eventdev *dev; + if (adapters == NULL) { + adapters = rte_zmalloc("Eventdev", + sizeof(structrte_event_timer_adapter) *quoted
+ RTE_EVENT_TIMER_ADAPTER_NUM_MAX, + RTE_CACHE_LINE_SIZE); + if (adapters == NULL) { + rte_errno = ENOMEM; + return NULL; + } + } + if (conf == NULL) { rte_errno = EINVAL; return NULL;@@ -312,6 +323,17 @@ rte_event_timer_adapter_lookup(uint16_tadapter_id) int ret; struct rte_eventdev *dev; + if (adapters == NULL) { + adapters = rte_zmalloc("Eventdev", + sizeof(structrte_event_timer_adapter) *quoted
+ RTE_EVENT_TIMER_ADAPTER_NUM_MAX, + RTE_CACHE_LINE_SIZE); + if (adapters == NULL) { + rte_errno = ENOMEM; + return NULL; + } + } + if (adapters[adapter_id].allocated) return &adapters[adapter_id]; /* Adapter is alreadyloadedquoted
*/ -- 2.17.1