Commit Graph

371 Commits

Author SHA1 Message Date
Shuhei Matsumoto
46a3d50baa subsystem/nvmf: Add set_nvmf_target_options/config RPCs
Two new RPCs allocate and initialize options and conf dynamically.
Initialization of NVMf subsystem skips initialization of them
if they are already allocated.

To use and test them, add python script too.

Change-Id: I3be83c33edf9960cb4340d52abb47b7331a6fb92
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406932
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-12 17:41:29 +00:00
Ben Walker
a83f91c29a thread: Replace #include of io_channel.h with thread.h
Change-Id: I6babd4cf990bf19b510db88bdfb0ca81e29d9252
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/414700
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Madhu Pai <mpai@netapp.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-12 15:24:07 +00:00
Ziye Yang
9f697e0fe2 nvmf: change judgement to assert
Reason: It should never fail, which should
comply with the logic in nvmf_tgt_destroy_poll_group.

For the current case, if the judement fails,
we still add the g_active_poll_groups, the logic
is not correct. And according to the analysis,
the poll group creation should not fail.

Change-Id: I408ee1e8099f709330b8a6ffd26cf27d6a549bed
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/414565
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-12 01:32:35 +00:00
Vishal Verma
48738e383d event: Remove timer poll count checks
This removes checks for timer poll iterations
within a reactor.

Change-Id: Id8eea26dab201064123575998b3b24e1f609ac5a
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/412694
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-11 22:26:21 +00:00
Jim Harris
a2b5c37ac9 event/app: add spdk_app_usage
This allows applications to trigger printing of the
default SPDK command line option usage messages if
needed.  This could be useful in cases where the
app expects the user to specify a parameter and
finds the parameter was not specified after
spdk_app_parse_args() is finished.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6f2ebdfe1488091a539830f9e78e342a6c601382

Reviewed-on: https://review.gerrithub.io/414472
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-11 17:39:56 +00:00
Daniel Verkamp
57ae6bf646 nvmf: allow overriding namespace UUID in RPCs
The default is still to retrieve the bdev UUID, but now the end user may
also specify their own UUID if desired when adding NVMe-oF target
namespaces via construct_nvmf_subsystem or nvmf_subsystem_add_ns.

Change-Id: I950eb84b9fdecbc2eae8ca39d9acd6acabe8d31d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/414269
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-11 07:41:39 +00:00
Ben Walker
8c9508f9b3 nvmf: Correctly unregister nvmf tgt as an I/O device
Change-Id: I9552354d620986c2a3d6b071f32b587e9e683198
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413861
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-07 16:07:38 +00:00
Srikanth kaligotla
8580daa1ac nvmf: SGL support for NVMF RDMA Driver.
Change-Id: I447754c69de432b5a65dc8c1d9ae690926e88c51
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Srikanth kaligotla <kalis@netapp.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410302
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-04 17:15:49 +00:00
Shuhei Matsumoto
59b3479bfd subsystem/iscsi: Add set_iscsi_options RPC to set global params
An new RPC set_iscsi_options allocates and set options dynamically.
Initialization of iSCSI subsystem skips initialization of options
if it is already allocated.

To use and test this RPC easily, add python script too.

Change-Id: I71e252da6495a194ae9a1a9e3aaae4feb543487a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403624
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-01 20:15:59 +00:00
Dariusz Stojaczyk
f8387acaa5 event/app: fix setting "single-file-segments"
This got broken in 93cb4a31 [1]

[1] 93cb4a31: event/app: Refactor initialization of app environment
in spdk_app_start()

Change-Id: I9dca9694d50b9132761b57da192ecd1a774337ab
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/413168
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-01 20:14:32 +00:00
Shuhei Matsumoto
abfed22981 iscsi: Add JSON config dump for iSCSI subsystem
Add base of JSON config fump for iSCSI subsystem in this patch.
JSON config dump for target node is already merged and it is added
to the JSON config dump for iSCSI subsystem first.

Besides, spdk_json_write_named_* APIs are applied to JSON config/info
dump for target node to reduce and clean the code in this patch.

Config dump for global parameters will be handled in different patches.

Change-Id: Iee786fbda3683c75a47c55b16d6db0235ac60896
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406493
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-09 17:18:30 +00:00
Shuhei Matsumoto
28589dbbe8 rpc: Add start_subsystems_init RPC to start subsystems when -w option is used
RPC state of the RPC server, g_rpc_state is set by spdk_rpc_set_state(state).

If the command line option '-w' is specified, g_rpc_state is initialized to
SPDK_RPC_STARTUP. Otherwise, g_rpc_state is initialized to SPDK_RPC_RUNTIME.

When g_rpc_state is initialized to SPDK_RPC_STARTUP, SPDK start RPC server
and wait for start_subsystems_init RPC.

When SPDK receive start_subsystems_init RPC, SPDK start initialization of
subsystems. The RPC waits for completion of initialization of subsystems.

When SPDK completes initialization of subsystems, SPDK change
g_rpc_state to SPDK_RPC_RUNTIME and then start application.

Upcoming new RPCs to initialize options of NVMf-tgt and iSCSI-tgt will be
able to be allowed before start_subsystems_init RPC is called.

Change-Id: I4fa9c22b64e2fdbc9b9fdb2c47f0018f73f84f7e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406919
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-03 19:48:15 +00:00
Shuhei Matsumoto
e008db08e7 rpc: Add state_mask to each RPC method to make sets of RPCs
Add state_mask to each RPC method and state to RPC server, respectively.
State mask of RPC method is set at registration. State of RPC server
is changed according to the state of the SPDK.

When any RPC method is recieved, if the bit of the RPC server is on in
the state mask of the RPC method, it is allowed. Otherwise, it is
rejected.

When any RPC is rejected by state_mask control, the new error code
is returned to describe the error clearly.

Change-Id: I84e52b8725a286e9329d61c56f498aa2c8664ec1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407397
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-03 19:48:15 +00:00
Dariusz Stojaczyk
90dfc392cc event/reactor: take into account ring metadata size in event mempools
See previous patch for some background.

rte_mempool uses the following formula for its ring allocation size:
```
count = rte_align32pow2(mp->size + 1);
sz = sizeof(struct rte_ring) + count * sizeof(void *);
sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
```

