Commit Graph

1317 Commits

Author SHA1 Message Date
Ziye Yang
08e6f94226 blobfs: separate cache tree related definitions into tree.h
The code will locks clear to put those definitions into tree.h header

Change-Id: Ib1a34f19d9849acd7ea979eb0a6e153b0e8e39de
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-04 09:11:28 -07:00
Daniel Verkamp
2990f869a1 scsi: make spdk_scsi_port definition private
Change-Id: Ib2c17a4dd4ce680161be92f76b831df792f9ff4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:05:53 -07:00
Changpeng Liu
2eb9a35323 env/dpdk: remove rte_eal_device_remove API call since DPDK 17.05
Since DPDK 17.05 API rte_eal_device_insert is only used for
virtual device scan and initialization, for PCI devices
which use Domain:Bus:Dev:Function, this API is no longer
valid.

Change-Id: I1ab63dfc3af188d01836e67cd8db745e035fc450
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-05 09:40:31 +08:00
Ben Walker
3d62b39b0d bdev: The bdev layer now generically creates io_channels
These channels can handle generic bdev context.

Change-Id: I61f41884ddf4cf86fa156e9051421b354bbb349d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-03 15:16:02 -07:00
Jim Harris
5343c22f8d iscsi: do not free io channel refs if login failed
When destroying a connection, we need to check if we got to
full feature phase before freeing any io channels.  This is because
the io channels are only allocated as part of a successful login.

The Calsoft iSCSI test suite has tests which will fail login.
Since the test system was just using a malloc backend with memcpy,
so even though a channel was NULL in some cases, it was never used
since the memcpy engine doesn't need it.

This prepares for some future patches which extend the use
of io channels in the bdev layer.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2fb7b18a781caa0aadca319aa1e61a6ccf2c55fd
2017-05-03 14:44:39 -07:00
Daniel Verkamp
a3738d9031 scsi: make spdk_scsi_dev definition private
Change-Id: I62b36a22e11e845045f190886ae00aa644f96ec6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-03 12:34:57 -07:00
Daniel Verkamp
46af047ae7 json/util: simplify if (p) free(p) -> free(p)
Change-Id: I874b9893afcf2bdf333b14557feedcacad47d355
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-03 10:57:51 -07:00
Changpeng Liu
e9bfc11043 env/dpdk: additional library required for DPDK 17.05 ring based mempool
Change-Id: I2ef4a330a5628c84657f516cb2e4fad609b6c6d8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-02 15:18:15 -07:00
Daniel Verkamp
fa81bdb3fe iscsi: drop redundant parentheses in rsph casts
This allows astyle to format the cast of address-of operations
correctly.

Change-Id: I9c8a4545c44601e769acc712ec7acf3a96f45ebb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 15:15:39 -07:00
Daniel Verkamp
cce22074a7 iscsi: fix ISID interpretation in login requests
The ISID field is a 6-byte field in network (big-endian) byte order.

The previous code was casting the uint8_t isid[6] value into uint64_t,
which was actually casting the address of the first byte of isid (not
the contents of the array), and it was also not correctly converting
byte order.

Change-Id: Idd114e06d30040cf28931d7da7ffdc8d6c45e82a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 15:15:39 -07:00
Liang Yan
b0091cfe5c bdev/nvme: Increase maximum controllers to 1024
Change-Id: I5a7a5f40b0d3c8c21e26f5358bc84f538a62bff4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2017-05-02 13:51:39 -07:00
Daniel Verkamp
6b4da26449 bdev/nvme: dynamically allocate probe_ctx
Avoid allocating a large amount of stack space when increasing
NVME_MAX_CONTROLLERS.

Change-Id: I7017e5ed9f4d4f5c860dac608c3e5ae3c35864e7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 13:51:39 -07:00
Daniel Verkamp
d0290b6525 scsi_internal.h: remove duplicated min/max macros
Use the ones from spdk/util.h instead.

Change-Id: Icd8416d1b3cb0cde35ac46ea8b1ba7a1ea8994c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 09:41:43 -07:00
Daniel Verkamp
12965bb6ce scsi: make spdk_scsi_lun definition private
The contents of struct spdk_scsi_lun don't need to be part of the public
API.

Change-Id: I101b77871054557380610fd901ab38bada463202
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 09:41:43 -07:00
Jim Harris
13f8cf1536 nvme: add NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC
The VirtualBox emulated NVMe device will intermittently
hang on the first read/write command after an I/O
qpair has been allocated.  The frequency of the hang
diminishes if a delay is added after allocating the I/O
qpair - until it disappears completely with a 100us delay.
So add a quirk to insert this delay.

