DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] Questions about rte_timer APIs
@ 2020-02-14  5:54 Honnappa Nagarahalli
  0 siblings, 0 replies; only message in thread
From: Honnappa Nagarahalli @ 2020-02-14  5:54 UTC (permalink / raw)
  To: Robert Sanford, Erik Gabriel Carrillo; +Cc: dev, nd, Phil Yang, Gavin Hu, nd

Hi Erik/Robert,
	I was looking at the rte_timer library code and have questions around the way instances of timer list are allocated.

The API 'rte_timer_subsystem_init' allocates RTE_MAX_DATA_ELS (64) number of timer data structs. Each timer data struct acts as an independent instance of timer list. The user allocates an instance by calling 'rte_timer_data_alloc' which provides an index in the instance array. Essentially, the library is allocating the memory upfront even though there might not be a need to have 64 instances. Please correct me if I am wrong.

Usually, creating multiple instances is handled by allocating required memory, as and when required, by an 'init' API. This API also returns a pointer to that instance which is passed to other APIs in the library. For ex: rte_hash library follows this approach. IMO, this is an elegant way to handle multiple instances. This approach does not waste memory and does not put any restriction on number of instances.

I wanted to understand the reasoning behind the current design to handle multiple instances. Appreciate your inputs.

Thank you,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  5:54 [dpdk-dev] Questions about rte_timer APIs Honnappa Nagarahalli

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
	public-inbox-index dev

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/ public-inbox