With count==262144, rte_mempool was trying to allocate
(2MB + sizeof(struct rte_ring) physically contiguous memory.

Change-Id: I69e8cdcbcaaaa8a053540588afa6eb2fd36c525b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408926
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-03 19:46:11 +00:00
Dariusz Stojaczyk
408bb168ac event/reactor: take into account 1 extra slot in event mempools
The following assumes we use env_dpdk underneath.

rte_mempools use rte_rings internally. When creating
a mempool with capacity N, we internally try to create
a ring with least N+1 size. That's because rte_rings
need one extra empty element to differentiate between
the full and empty state. To make it worse, the ring
size has to be a power of two, so rte_mempools use
`rte_align32pow2(mp->size + 1)` for the size calculation.
And rte_ring memory has to be physically contiguous.

Allocating a mempool of capacity 262144 requires at
least (2 * 262144) * sizeof(void *) = 4MB memory. This
made us require at least 2 physically contiguous
2MB hugepages.

Change-Id: Iabc984a29a60c0b2cf5309a78cd1bcce28ac7b3d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408925
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-30 17:25:51 +00:00
Young Tack Jin
d546e3d958 app: pci_black/whitelist on global config and command line option
Ioat config's Whitelist is late for DPDK EAL and single application
occupies all IOAT copy engines.

Change-Id: I8749f740ff1bec5bb022b39fc2256880369b467a
Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/405911
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-30 17:25:41 +00:00
Pawel Wodkowski
5b424282c1 nbd: add JSON config dump
Change-Id: Ib3c97c6d9152a3f61a56d640c875151bdab40278
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/408320
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-24 21:46:42 +00:00
Shuhei Matsumoto
df8a61c253 app: Fix the wrong order of usage of command line options.
I add the usage comment for -u option into the middle of -s option
by mistake.

Change-Id: Iee013122f9bf3b58969c3ff14b0cc5b079f125a3
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/408595
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-23 15:53:14 +00:00
Ben Walker
6518338fa0 event: Handle invalid lcore passed to spdk_event_allocate
Change-Id: Ib438db398f899946ef7d2f1be3d4c7424ed2fbcf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408252
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-19 15:48:36 -04:00
Ben Walker
1d94536417 nvmf: Bound the maximum number of namespaces that can be configured
Make the bound enormous, but bound it so that we don't run out
of memory.

Change-Id: I014b3df3be92ae8bd85fea95f514225adc3eefe2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408247
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-19 15:48:36 -04:00
Seth Howell
4ca87a01b4 nvmf: make spdk_nvmf_subsystem_remove_ns asynchronous
Update the thread-local caches with new namespace data during each call
to spdk_nvmf_subsystem_remove_ns to handle the case where the user
requested to remove a namespace and then immediately add a different
one at the same namespace id. This makes the call asynchronous.

Change-Id: I8fd1968f7da78966386de18506b98d403b82d80e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-18 15:41:00 -04:00
Ben Walker
4d2e54a635 nvmf: Handle addresses that don't contain a port
Change-Id: I0c0c455ccf6f00ff95e7f1d2f0391fc44c6b4b2a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408219
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-18 15:35:12 -04:00
Daniel Verkamp
0a162815d6 Revert "subsystem.c: make subsystem_remove_ns asynchronous"
This reverts commit 498f9add11.

Making the subsystem removal asynchronous seems to be triggering an
intermittent failure in the NVMe AER test.  Let's revert this for now
until we can diagnose the issue.

Change-Id: Ie1d598f0d5cce07e6869d87cd8388848caa78e46
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408118
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 20:17:27 -04:00
Seth Howell
498f9add11 subsystem.c: make subsystem_remove_ns asynchronous
Performing a subsystem update on each poll group after the addition or
removal of a namespace allows us to avoid the case where we pause a
subsystem, perform a removal, then an addition, resume the subsystem and
don't update the channel for that subsystem. This, however requires that
spdk_nvmf_subsystem_remove_ns be asynchronous.

Change-Id: I856572c02e6267f708da3a956accbbedae7260fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407012
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 18:23:19 -04:00
Pawel Wodkowski
a3f8876777 vhost: add JSON config dump
Change-Id: If6c9ea6f9959b6c34ef90b8e382ceba9889040ee
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404373
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-16 19:27:33 -04:00
Shuhei Matsumoto
e5c5740911 app: Add "NoPci" to command line options
Add "NoPci" to command line options as '-u' to avoid lost of
compatibility when JSON config file is supported.

Change-Id: I8ee429f4f66f8837da22ef8e259a1a011edd9257
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407036
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Shuhei Matsumoto
67f2fb6363 app: Fix scan-build errors due to optarg handling
Change-Id: Ia952f0a962ee63d25ac5297498bffb7e70e5204b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407029
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Daniel Verkamp
be0eef0a0d nvmf: check for missing NQN in conf parsing
Avoid dereferencing a NULL pointer if NQN wasn't specified in the
configuration file.

Change-Id: Ie43111fce2c5fcf06bad00af10413a665dfbc45f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407484
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-12 17:56:21 -04:00
Ben Walker
2b79861deb nvmf: Make spdk_nvmf_tgt_listen asynchronous
This was internally asynchronous already, but make it
explicitly asynchronous so other code can properly
wait on the operation to complete.

This fixes an intermittent CI crash.

Change-Id: I81c9b19673566047dcffa94796236ca9fd7fa7d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406226
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 12:54:31 -04:00
Daniel Verkamp
9770ee7817 nvmf: reduce log level of informational messages
Change-Id: I595f0ec871174557a35811fe3b102c33a5a60ab0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405931
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 12:06:45 -04:00
Shuhei Matsumoto
0fed4e0704 copy_engine: Support dump config text for IOAT config
IOAT module of copy engine requires config information in the .INI
config file. However dump config text is not supported yet.

Dump config text is legacy feature but this becomes a preparation
for the upcoming JSON config file.

Change-Id: I9b7349cac9c00ca3ce1d944a84cbc445a6f1aec4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405845
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-04 12:18:31 -04:00
Daniel Verkamp
e134fa47c2 app: set default print log level INFO, log NOTICE
This causes INFO logs to be printed to screen, but only NOTICE and more
critical logs to be sent to syslog.

Change-Id: I1371cd1485348da82d073d7f929d90609adbc3d8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405932
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 13:52:35 -04:00
Shuhei Matsumoto
af7cbd44b0 event/app: Refactor initialization of trace in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: I259f17dd2b2a9c886bae729b40792f04aa638c3a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405364
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-03 13:21:22 -04:00
Shuhei Matsumoto
93cb4a311a event/app: Refactor initialization of app environment in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: Iedcbdeef5cc48c9aab4137735c1eae8daeb63950
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405363
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-03 13:21:22 -04:00
suman chakraborty
5e98dfd126 nvmf: add capability to add namespaces dynamically during active connection
1) The user should provide MaxNamespaces during the construction of the subsystem
2) The namespace which is added should have nsid less than or equal to MaxNamespaces
3) If the user does not provides MaxNamespaces then the exsisting behaviour continues where the nisd can grow dynamically when it is not connected.

Change-Id: I54769d9669575a5f6bf56fe5a262191ac51c474d
Signed-off-by: suman chakraborty <suman.chakraborty@wdc.com>
Reviewed-on: https://review.gerrithub.io/405375
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 19:24:29 -04:00
Shuhei Matsumoto
cf4cf8d52a event/app: Refactor read global params of config file in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: Ia2b36e517b59b6ac1ffb12cb818efc8064fae495
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405362
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 17:31:04 -04:00
Shuhei Matsumoto
a4c86be7f0 event/app: Refactor check config file operation in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config
file.

Change-Id: I157573eea48b774579158f41a9010e5faa1a3de5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405361
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 17:31:04 -04:00
Pawel Wodkowski
44758678e6 rpc: free req before kill() to make asan complain a little bit less
Change-Id: I1c33687d37b2108acbc15ef09902ded194106633
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405428
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 16:18:34 -04:00
Dariusz Stojaczyk
aa8e7002ba app: add -g flag hinting dpdk to create just one hugetlbfs file
This makes use of the `--single-file-segments` DPDK param.

Change-Id: I21ddd955841748ea087c0d006875514be56f2107
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/401112
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-27 21:23:53 -04:00
Pawel Wodkowski
2f2dde6394 event: allow subsystem to write configuration in async way
Change-Id: I5a09551ff6a97ae363fa6166b284cbfc2538d736
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404372
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-27 02:57:28 -04:00
Pawel Wodkowski
e7cb376aad subsystem,bdev: rework RPC JSON config dump
Changes:
- change write_config_json to return void as return value is useless.
- int spdk_bdev_config_json() -> void spdk_bdev_subsystem_config_json()
- int spdk_bdev_write_config_json -> void spdk_bdev_config_json()

Change-Id: I46e2e974abada0df67c07ba961543900f8334a8d
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405052
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-27 02:57:28 -04:00
Pawel Wodkowski
5ffa5c003a bdev: introduce 'get_bdevs_config' RPC call
Write information needed to recreate each bdev.

Change-Id: I3d2b24fd4aaa8b98ec558d864cc28b55a899452f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401217
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:57:44 -04:00
Dariusz Stojaczyk
f70f4b8568 lib/event: do not clobber g_spdk_app on failed init
This fixes a double free in spdk_app_fini().
If spdk_app_start() failed, the g_spdk_app.config
was becoming a dangling pointer which would be
accessed and freed by spdk_app_fini()

Change-Id: Ifa833f5706d391356df39db4e1c538db7a1c7dcb
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/404358
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:46:50 -04:00
Pawel Wodkowski
bd4ecea505 subsystem: add per module configuration dump
Change-Id: I5c4e51cd9cd97b05ab9a95cbe084ff2741f6ef58
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/402323
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 02:47:40 -04:00
Daniel Verkamp
a05f88ff34 nvmf: retrieve namespace UUID from bdev
A new optional parameter is added to the NVMe-oF target namespace
options to set the Namespace UUID, which will be reported via the
Identify command Namespace Identification Descriptor list.

