Commit Graph

371 Commits

Author SHA1 Message Date
Ben Walker
0aa2986475 Replace rte_get_tsc calls with spdk_get_ticks
Change-Id: I809b900321433693ff9f2498183ad0dcdbb15030
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Daniel Verkamp
772cf390b0 event: remove DPDK rte_timer dependency
All timers have been converted to SPDK pollers.

If an app requires rte_timer support, it should register its own poller
that calls rte_timer_manage().

Change-Id: I8a827a357b344deac76d42357a5a84ac2daabbf8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-06 08:57:22 -07:00
Ben Walker
a4747c6048 env: Make the environment library configurable.
This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.

Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:51:37 -07:00
Daniel Verkamp
59955a12d2 event: allow unregistering a poller within its poller fn
Modify the spdk_poller_unregister() function so that it works correctly
when unregistering a poller from its own callback function.

Change-Id: I57fa5ebd8a8bad522e34f597b406a4726f1b76ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 08:41:26 -07:00
Ben Walker
a17ad921e2 Replace RTE_VERIFY with assert
We already require the assert header from the C standard library,
so use that instead of RTE_VERIFY to further isolate DPDK
dependencies.

Change-Id: I4a718af858c88aff6080e33e6c3dd533c077b8f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:56 -07:00
Jim Harris
b5c1e5ada7 event: allocate/free IO channel thread context in reactor
This will help catch any cases where I/O channels are not
released during shutdown.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I96cf93218026b9ef319abcf0662fe258bf75174d
2016-09-26 14:02:07 -07:00
Daniel Verkamp
f0fb6c6d4a event: return status code from spdk_app_fini()
Change the return type from void to int so that the result of
spdk_subsystem_fini() can be reported.

Change-Id: I811c25513e41573ca0c9cb111512d7705d107f66
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-23 12:31:47 -07:00
Ben Walker
086346a4fc event: Allow idle reactors to sleep
The user can now specify a maximum delay, in microseconds, that
defines the maximum amount of time a reactor will sleep for
between polling for new events. By default, the time is 0
which means the reactor will never sleep.

Change-Id: I94cddb69c832524878cad97b66673daa4bd5c721
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-17 10:02:38 -07:00
GangCao
9dfc65b081 nvme: Create Proc Type for primary and secondary processes
Change-Id: I283ce03ed50fd12b9da906b0e09b4559b41776ef
Signed-off-by: GangCao <gang.cao@intel.com>
2016-08-15 09:21:20 -07:00
Daniel Verkamp
5d8c94536a event: hide struct spdk_poller internals
This leaves more flexibility for future changes to the poller
representation without requiring API changes (after this one).

It also prevents the user from accidentally using poller fields in a
non-thread-safe way, since they can't be accessed directly anymore.

Change-Id: I7677d5b93668665d29ae39c5e0ba74333ad3f878
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-12 10:42:12 -07:00
Daniel Verkamp
ac7151b161 app: add function to get current core ID
Change-Id: I3428fc9944f7117facc6488489187dcf8b6ed825
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 15:43:07 -07:00
Daniel Verkamp
c41ab41c17 event: add timer-based pollers
Allow pollers to be scheduled to be run periodically every N
microseconds instead of every iteration of the reactor loop.

Change-Id: Iaea3e98965d81044e6dc5ce5f406bcb7a455289e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-03 09:00:54 -07:00
Daniel Verkamp
921bf34289 event: replace poller rte_ring with TAILQ
The rte_ring used for pollers is already single-producer and
single-consumer, so it is not providing any thread safety guarantees.
ALl modifications to the active_pollers ring are done from the core that
is running the reactor (via events).  This means the rte_ring can be
replaced with a simpler intrusive linked list.

This simplifies the removal of pollers in the middle of the list and
avoids extra allocations for the ring.

Change-Id: Ica149b7a1668a8af1e6ca8f741c48f2217f6f9bf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-01 12:40:34 -07:00
Daniel Verkamp
c943e9ff4f trace: hard-code lcore history array size
Make sure the trace history that is exported via shared memory is always
the same size, regardless of DPDK configuration.

Also removes the necessity of including DPDK headers from spdk/trace.h
(so we have to fix up other files to include what they use).

Change-Id: I32f88921fd95c64a9d1f4ba768ae75e2ca5d91da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-22 12:50:44 -07:00
Daniel Verkamp
0cb9522781 build: include spdk.common.mk in lib Makefiles
Explicitly include spdk.common.mk at the top of all lib Makefiles so
that CONFIG options and other predefined variables are set.

Change-Id: I1e560c294fe8242602e45191a280f4295533ae44
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-18 16:17:40 -07:00
Ben Walker
35b3091eba event: Add a lib to configure with rpc
Linking this new library allows applications using
the framework to be killed via an RPC call.

This only works if the RPC subsystem is loaded.

Change-Id: Ifcf91c212add620fe410589eba5490337c635776
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-13 10:13:49 -07:00
Cunyin Chang
adcbbe19ff event: Add dpdk framework start function into event.
Make sure the reactor mask in profile take effect.

Change-Id: Ia471b2b88a711f05738cf93068c4f3a8c9a3039d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-07-01 10:07:42 -07:00
GangCao
e0f4313dbd event: create/get/put mempool per sockect
Change-Id: I6ea82f7b0ffc86e01466717d1b5bf0816cb232ae
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-30 13:32:30 -07:00
Ziye Yang
e87e3df674 event: fix null pointer issue in spdk_subsystem_fini
The variable cur could be null, so if we use do while
will cause a segment fault

Change-Id: I19ec26e88948a0c3fd957e03e717b68750f40c62
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-15 16:33:55 -07:00
Cunyin Chang
f0d2e5508c event: Remove the concept of subsystem from the reactor.
Eliminate the misconception of reactor, it actually not a subsystem.

Change-Id: I63ea46f0dfa34661f16526a71c47e8fba9813474
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-06-08 09:13:02 -07:00
Daniel Verkamp
eeeac6676d Add event-driven application framework
Change-Id: Iba90db6d8853dde972b4eec2c35eb44eeddae780
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-31 09:58:05 -07:00