Note - the 100us delay was tested by running
the hello_world example app 50000 times.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I237e31b1b8a1a1e28262851ae0a21cd7345f0f1a
2017-05-01 10:22:18 -07:00
Changpeng Liu
80e4f5ae8b env/dpdk: make SPDK can compile with DPDK 17.05
Change-Id: Id69a162b6f2abfdcd4d41b368cfcde52665eb904
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-04-28 09:22:09 -07:00
Pawel Wodkowski
1bc2c5ab57 rpc: add bool-type decoder
Allow passing booleans in JSON.

Change-Id: I0b8f6c1579d8382b5b19a987ef5d913b4423c954
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-26 21:52:11 -07:00
Daniel Verkamp
50cc397d6f nvme: simplify nvme_ctrlr_destruct qpair loop
Fixes a scan-build warning about using qpairs after they have been
freed.

Change-Id: I263eabd6b784acf540c66136965f7705ef110a78
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-26 06:40:17 -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
Tomasz Zawadzki
9879b50769 scsi: fix page control page field in MODE SENSE
This patch assigns correct value to page control.
Now that page control value is correctly taken from CDB,
error via sense data is reported when processing "saved values".
"Changeable values" are not supported, so all parameters
are reported as not changeable when requested.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I41378c96b1e8c716b5d0ce4b72777065fb122228
2017-04-24 15:26:39 -07:00
Cunyin Chang
bee8c04a4b nvmf: Move the check of NVMe remove from session layer to subsystem layer.
Change-Id: Icf2f7122c9af0cd6420384c93813d2e79ed9c69e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-04-24 13:57:25 -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
Daniel Verkamp
6b91943209 scripts/check_format.sh: check spaces in comments
Fix up all existing spacing errors in comments and add an automated
check for patterns like /*comment*/.

Change-Id: I28f61c93612dc0f8aed66bd509da78e91ea9737e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-24 13:37:41 -07:00
Pawel Wodkowski
9aaccfe3d7 vhost: enable VFIO
Vhost needs to register memory given by guest in VFIO container to be
able to do any DMA using this memory.

Currently DPDK doesn't provide any interface to handle guest memory, so
for now lets find container fd in /proc/self/fd/ directory and provide
some VFIO internal API that finally should extend DPDK API.

Change-Id: Iee9d496367ccd61219068fc0eadc17e786ff0731
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-24 12:20:04 -07:00
Ziye Yang
e15bd00711 nvme: support new format in spdk_pci_addr_parse
The new format is: domain.bus.device.function

For this format, since we use '.' as separator,
to avoid misusing, we only support the following:

1 domain.bus.device.function ( 4 values provided)
2 bus.device.function  (3 values provoided with domain = 0)
3 bus.device  (2 values provided with domain = 0, function = 0)

Change-Id: Ide03db38b4ac7802cf36f0e536e8b997101d6cd3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
Ziye Yang
e02d0bbd5f nvme: add the '=' separator support in spdk_nvme_transport_id_parse
Thus, we can support both ':' and '='.

Change-Id: I4400ba770912a2b20e49432c2e6e2a1bd45c28ed
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
Dariusz Stojaczyk
154323ab51 scsi: Include null terminator in Unit Serial Number VPD Page
According to the scsi standard, all ASCII data fields "may be
terminated with one or more ASCII null (00h) characters"
[7.6.10, 4.4.1]. Windows SCSI Compliance tests expect a null terminator
there, so let's include it.

Change-Id: I18fa35295233a163cea711a5c4ff8e3d3e80c4f1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-04-21 08:12:04 -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
Jim Harris
b5b9410da3 nvme: remove DELAY_BEFORE_ENABLE quirk and always wait 100us
A 100us is so small that applying the quirk to the specific
SSDs that require the delay is more trouble than it is worth.
So remove the quirk and always wait 100us before re-enabling
the NVMe SSD during initialization.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6a8cc6e35d103fffdf135580301fc3e5b27e722
2017-04-17 11:56:36 -07:00
Jim Harris
fd5d6901f2 nvme: use spdk_likely/unlikely macros in I/O path
Also avoid an spdk_get_ticks() call in the default
case where a timeout_cb_fn is not defined.