Change-Id: I53c6d6fa6475d3395d412d196b42000715e9ed81
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/400894
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-20 17:18:44 -04:00
Daniel Verkamp
bf131d8443 nvmf: remove unused struct spdk_nvmf_probe_ctx
This was left over from direct mode.

Change-Id: I967e59f95cc097da09bb35ea77eb5f7423a4ac8a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403385
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
270df2bfd7 nvmf: move g_tgt.tgt to a single global variable
Eliminate struct nvmf_tgt and the g_tgt global variable.

Change-Id: I6b737c4b85dc7d063ead1df5417d344c0f35a30d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403384
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
42313b374b nvmf: move g_tgt state and core into nvmf_tgt.c
These don't need to be exposed in the subsystem-wide header.

Change-Id: I5da31b02aaa2fba6e19fbc90dbf4cabc90240b0b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403383
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
0048f79819 nvmf: remove unused #defines in conf.c
Change-Id: I2ef159d41d375c907fa529ff24cb0bd9d7654ea4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403382
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
bbbd0d643a nvmf: remove nvmf_tgt_create_subsystem()
After the previous cleanup patch, this was just calling
spdk_nvmf_subsystem_create() without any other functionality, so call
spdk_nvmf_subsystem_create() directly from its call sites and remove it.

Change-Id: I5dc1a0a00025a120d71270c5a5c94e8d74c2a3ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403381
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
524e8fc976 nvmf: centralize duplicate subsystem NQN check
This should be enforced by the main NVMe-oF target library, not in the
event subsystem code.

Change-Id: Ibce4fd78710b4a9da374e3d5979df4a16e91533c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403380
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
3f987aa84d nvmf: remove spdk_nvmf_construct_subsystem()
After the previous cleanup patches, this function was just calling
nvmf_tgt_create_subsystem() with no other functionality.

Change-Id: I1b20887cade7496093e0b69778df30f818eeb764
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403379
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
1d48012929 nvmf: set serial number after creating subsystem
Remove the serial number from the parameters of
spdk_nvmf_construct_subsystem().

Change-Id: Ib6d394cc98fddf85fc878fe0a8c8aa0fdcddf7f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403378
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-14 12:54:15 -04:00
Daniel Verkamp
72d72f503c nvmf: add hosts after creating subsystem
Remove the array of allowed hosts from the parameters of
spdk_nvmf_construct_subsystem() and add the hosts individually now that
we have the capability to add them after subsystem creation.

Change-Id: I8b05e44d6a254f8d5848975e4bcfb7847e2cf4f3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403377
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 14:11:40 -04:00
Daniel Verkamp
333e9299b1 nvmf: add listen addresses after creating subsystem
Remove the array of listen addresses from the parameters of
spdk_nvmf_construct_subsystem() and add the listen addresses
individually now that we have the capability to add them after subsystem
creation.

Change-Id: If9b9e5f5ce2e6af2bddbda7c3926170f2296abdd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403376
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-13 14:11:40 -04:00
Roman Sudarikov
c3bc40a6ef io_channel: add return value to pollers
This will be used to track time used in pollers - each poller can now
indicate if it found any work to do or not.

For cases where it was obvious and the infrastructure was already in
place, existing pollers have been modified to return 0 or a positive
value to indicate whether work was done.  Other pollers have been
modified to return -1 by default, indicating that the poller isn't
indicating anything about whether work was performed.  This will allow
us to find un-annotated pollers easily in the future and fix them
incrementally.

Change-Id: Ifebfa56604a38434fac5c76ba7263267574ff199
Signed-off-by: Roman Sudarikov <roman.sudarikov@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391042
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 11:16:20 -04:00
Daniel Verkamp
abe4c73f40 io_channel: use spdk_poller_fn consistently
There are two separate function pointer types declared in io_channel.h:
spdk_thread_fn for cross-thread messages, and spdk_poller_fn for
pollers.  They currently have the same signature, but this will be
changing in an upcoming patch, so we need to fix the poller-related
functions to use the correct type (a few were using spdk_thread_fn by
mistake).

Change-Id: I0f0d8f1eea9905395125fc91e0355a49e65be99e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403598
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 11:16:20 -04:00
param
963b3a3bf7 nvmf : RPC to remove a listener
Change-Id: I013338b39e5e3946d7e3034b4e98879bd2d252e2
Signed-off-by: param <kumaraparamesh92@gmail.com>
Reviewed-on: https://review.gerrithub.io/403211
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-13 01:01:09 -04:00
Daniel Verkamp
393b657ff2 event/nvmf: remove unused function declaration
This is a leftover from moving nvmf to a subsystem.

Change-Id: I6ad07d3c60dff29e34b92c9cf18ac451cfd00918
Fixes: 2491021f64 ("nvmf: convert nvmf_tgt into an event subsystem")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403374
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-13 00:57:56 -04:00
Lance Hartmann
c25402c5db lib: Return instead of exit in trace
Modifies behavior of spdk_trace_init() such that it returns
on failure instead of terminating with exit().

Change-Id: I0ba321cddd233008a4b19bc592728230d89a11b2
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/403357
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-13 00:53:35 -04:00
Daniel Verkamp
7f2ff992ee event: update nvmf subsystem for new registration method
Change-Id: I94bbf1f035aca463530450811200f1f1800d6485
Fixes: 4294719ed7 ("subsystem: make subsystem declaration ...")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403355
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-09 12:57:57 -05:00
Pawel Wodkowski
4294719ed7 subsystem: make subsystem declaration macro just register subsystem
Don't do anything under the scene as adding/removing fields in struct
spdk_subsystem will require both macro change and C file changes.

Change-Id: I11bc0d5758edd7e0e0bd3f93e251d868cd9b1d2b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-09 12:07:35 -05:00
Daniel Verkamp
2491021f64 nvmf: convert nvmf_tgt into an event subsystem
This is required as part of our effort to build a single target app that
can run e.g. NVMe-oF and iSCSI targets in the same process.

Change-Id: Ic8426df08899070d709e3675a57f47f64c23c5eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403218
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-09 09:56:44 -05:00
Lance Hartmann
b9be940ae9 lib: Return instead of exit in event
Modifies behavior of spdk_app_start() and spdk_app_parse_args()
such that they return on failure instead of terminating with
exit().

Change-Id: I82566417f04e1ae2e3ca60a00c72e664db26c9e4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/401243
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:47:01 -05:00
Yanbo Zhou
d79ae3e253 event: remove two deprecated functions
Change-Id: I68820dc3b12934bc6bbc88872bf4bef44a05c396
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/402489
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-05 20:34:49 -05:00
Daniel Verkamp
8a6ba58cb4 scripts/check_format: check for spaces before tabs
Automatically detect more whitespace errors.

All existing cases are fixed; only whitespace change (verify with
diff -w) except for one comment style fixup in include/spdk/nvme.h.

Change-Id: If750e54b9c8e3421ea6feda5f20184a31431631e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402360
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-05 11:09:13 -05:00
Ziye Yang
a2c6b71614 lib/iscsi: Make iscsi subsystem init in an asynchronous way
Prepared for adding spdk iscsi poll group.

Change-Id: I8cca51fcf6ca0d51982b8f28d52c4d102ce1fd73
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/400903
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-23 15:45:19 -05:00
Pawel Wodkowski
ba1859ed55 subsystem: add "get_subsystems" RPC call
Change-Id: I8927269134a1bab86a1dfb677bc38dc7f25c8ea4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/400634
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-23 15:27:16 -05:00
Daniel Verkamp
ff12a9b540 rpc: remove [Rpc] configuration file section
This section was deprecated in the previous release, and its removal
was planned for v18.04.

Users may configure the RPC listen address via the command-line '-r'
parameter.

Change-Id: Ic714417b87d422492b8742852c16983eb61793c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398239
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-02-06 11:15:39 -05:00
Dariusz Stojaczyk
3fb4bc717b vhost: move app fini to the vhost subsystem
We already have a vhost subsystem and have to do
its fini anyway, so let's remove application fini.
Technically, any SPDK app can use vhost library
and create vhost devices, so we need to delete them
on shutdown in all cases - in module fini.

Change-Id: I013b45b4e73fd19288b9c10bc995dc24894ecf35
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/396573
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-02-06 11:05:01 -05:00
Tomasz Kulasek
601bcbcf66 util: extend cpumask to hold more than 64 cpus
Fixes github issue #218.

This patch introduces spdk_cpuset object to store and manipulate
the set of individual CPUs. The main objective of this object is
to replace cpumask declared as uint64_t and extend the limitation
of supported CPUs (lcores) above 64 CPUs.

spdk_cpuset is always allocated dynamically and accessed by opaque
pointer, what makes it easier to extend in the future without
breaking API/ABI.

This patch also extends parsing function allowing to set cpumask
using a list of cpus e.g. "[0-4,10,12]" sets mask of 0,1,2,3,4,10,12
as well as hexadecimal string with and without "0x" prefix.

Change-Id: I475c3ba7fab629021a22e03176e57e400dd24a49
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/390794
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-25 18:51:50 -05:00
Lance Hartmann
095f4254f1 lib: Return instead of exit/abort in env_dpdk
Modifies spdk_env_init() and spdk_mem_map_init() such that
they return on failure instead of terminating with exit()
or abort().

Change-Id: I054c1d9b2e46516ff53d845328ab9547f54bdbc4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/393987
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-10 16:20:15 -05:00
Daniel Verkamp
543cb17248 build: remove $(ENV_CFLAGS) where not necessary
Only Makefiles for libraries that directly depend on DPDK (rather than
the SPDK env abstraction) should add $(ENV_CFLAGS).

Change-Id: Ifdf44d3ef8c42bbf7f20edd524b330d00658235b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392818
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-03 12:05:59 -05:00
Shuhei Matsumoto
d34d32f684 event: Replace the constant SPDK_MAX_REACTORS to spdk_env_get_last_core()
SPDK reactor is one per cpu and SPDK_MAX_REACTORS is used as the
maximum number of cpus locally in the file.

When the maximum number of cpus is changed, SPDK_MAX_REACTORS is likely
to fail to be changed.

Adopting two improvements for iSCSI by Ziye to the reactor will be safer
than now for the reactor.
- iscsi/conn: remove rte_config.h header
- env: export spdk_env_get_last_core function

Change-Id: I4941454ffdb704fa7799549e1f190c9bae3a4421
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392911
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-28 12:03:40 -05:00
GangCao
c22f12c8df event: update the poller's period_ticks calculation
There existing an overflow for the large value of sleeping time
for the poller and the actual time may be incorrect setting due
to this overflow. Update the calculation here.

Change-Id: I14fe21d3f0e1abaa9d13d3d6254aff254d2dfcc3
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/392127
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-19 18:49:16 -05:00
Seth Howell
1cc15f10fc lib/event replace printf and fprintf with spdk_log
there are still several printf statements in app.c but those occur
before the call to spdk_log_open

Change-Id: If017c4d658ca45f34b97500bb1a3db5ab1f0675e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/391888
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-19 11:59:21 -05:00
Shuhei Matsumoto
304d851a5d lib/event/app: Remove use of perror() for malloc() failure
All SPDK libraries should use the spdk/log.h family of functions
for logging.

Change-Id: I4b9f172102c6d7998d3a634573493db3fe25ff76
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/391686
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-15 16:13:27 -05:00
Dariusz Stojaczyk
ec6a1afbdb util: add a helper function for parsing capacities (1K, 128M, 2G)
Also used it in parsing `-m` SPDK app param,
meaning that it can now accept numbers
followed by a binary prefix - like 512M or 2G.

Change-Id: If458dc08429237f2cb3f3f661bcaf382468df0f0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/391670
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-13 21:19:53 -05:00
Daniel Verkamp
59970a89be astyle: enforce braces around single-line statements
Require braces around all conditional statements, e.g.:

    if (cond)
        statement();

becomes:

    if (cond) {
        statement();
    }

This is the style used through most of the SPDK code, but several
exceptions crept in over time.  Add the astyle option to make sure we
are consistent.

Change-Id: I5a71980147fe8dfb471ff42e8bc06db2124a1a7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390914
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:19:32 -05:00
Xiaodong Liu
f90beaeff0 nbd: add nbd as one event subsystem
Add g_spdk_nbd to record multi-nbd-disk in the
future. nbd subsystem will be used to init and
finish g_spdk_nbd and its linked spdk_nbd_disk.

Change-Id: Ia67caa57b9920d0080f8b2fa1c8e87615803e5fe
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/390097
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-12-07 16:23:19 -05:00
Daniel Verkamp
ea1c15791f log: rename SPDK_TRACE_* to SPDK_LOG_*
Disambiguate the log components from the trace functionality
(include/spdk/trace.h).

The internal spdk_trace_flag structure and related functions will be
renamed in a later commit - this is just a find and replace on
SPDK_TRACE_* and SPDK_LOG_REGISTER_TRACE_FLAG().

Change-Id: I617bd5a9fbe35ffb44ae6020b292658c094a0ad6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376421
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-07 12:23:19 -05:00
Daniel Verkamp
6cce3666ea rpc: prefer command-line address over config file
Change the command-line -r option to take precedence over the [Rpc]
section of the configuration file.

Change-Id: I6f043bafaa8b0ede10dd8a483ca77ad34ff7639a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390329
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-05 13:16:57 -05:00
Daniel Verkamp
c24c1cce4b rpc: only dump [Rpc] section if config is set
The config_text callback should only add a [Rpc] section if an
address is configured.

This avoids printing out a bogus configuration file
section with "Listen (null)".

Change-Id: Ibb734f6faab4c2587203623eee8a193f9a7207ba
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390328
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-05 13:16:57 -05:00
Ben Walker
44770c2a11 bdev: Remove poller abstraction
Use the new one from io_channel.h.

Change-Id: I7bf6729caf6eeebcb58450a36119601957ad5da4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388290
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-28 15:29:35 -05:00
Ben Walker
9c35e39c54 event: Move spdk_poller_register to io_channel
Make this generic and not directly dependent on
the event framework. That way our libraries can
register pollers without adding a dependency.

Change-Id: I7ad7a7ddc131596ca1791a7b0f43dabfda050f5f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387690
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-28 12:30:37 -05:00
Dariusz Stojaczyk
5bdbe36ee9 event/subsystem: fix subsystem init failure handling
Deinitialize only those subsystem that
have been fully initialized.

Change-Id: I86cdd4cda0a80c107956843ed8198072e898a743
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386892
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-20 19:28:44 -05:00
John Meneghini
70b1de2d03 env: add conditional compile to remove rlimit code
- for environments that don't support rlimits

Change-Id: I6dde1eb9e1cb2274462a450625d8bc70a3889163
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/386355
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-20 19:16:42 -05:00
Dariusz Stojaczyk
f91894490b event/subsystem: remove unused params from g_next_subsystem->fini
Change-Id: I61ee650848cefe592fda23af8e1ed9aa6efb8b88
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386890
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 13:10:52 -05:00
Ben Walker
00b02039c5 event: Pollers must now be unregistered from the thread they run on.
Change-Id: I8ea8c59a0c67176c0c0c39abf807afad61ff3828
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387689
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
fcb4776fe7 event: Pollers must now be registered from the thread they run on.
Change-Id: I864cd8a6c206dfbe62fcb3f72275c1ae51aa4ed7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387688
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Liang Yan
bb28be8adc event: ignore duplicated shutdown signals if signal received
Change-Id: Ib1e184f831eef82432308279c6d8ea43088748ef
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/387273
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-16 18:24:46 -05:00
Ben Walker
6447eb670a event: Allow spdk_subsystem_fini_next to be called from any core
Change-Id: Idc39c101c23cebe9538d59c0026d169c93c44e23
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/386715
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-14 15:08:56 -05:00
Ben Walker
a1133a9b67 event: Remove extra event from subsystem shutdown path
Change-Id: I1b4a64fc5efdb5abd8bdcd9e91a7e8fb06fbfe3a
Reviewed-on: https://review.gerrithub.io/386714
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-14 15:08:56 -05:00
Jim Harris
d97476efdf iscsi: shutdown iscsi library as part of subsystem fini path
With the new asynchronous subsystem finish framework, we can
drive shutdown of existing connections as part of the subsystem
finish path instead of a separate spdk_iscsi_shutdown function
called as the shutdown function in response to SIGINT.