On my Intel(R) Xeon(R) E5-2699 v3 system with an
Intel(R) P3700 SSD, these modifications reduce software
overhead per I/O by 3-5% (as measured by the SPDK
overhead tool).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5bb5a87747b15d9e27655fabcd2bc1a40b0b990e
2017-04-17 11:56:36 -07:00
Daniel Verkamp
5742e9b9e7 nvme: allocate requests on a per-queue basis
Change-Id: I7bec816e518a0a6f2e9fb719128c83d4b908d46c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-12 21:05:24 -07:00
Daniel Verkamp
cd13f280f4 nvme: track qpair within nvme_request
Change-Id: Ia40a1e79db6327c4693731e9bb7a57810795429d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-12 21:05:23 -07:00
Ben Walker
15f910ece7 bdev/nvme: Improve names of fields in config file
Remove the "Nvme" from several field names. The parser
will still accept the old name for backward compatibility.

Change-Id: I6fa86ec359b23fb63960d0aa479a845b36a0977a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
acd0b4573d bdev/nvme: Allow the user to control the I/O timeout behavior
The user can now not only specify an optional timeout for
commands, but also the action to take when a timeout is
detected.

Change-Id: I7d7cdd846d580e0b3a5f733d398ee9b19d6fe034
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
193f4f8392 nvme: Queue aborts beyond the abort command limit
Queue aborts that would exceed the abort command limit
in software as a convenience for the user.

Change-Id: I8c1f0380984cc6c0cdb453db961939a7f571b336
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
ee460db71f nvme: Don't pass admin qpair through timeout callback
Instead, pass NULL when an ADMIN command times out.
We don't expose the admin queue to the user.

Change-Id: If0768d329a689f6f7c3734c9d419e680d7378ed1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
b9feeb03c1 nvme: Call the timeout callback only a single time
For each command that times out, call the timeout
callback one time if the user registered one.

Change-Id: Iaad39a886468e89bef63fe292c5cad1dce97a57c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
c97ea5ad8d bdev: Modules no longer register bdevs as io_devices
Instead, they register some internal structure of
their choosing.

Change-Id: Id1f8c563d0a2c6f1066d741f86b8aa6fe09b6319
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-07 11:19:36 -07:00
Ben Walker
9d73eed8a6 bdev: Consistently pass user context to fn_table calls
Some calls were passing bdev->ctxt, some calls just
bdev. In most of our implementations those are the
same pointer, but they aren't necessarily.

Change-Id: If2d19f9eef059aded10a917ffb270c1dc4a8dc41
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-07 08:14:34 -07: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
Dariusz Stojaczyk
86840974dc iscsi: dont create portal group from partially invalid portal list
Changed spdk_iscsi_portal_grp_create_from_portal_list so that it fails
if any given portal is invalid.

Change-Id: I708621a538a52abfed4dce01668d26602a5ada59
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-04-03 13:28:42 -07:00
Ben Walker
cf90e4de16 bdev/nvme: Simplify logic in remove_cb
This was doing an extra loop iteration.

Change-Id: Iaf1a1e4d5faaa3100d3c0fca6c7c3a8d1cd77101
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 13:26:07 -07:00
Ben Walker
36a793ad63 nvme: Add a quirk to delay before enabling
It has been discovered that some devices require
a very small delay before writing CC.EN to 1 after
CSTS.RDY goes to 0.

Change-Id: I73d31726d17ebf5bbec7ee528e2f98fcd05234dd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
652d48d5f5 nvme: Fix up long lines in nvme_quirks.c
This isn't the indentation pattern I would have chosen, but
it's a complicated negotiation between what I want and what
astyle will let me get away with.

Change-Id: I4909587823931842ac3f227134e1d05e7d80da74
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
f190418231 nvme: Simplify latency page quirk
Any Intel device reporting device ID 0x0953 needs this quirk.

Change-Id: I690b01ecf05105df00ec8cf6f2da7f7c0a601aa8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
2efe9aa7bf nvme: Add all known DIDs for striping quirk
Update the list to include all new DIDs.

Change-Id: Ib00da939587010d44c097da07ec0625890e4c8cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Daniel Verkamp
7f957f56c1 bdev/nvme: add HotplugEnable option
Change-Id: I53fb7c3b469d5d5bb5b86c095bf1efc914299ec7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00
Daniel Verkamp
edbca2a676 conf: add Boolean value helper function
Change-Id: Ie86745fe397167416aee356dc773a1bf8387b492
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00