This is a step towards enabling a single target app that
supports multiple protocols (i.e. iSCSI + vhost + NVMe-oF).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id9f596a8091912a72ab7eb93cb45a46fdb130a48

Reviewed-on: https://review.gerrithub.io/386695
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
6bef902ca5 rpc: add default UNIX domain socket listen address
RPC is a default feature required for almost all usages,
so enable RPC by default, but with a UNIX domain socket
for security reasons.

-r can now be used from the command line to specify
an alternative RPC listen address from the default
/var/tmp/spdk.sock.

Remove the Enable parameter from the Rpc config section
but still allow specifying an alternative listen address
using the Listen parameter as an alternative to the
command line option.  This keeps backward compatibility
for this release for anyone using the configuration file
still.

Remove the Rpc sections from all configuration files
that were using them, except for those that specified
alternate TCP ports for multi-process test cases.  We
can fix these later to use an alternate UNIX domain
socket and to use the command line instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife0d03fcab638c67b659f1eb85348ddc2b55c4c4
Reviewed-on: https://review.gerrithub.io/386561
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
fbb9430ec4 app: add spdk_app_parse_args()
This is a helper function that eliminates a lot of
duplicated code in our target applications, specifically
around common command line argument parsing and usage
messages.  This patch only moves the iscsi, nvmf and
vhost targets to use this function, but there are other
test/example applications that could also take advantage
of it to reduce duplicated code and improve consistency.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1903de3daed90ac6282b006a8283b9df07ce37e9

Reviewed-on: https://review.gerrithub.io/386542
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
973a27d08c app: add print_level to opts structure
This allows us to remove some duplicated code from our
main target applications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I15b517fd2b58ce682660b4f6ba0b8412beda053b

Reviewed-on: https://review.gerrithub.io/385714
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00
Jim Harris
4bcfef0021 rpc: remove rpc subsystem
RPC is core functionality for SPDK applications and should always
be initialized last (after all subsystems have been initialized).
So make RPC a first class citizen and integrate it with the
app framework directly instead of making it an "optional" subsystem.
Then we initializing it after all subsystems have completed
initialization, and tear it down before tearing down subsystems.

We can also do some other cleanup while here - for example, reactors
are already started when spdk_rpc_initialize() is called, so remove
the extra event that was added during initialization since this is no
longer needed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4cc63586a6d55be68786629a2176c61a88979267

Reviewed-on: https://review.gerrithub.io/385914
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00
GangCao
40dd3c29a4 event: create the ring on other available sockets
There may have the situation that associated socket does
not have enough memory for the event pool and the related
ring buffer. As the event pool will be created at any
available socket, this will be same for the ring.

The basic idea is to first allocate the memory for the
core associated socket and then try other available sockects
before terminating.

Change-Id: I52c240289899c136b607629c12c0250ad859c8ac
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/385972
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-10 13:03:31 -05:00
Tomasz Zawadzki
6c54c13cd4 event/subsystem/bdev: asynchronous SPDK finish
First this change moves spdk_subsystem_fini() to trigger on
spdk_app_stop(). This ensures that spdk_subsystem_fini() is called
before reactors are stopped in spdk_reactors_stop().

Finish paths for subsystems, bdevs and copy engine is now
asynchronous.
Each of those three mentioned have to make sure they are
asynchronous as well.

Only bdev that currently has requirement for asynchronous finish
are logical volume.
Thus the change in vbdev_lvol.c making it move to next bdev module
only after all lvol stores were unloaded.

Fio_plugin finish of bdev and copy_engine was removed for now.
Next patch in series adds it back with async support.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I80ee2d084f3d82c50bf1329e08996604ae61b1b3
Reviewed-on: https://review.gerrithub.io/381536
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:03:55 -04:00
Daniel Verkamp
8eef5183d3 bdev: remove spdk_bdev_poller_start() lcore option
Always start bdev pollers on the calling core.

This removes the lcore concept from the bdev poller abstraction and
simplifies the job of spdk_bdev_initialize() callers providing their own
poller and event implementations.

All callers except the NVMe bdev hotplug poller already used the current
core as the parameter.  The NVMe HotplugPollCore option was undocumented
and unused in any of the tests or example configuration files, so it
should be safe to remove.

Change-Id: I93b466e1e58901b8785c40cbe296fa46c157850f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382857
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-18 20:28:29 -04:00
Tomasz Zawadzki
7aba48fe1e subsystem: move allocation of subsystem_init event to subsystem
Previously two spdk_events were allocated in spdk_app_start().

Now app allocated spdk_event for function to be called after
initialization is complete. Meanwhile subsystem allocates
its own spdk_event.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4822f76d30cc2f7b95a86a4ffbfc61b80c0a903e
Reviewed-on: https://review.gerrithub.io/382673
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-16 15:14:36 -04:00
Tomasz Zawadzki
b1ccfaca01 subsystem: remove fini return code
Closing the framework has to go through all subsystems
without failure, so return codes are unnecessary.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I53c9b4df12d2357e641130869f398b18637e6ff7
Reviewed-on: https://review.gerrithub.io/381681
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-10 10:56:34 -04:00
Tomasz Zawadzki
48b2eff97d app: spdk_app_fini no longer gives return code
spdk_app_fini() changed to void, as no operation within it
can fail with meaningful return code.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If77cbf745a8e3fcba4ea24411aa1816f3910cde7
Reviewed-on: https://review.gerrithub.io/381537
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-10 10:56:34 -04:00
Dariusz Stojaczyk
dbad65c383 app: add NoPci field to config file
Allow disabling entire PCI access via config file.

Change-Id: Ib571529fdcdfe0e8f43e0d69b32efa633c364f8f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381203
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-09 12:28:50 -04:00
Tomasz Zawadzki
2317eedd0a subsystem/rpc: unregister RPC poller when finishing application
Poller registered at the end of spdk_rpc_subsystem_setup() was
never unregistered.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id24e88a76798ba3f739614e5e357877e0404f9e4
Reviewed-on: https://review.gerrithub.io/381534
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-06 13:28:21 -04:00
GangCao
108e3d9600 event: add an error check for spdk_allocate_thread()
Change-Id: Ib338bc536eaed82b93d106be1e5044d9dc3a04df
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/381192
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-05 16:48:02 -04:00
Daniel Verkamp
70c3e1f2eb reactor: add context_switch_monitor RPC
This allows the user to enable/disable getrusage() monitoring at
runtime.

Also change the log level to INFO and enable the monitoring in all
builds, not just #ifdef DEBUG.

Change-Id: I2f5c3bc8cd83dcb2a72dc7078bf2cb43aa28827c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376473
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-09-01 12:46:18 -04:00
Daniel Verkamp
932a186b4c log: remove uses of SPDK_TRACE_DEBUG
Replace SPDK_TRACE_DEBUG with component-specific flags.

Change-Id: Iee7eafab5e6ac8713f247323a18552b5afb0e86a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375834
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 15:07:13 -04:00
Daniel Verkamp
d92f0f75ca log: rename SPDK_TRACELOG to SPDK_DEBUGLOG
This matches the name to the behavior and prepares for addition of a new
log macro for "info" log level.

Change-Id: I94ccd49face4309d3368e399528776ab140748c4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375833
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 13:25:58 -04:00
Daniel Verkamp
47182bd7c9 io_channel: allow user to provide a thread name
This moves the thread name setting code into the generic SPDK thread
setup code, so now all spdk_threads can be named, not just ones created
by the event framework.

Change-Id: I6c824cf4bcf12fe64a8e2fc7cdc2d6c949021e40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 13:11:08 -04:00
Cunyin Chang
8d70322aa8 event: Add support for rusage monitor for the reactors.
This patch Log a message in the reactor if any context switches occur.

Change-Id: I5306a5d29bce57ee9383d3ffdc9a0f7916a5b813
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/374560
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-18 20:10:10 -04:00
Ben Walker
053d5733e6 env: Add a default value for mempool cache size
This is just a convenience and replaces the common practice
of passing -1.

Change-Id: Id96734307ebf52ef0ee7dba0e7ac89602b2b5b1a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374520
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 16:55:55 -04:00
GangCao
7b7f2aa685 app: move the core usage display after DPDK init
Change-Id: I29a46cbaef20e15173781680a62bc8087ca5672f
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/372426
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 20:39:07 -04:00
Ben Walker
30b512c201 event: Move signal handler setup to separate function
Just code movement, no changes.

Change-Id: Ie4eba079a6a9eae7632c784985cccb9bd18cd3a6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370757
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 18:04:55 -04:00
Ben Walker
c549377169 event: Remove duplicated code when installing signal handlers
Change-Id: I8cb413cd18b738438f1b1b3e00a438e1323e8b1f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/372170
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 18:04:55 -04:00
Ben Walker
62d3b6897a event: Use SIG_UNBLOCK instead of SIG_NEW for signals
Install signals by enabling new ones, not by disabling
all of them. This preserves default behavior.

Change-Id: I8d0e4753a5f321fc3756b41cd2312124fabeed29
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/372169
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 11:54:23 -04:00
Ben Walker
4bd306630b event: Always handle SIGINT and SIGTERM
Cleanly shutdown in response to these signals,
even if the user didn't provide a custom
signal handler.

Change-Id: I387bbbc0e4d848fd87ea489bae2cc79a2240d2da
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/372168
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 11:54:23 -04:00
Ben Walker
9d6ff68e38 event: Simplify spdk_reactors_fini
We don't actually need the socket mask.

Change-Id: Icec9e571e31f1955644b32c919e3f5a699338f0b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370722
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-01 13:43:24 -04:00
Daniel Verkamp
2bdec64fbf jsonrpc: modify API to pass request to handler
This will enable asynchronous request handling in a future patch, and it
also removes the need for the RPC handlers to know about request id and
the JSON-RPC rules about notification-only requests.

Change-Id: I25aaa8e48bff8d5594ffcccecb61842b1e31ec3c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368225
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-06 13:48:12 -04:00
Ben Walker
ad474e95bb log: Remove configurable log facility
Always use "Local7" internally. We want the log API
to be generic instead of syslog specific.

Change-Id: I021f719e90c236f123fa1cadebc0c199b87ba077
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 19:28:29 -04:00
Jim Harris
c588baab29 reactor: add pid to names for rings and mempools
This is required for using the event framework
in multi-process mode since they must be unique
across the group of processes..

Currently the stub app calls into the env layer
directly, bypassing the event framework, so this
issue would only be seen with multiple secondary
processes using the app framework.  Some future
changes will change the stub app to use the event
framework which necessitates this change immediately.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5e1acc95380a20a0204c327906c7ef83a82d7fac

Reviewed-on: https://review.gerrithub.io/366647
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-23 11:02:04 -04:00
Ben Walker
e3ff3e4e59 rpc: Remove event framework and config file
All interactions with the event framework and config file
are now in the event_rpc subsystems.

Change-Id: I3f4ddb79c7ec90ccb9a5eb7b25bc9953fe3e41c8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/366341
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-22 10:47:31 -04:00
Ben Walker
c224997be5 bdev: Remove direct calls to start/stop pollers
Abstract these through the bdev API to break this
dependency on the event framework.

Change-Id: I108505bf27e94b2985f53d0a4dc0b847ae264d25
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/366340
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-22 10:47:31 -04:00
Ben Walker
90779f58c7 bdev: Move event subsystem initialization to event_bdev
This breaks the dependency on the event subsystem logic.

Change-Id: Ic47a219bc1e272c3421b265f74bba959e1aa5f62
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365730
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 16:58:35 -04:00
Ben Walker
aacd61d54a vhost: Move subsystem initialization to event_vhost
This removes one dependency on the event framework.

Change-Id: Ib9c8160b1704a15b662a35d5ad1f32c0b745485c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365729
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-20 16:58:35 -04:00
Ben Walker
c9f8765a69 scsi: Move event subsystem initialization to event_scsi
This removes the event framework dependency from the
scsi library entirely.

Change-Id: I73546d06721487f86c4c6a3be24474a5677bdb41
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365728
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-20 16:58:35 -04:00
Ben Walker
2b22e2aa7a rpc: Move module initialization to event_rpc
This removes one of the dependencies on the event framework.

Change-Id: I0b0b4dc1afc4a9cdd0679f2667b72a848bb09035
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365727
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 13:46:37 -04:00
Ben Walker
e7485922b0 net: Move module initialization into event_net
This removes the event framework dependency from the net
library entirely.

Change-Id: I7bc1a6f146437fd3d2dab0289bbd845f0ff61ae8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365726
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 13:46:37 -04:00
Ben Walker
199e4862d2 iscsi: Move asynchronous subsystem init to event_iscsi
This removes a dependency on the event framework.

Change-Id: Iac8e21b76012a949115e6b793bed89cac14a236c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365725
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 13:46:37 -04:00
Ben Walker
4d8c07901f copy: Move asynchronous module init to event_copy
This removes the last use of the event framework from
the copy_engine library.

Change-Id: I9b8788430249766e0b3bbec591822e2c1bb77792
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365724
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-20 13:46:37 -04:00
Ben Walker
235a8e377e log: Rename, document the open and close calls
Name them spdk_log_open and spdk_log_close, and give them
API documentation.

Change-Id: I6c2bbdd6a32894c1e030ec70a97dc054cd7102a9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365292
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-16 16:15:06 -04:00
Ben Walker
dda26fba8b log: Change priority to generic log level
The log priority was very syslog specific. Instead, create
a generic set of log levels as an enum.

The log level/priority isn't actually used anywhere today.

Change-Id: Iebcf6b7e1b263b56f317b86b5f2ea0d9e45170f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365267
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-16 16:15:06 -04:00
Ziye Yang
d939572ab3 event/env: remove dpdk_ prefix
Remove dpdk_ prefix in spdk_app_opts and spdk_env_opts

Change-Id: I6f231f67072b808e84945d41b1fe31a180beb350
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365787
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-16 14:20:26 -04:00
Ben Walker
8fbaa73e69 vhost: Add a separate subsystem library
This separates the vhost library from the event
framework's subsystem mechanism

Change-Id: I8206fcf0d55bee71c70482d989318e9d118f710a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365286
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
53a587de7b iscsi: Add a separate subsystem library
This separates the iscsi library from the event
framework's subsystem mechanism.

Change-Id: I880ee4749ab0a411ca8dfd04f669868cba5c8b49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365285
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
5015ec9ce8 scsi: Add a separate subsystem library
This separates the scsi library from the event framework's
subsystem mechanism.

Change-Id: Iac2bbdb861e28ee9af0f13bc7187ac24279d0f5b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365284
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
674de77551 rpc: Add a separate subsystem library
This separates the RPC library from the event framework.

Change-Id: I26a9cb318b56d44ec9337f8a4db98967eb87ad95
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365283
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
5cf5dbff24 net: Add a separate subsystem library
This breaks the strict dependency on the
SPDK event framework.

Change-Id: Id93d79bfbc482350dc9802fa84a554f7e11f3826
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365282
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
4808ff7957 copy: Create a separate copy subsystem library
This removes the strict dependency on the SPDK
event framework.

Change-Id: Ie6b6f9585d09ab1df0f25bf33d53e7cdecd83faa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365281
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ben Walker
4c0eaac47a bdev: Create a separate bdev subsystem library
Much like bdev modules inside the bdev directory,
add a subsystems directory inside of event. The subsystem
specific code for the bdev library is placed in to
a separate library in that directory, breaking the
strict dependency of the bdev library on the event subsystem
code.

Change-Id: I255941b823a9ec3e2d62f22a586414949d8ff5ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365055
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 13:10:26 -04:00
Ziye Yang
356e2ab20f event: remove spdk_app_init
In this patch, spdk_app_init will be merged into
spdk_app_start.
Due to this change, we need to change event_perf
to use spdk_app_start, since we cannot use spdk_app_init
anymore. So the related changes for event_perf is to
make it work with reactor framework.

Change-Id: Id67edf209fd628cca361a499068c93aeedfe6167
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/364153
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 18:26:52 -04:00
Ziye Yang
fb6c541d37 app, opts: add a new dpdk configuration: no-pci
In this patch, we also update perf and identify
examples. If there is no local nvme device info
parsing, we will set dpdk initialization with no-pci
choice.

Change-Id: I58b2d291b7b53894aeb194a16798ff1c72cf25b4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365361
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 14:09:31 -04:00
Ben Walker
9b8ddd2256 event: Remove usage of rte_launch
Change-Id: I38dc084783859851f70a3b0c78e3546c5dff1872
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/363609
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-06-07 13:50:53 -04:00
Ben Walker
d7134439f6 event: Remove use of rte_lcore
Change-Id: Ia20284118077e49f2988f30469c3e3f4100ebdf0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/363607
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-05 18:43:43 -04:00
Daniel Verkamp
a0cb1377f6 Update existing fallthrough comments for GCC 7
The stricter warning levels (-Wimplicit-fallthrough=4) require all-caps
FALLTHROUGH, so update the existing comments to match.

Change-Id: I5f8608101cad31d8ea8e84d48604397f98400e87
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363491
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-02 19:48:49 -04:00
Ziye Yang
2b2ab24477 reactor: handle start_fn event after subsystem init is ready
SPDK subysystem initialization now is async,
so we need to guarantee the initialization is done,
then call event composed of start_fn passed by user
in spdk_app_start.

Change-Id: Icc790cbb3da04c1063204938b79140c4218986e4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362654
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-05-31 15:30:58 -04:00
Ziye Yang
6e0d1dcdfa subsystem: make subsystem init in async manner
The next patch will make bdev modules init
in the async manner.

Change-Id: I4909c80510d786daf54003b99a5925428cf37373
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362110
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-31 15:30:58 -04:00
Ben Walker
2ef5722f3c io_channel: Add a message passing callback
When a thread is registered, the user must provide
a function pointer that can pass a message to that thread.

Change-Id: I743b5e0d6e3b5118c0a68d2fcedbccdd6fb237f9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362067
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-05-26 13:42:19 -04:00
Pawel Wodkowski
5fafd5c277 env: remove element size from spdk_ring_create
It is unused an misleading.

Change-Id: Idb2e3c1b244dfb4aa99bcecee8a3dba6efbc33aa
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/362335
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 13:52:49 -04:00
Ben Walker
42491fb8fc env: Add wrappers for a lockless ring
Change-Id: I9679e4bcfc10e38672d1851f7e9f16b6adf7de9b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 14:02:15 -07:00
Ed Rodriguez
2d2fde0d7f log: Use SPDK_ERRLOG in lieu of fprintf(stderr
Change-Id: Ic87d62516324b9c388a932b268714255b15a9a57
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 11:28:28 -07:00
Ben Walker
b961d9cc12 include: Move the remainder of the code base to stdinc.h
Change-Id: I6a142feeaad3117bd3c75e7c5cb7231a1cfa78ae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:20:36 -07:00
Daniel Verkamp
5639b965ac scripts/check_format.sh: catch misaligned comments
Fix up the existing comment blocks misaligned in the first column.

Also add line numbers to the comment checks.

Change-Id: I9d28c365271df36e7013d74cbb02d0023ab4f581
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-26 06:39:58 -07:00
Jim Harris
95487138e3 event: add spdk_trace instructions if event group mask specified
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I022bdccf502c6e63e6e8f5a80c5b5ec493262db9
2017-04-24 13:57:06 -07:00
Piotr Pelplinski
c2c995c5b0 vhost: make SPDK compile with dpdk-17.05 with vhost patches
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Change-Id: Iff659bb3df9df92c4b6aa9aeaef7244bdf5b3211
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-19 20:46:36 +02:00
Ben Walker
7f7c03a935 env: Remove all use of RTE_LCORE_FOREACH
Replace with an env abstraction.

Change-Id: I706374d265a270890e1f3ca920a10a0dc09624b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:37 -07:00
Ben Walker
c80454a283 event: Eliminate reactor mask
The DPDK mask and the reactor mask are always the same.

Change-Id: I83d3ab87cdfb405574f6472cfc222d3f311abdb1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:29 -07:00
Ben Walker
16ae587966 env: Move lcore functions into env layer.
They were previously in the event library.

Change-Id: I24ffd8f771e895ccf5395c8120423cd114893139
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-04 09:19:01 -07:00
Daniel Verkamp
2b0b705fb1 reactor: make sure socket_count isn't zero
Avoid division by zero in the event mempool cache size calculation.

Change-Id: Ic117ef2dc3a798fb0a57572f1178233e83e73849
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-24 10:52:28 -07:00
Cunyin Chang
b6671531ad event: Verify log_facility is not NULL before using it.
Change-Id: Ia20d8764c2c91c200d06b7017ed06060e40cc2ed
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-24 12:33:00 +08:00
Ziye Yang
0c0582d3ce event: Verify lcore is valid when registering poller
If we do not do a bounds check, this can run off the end
of an array.

Change-Id: I43cc4848fca7d68218e507db20e33823f8b550e4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-23 13:30:04 -07:00
Daniel Verkamp
60fc74584a event/app: use PID for trace ID if shm_id is unset
Change-Id: If79a09e109a3885e1282f3e834b531c250e59512
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-09 15:33:17 -07:00
Daniel Verkamp
427e90fea3 event/app: don't set default shm_id to PID
The env layer already understands that shm_id < 0 means that
multi-process is not enabled.  Leave shm_id defaulted to -1 so that
other code can detect when it is not set.

Change-Id: Ifd1667598d55c216f95f13561dc2a550677db5f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-08 16:35:34 -07:00
Daniel Verkamp
b58a5d73ef util: add SPDK_COUNTOF() array size macro
SPDK_COUNTOF works like sizeof, except it returns the number of elements
in an array instead of the number of bytes.

Change-Id: I38ff4dd3485ed9b630cc5660ff84851d0031911f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-07 12:43:42 -07:00
Tsuyoshi Uchida
4163626c5c event: free rings and mempool (#113) 2017-02-24 16:30:36 -07:00
Daniel Verkamp
34f052d298 event/app: remove pidfile feature
The responsibility for writing the pid file should lie with the init
system, not the application itself.

This was also broken by the recent instance ID/shared memory ID rework;
the pid file was named based on the pid, making it fairly worthless.

Change-Id: Ifb4f2d3ce5cf132f2c2e8bd3d0ba605ff8ccd8fe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-17 11:00:12 -07:00
Daniel Verkamp
6ef4af240d event: remove MultiprocessGroupID config option
This was added by mistake in commit 18d26e42a3 ("env: Move DPDK
intialization into the env library."). It is always dead code, because
shm_id is set to getpid() right above it, and it will never be -1.

Change-Id: I19c798a87bf7a3b12547d772b981b038857abcaa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-17 11:00:12 -07:00
Ben Walker
18d26e42a3 env: Move DPDK intialization into the env library.
Change-Id: Ie3a324f1523ffa0ddb0bd6a24a9a3cd0acbf64b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
Ben Walker
25270f1d7c Rename instance_id to shm_id and make it default to pid
By default, all SPDK applications will not share memory.
To share memory, start the applications with the same
shared memory id.

Change-Id: Ib6180369ef0ed12d05983a21d7943e467402b21a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
Daniel Verkamp
aac10bf92c event: call MP/SC ring functions explicitly
Avoid a runtime check for the rte_ring type - we know that the event
ring is multi-producer/single-consumer at compile time.

Change-Id: I5d42aee9c635db86e545b661361a68818d80961d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 15:01:08 -07:00
Daniel Verkamp
c6952d45df event: replace outdated reactor run loop comment
The work item queueing code was replaced with the current reactor/event
model, but the block comment above _spdk_reactor_run() wasn't updated to
match.  Replace the pseudo-code with something resembling the current
behavior, and delete the outdated paragraph below it.

Change-Id: If0686c6a5d063f56d8ea3df9bf3a1e98eef40207
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 13:06:21 -07:00
Daniel Verkamp
b809cdd3ab env: add spdk_mempool_create() socket_id parameter
Change-Id: I8ab0bb2c6e1fdf1681fbd049a096c1768e54dc27
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 13:05:30 -07:00
Ben Walker
e464823a62 event: Don't check timers on every iteration
Instead, check them every 5 iterations by default.

Change-Id: I9c42922868f8e965a0c801109e59e06aff5adf62
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-25 16:31:31 -07:00
Daniel Verkamp
5135af43fc event: get event_mempool via reactor pointer
Change-Id: I51fad50de0d64382f84ab5824732010eb192cbba
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 11:13:14 -07:00
Daniel Verkamp
8d950879b4 event: pass lcore to set_reactor_thread_name()
Simplify and remove a direct call to a DPDK function.

Change-Id: I08eaf86a48df67e3248eeaa764ae924b784d9277
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 11:13:14 -07:00
Daniel Verkamp
93d635990a event: simplify _spdk_event_queue_run_batch()
Store each reactor's per-socket event mempool in the spdk_reactor
structure to avoid calling rte_lcore_to_socket_id() on every iteration,
and make the function definition an internal, inlineable version
that takes the reactor pointer directly.

Change-Id: I841f7d7594308d7c572f5b7f609913c428bd13d7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 11:13:11 -07:00
Ben Walker
885a86a569 event: Modify reactor to avoid calling spdk_get_ticks()
Minimize the number of times spdk_get_ticks() is called
because it is expensive.

Change-Id: I2f34ca724ec28f42866b76d224dacbe1f31e7a41
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-25 11:10:09 -07:00
GangCao
929fb087e3 free allocated spdk_conf in case of failure
Change-Id: I1c7b1ea12e535da83fc47f449ccb6fb02a231047
Signed-off-by: GangCao <gang.cao@intel.com>
2017-01-19 15:01:13 -07:00
Tsuyoshi Uchida
950b48de61 log: use facilitynames to set/get log facility (#81)
* log: use facilitynames to set/get log facility

Define our own facilitynames[] instead of defining SYSLOG_NAMES
2017-01-17 11:20:34 -07:00
Daniel Verkamp
4a95a81e69 event/reactor: update last_action for timer pollers
Include timer-based pollers in the active/idle check that uses
last_action to determine when a reactor last executed an action.

Change-Id: Ib8f1253675b57aeb59206d099c6257f6d07f5acf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-12 14:04:01 -07:00
Daniel Verkamp
d2c0feac8a event/reactor: increase spin time from 1us to 1ms
One microsecond is not really long enough to detect an idle condition
where calling the OS usleep() makes sense.  Increase the minimum time
spent spin-waiting on events and pollers from one microsecond to one
millisecond.

Change-Id: I678118e357330f133251f4cfada8ff27e10158a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-12 14:01:26 -07:00
Daniel Verkamp
c000c930b2 event: align spdk_reactor to cache line boundary
The reactor structures are allocated in a contiguous array, and each
reactor is accessed from a different core, so align the reactor
structure to avoid false sharing.

Change-Id: I95162620ccb58fae060b2d95e47a38621dfbd140
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-06 09:50:35 -07:00
Daniel Verkamp
98568f1dab event: make g_spdk_event_mempool static
It is private to lib/event/reactor.c and does not need to be exposed in
the global namespace.

Change-Id: Idfff0365a0afdd90a0567825d520adf61d99fd2b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-06 09:50:35 -07:00
Daniel Verkamp
7ac9a4ecbb event: remove spdk_event_allocate() next parameter
The 'next' event pointer was never used in the entire code base (always
NULL).

Change-Id: I75f999d3a2e10512d86edec1a5a46ef263e2635b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
c3ede774c7 event: remove spdk_event_t typedef
Use 'struct spdk_event *' directly for consistency with the rest of the
API.

Change-Id: Ib41a9bf47f5b18f4aebf5f4dee055455cb12ef7d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
44ef085bed event: pass arg1 and arg2 directly to event fn
This allows the elimination of the spdk_event_get_arg1() and
spdk_event_get_arg2() macros, which accessed the event structure
directly; this was preventing the event structure definition from being
moved out of the public API header.

Change-Id: I74eced799ad7df61ff0b1390c63fb533e3fae8eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
3d528833d5 event: move default opt values out of public API
The public API user is supposed to retrieve the defaults via the
spdk_app_opts_init() function.

Change-Id: Ie2bd6e809b2d47dbd5d62d396e8715f89f4052d9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
2931a3efef event: remove 'complete' parameter from poller_register
The spdk_poller_register() function provides a way to pass an event to
call once the poller is registered, but it is always NULL in the current
code base.

Change-Id: I459bf40ae4d050589577d113b7984f1563aaa9cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
7b01af8fd2 event.h: split non-public API into spdk_internal
Change-Id: Ie783df6cf387286ab882107fb9d4ce12358602e2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
f99eb85595 event: remove spdk_event_get_next() from API
The event->next field can be accessed directly from within the event
library implementation, and public API users should not be using it.

Change-Id: I98a1f0017e03e951d0c4eee3c7989b04324e57d1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Liang Yan
fb8cbe8c5d lib/event: change reactor thread name
Change the reactor name, replacing space with underline.
Since Linux system didn't recommend file name with space.
And when reactor crashed, the core dump file name has space in it.

Change-Id: Iba36ba7903c95db09a9decbc023a01e5e6ab18b4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2017-01-05 08:35:25 -07:00
John Kariuki
ec71fa1aa5 reactor: fix lcore type and add socket in NUMA notice
Change-Id: Ib0afc9415338c6c7aa11f55513c552c484b61cbd
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
2016-11-29 12:50:19 -07:00
Daniel Verkamp
d27b24c94b log: split internal TRACELOG macro into new header
The SPDK_TRACELOG macro depends on a CONFIG setting (DEBUG), so it
should not be part of the public API.

Create a new include/spdk_internal directory for headers that should
only be used within SPDK, not exported for public use.

Change-Id: I39b90ce57da3270e735ba32210c4b3a3468c460b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-16 13:33:51 -07:00
Daniel Verkamp
04c48172b9 conf: add accessors for section name and num
Remove usage of the conf structs so they can be moved out of the public
API header.

Change-Id: I1c7375ec7708b323f50af09aeb7b2b2c9c770df4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-16 10:33:12 -07:00
Jim Harris
3266d7dbcc app: add spdk_app_start_shutdown()
This enables using SPDK within a larger process that
is SPDK-centric.  In this case the process may start
SPDK and then wish to stop it explicitly (without a
signal).

While here, remove an incorrect comment - DPDK mempools
can be used from non-DPDK threads.  Also set the
g_shutdown_event to NULL after it is called.  After the
event executes, the event is freed and is no longer valid.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie4f07bee7d05fae683c72f6680cb3bcce2d4a119
2016-11-07 09:59:59 -07:00
Daniel Verkamp
52bbb267d8 event: process events in batches
Since we are usually going to be removing multiple events from the queue
at once, use the DPDK burst dequeue interface to improve efficiency.

Also rework the event queue runner to always process a fixed maximum
number of events per timeslice for simplicity.  This removes the
rte_ring_count() call from the hot path and improves fairness between
events and pollers.

Now that events are dequeued in bulk, we can also put the event objects
back into the mempool in bulk.  Add an env wrapper around
rte_mempool_put_bulk() and use it to free all of the events at once.

Basic performance benchmark using test/lib/event/event/event -t 10
is improved: previously ~40 million events per second, now ~46 million
events per second.

Change-Id: I432e8a48774a087eec2be3a64c38c339608af42a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-07 09:32:25 -07:00
liupan1111
11381f3b3c iscsi: fix comment issue. If not specified reactor mask , we only use core 0. (#48) 2016-10-20 09:37:05 -07:00
Ben Walker
7f5b671db7 env: Convert some rte_mempools to spdk_mempools
This converts some, but not all, usage of rte_mempool
to spdk_mempool. The remaining rte_mempools use features
we elected not to expose through spdk_mempool such as
constructors, so that will need to be revisited.

Change-Id: I6528809a864ab466b8d19431789bf0f976b648b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Jim Harris
d4d82fc3ab event: directly add poller when adding to current core
This is required since pollers are now directly removed
(rather than scheduling an event) when the unregister call
is made on the poller's lcore.

Without this change, if a poller is registered then
immediately unregistered, the unregistration will seg
fault since the event adding the poller has not executed
yet.

Also add a test case that exhibits the sequence of events
described in this commit message.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5c6ba0ee224ac1f8f3ebb8e7571714e718bd42db
2016-10-11 15:35:36 -07:00