These strings are not modified by the functions they are passed to, so
they can be const char *.
Change-Id: I11532f232990a305d706c14aac1b0f8f93b8f576
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The PCIe transport initializes the quirks directly, so the generic hook
to get PCI ID is no longer necessary. This path was dead code.
Change-Id: I25bdaa598db53e4312a264d9d8356d1b416696e5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The logic to fail queue pairs when the controller is failed should be
handled in the generic code, not in the individual transports.
This also allows nvme_qpair_fail() to be private to nvme_qpair.c.
Change-Id: I6194576dceb35073b9af8847e59314900028637c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The main autotest.sh script automatically runs process_core as needed.
Individual test scripts should not be calling it.
Change-Id: I19d8799cd39f37f4768d8d89d3ece6aa993a6c95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The autotest.sh script is already running as root, so we should not need
to change the permissions on /dev/nvme-fabrics. This block has just
been cargo-culted across the various NVMe-oF test scripts.
Change-Id: I078ebf102d3fc354e42be9c6f1fc37481ffae291
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This virtual block device takes an underlying block device and splits it
into several smaller equal-sized block devices.
Change-Id: I6f6e686c1177b2e4885f7e88809ad329caae55bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
These were only intended for testing and should be replaced by a virtual
blockdev that can be layered on top of any kind of bdev.
Change-Id: I3ba2cc94630a6c6748d96e3401fee05aaabe20e0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This make sure the qpair failure could be started from upper level application.
Change-Id: I7e04fe36929cc634ddf0078db96fbc40afb38f8c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Now that unittest.sh is run as part of the automated tests, drop the
various unit test calls scattered throughout the tree.
Change-Id: Iea98314bb7f04620d72d81d25e24f8e706b50ce1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Change-Id: I57c7ed3475b19ffb8d00354eabb23ba86294164b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
While here, make it clear this is a benchmark that
tests internal APIs.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie5a57fdcee12b47568542721095c49d28ece5529
64k sessions over the lifetime of a single target is something
that really could happen, so handle this case.
Change-Id: Iaed92b9ff6cd078fcd7c1efe88cf0c860c77c4ac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Defining g_spdk_iscsi in test/lib/iscsi/common.c leads to duplicate
definitions in the pdu unit test.
Change-Id: I280d11a64a923fea2f2c0cb1dd391449b9a471fb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This test already links nvme.c via OTHER_FILES, which provides the
g_spdk_nvme_driver definition.
Also make g_request static while we're here, since it is only used
within this test file.
Change-Id: I9f1a2a7b3d40d2ea0989f6f781a4d220afbd3f0e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is preferable to rooting around the bdev_io structure
directly - which will no longer work if we want to support
modifying bdev_io structures in place for simple
bdev transformations like partitions.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0c5007030d8a8b84649397c5ec55351497604fc0
Currently we use the pci functions provided by DPDK,
it identifies the device by class id related
info but not by pci bdf info, so we can add the filering
by pci_addr in pcie_nvme_enum_cb function.
Change-Id: I5942e98853f00fc10fa6aae5c113517653d1b357
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Since nvme_ns_cmd.c now walks the SGL, some of the test code
needs to also be updated to initialize and return correct values
such as ctrlr->flags and sge_length.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I521213695def35d0897aabf57a0638a6c347632e
Convert the number parsing function into a linear sequence with a goto
label for each state, rather than a single loop with a state variable.
This makes the code easier to read and also improves speed (better
branch prediction and smaller inner loops for the common case).
On my test system, jsoncat citylots.json > /dev/null improves from
~1.7s to ~1.2s.
This changes behavior of some number parsing test cases: inputs matching
the number grammar as defined by JSON will be returned even if there is
trailing garbage, consistent with the rest of the parser. For example,
the input 01 will be parsed as a valid number 0 followed by trailing 1.
This only makes any difference when the full input is a single
number value, since if the value was nested in an object or array, the
trailing garbage will not match the expected syntax and the whole parse
will fail with SPDK_JSON_PARSE_INVALID (e.g. [00 will parse the first 0
as a number and then fail on the second 0, since only a comma or right
square bracket would be accepted).
Change-Id: Ifabfaed611219b3e0a06c8677190a28b87e8a13b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Preivously, we only supports probe the NVMf target
via discovery info, now we can support to directly
to connect it.
Change-Id: I08ce1d95de6744286357e68b48c97b773b902ac8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Claim the block devices used by iSCSI LUNs and NVMe-oF subsystems so
they can't accidentally be reused.
This will also be used by virtual block devices to allow layering of
bdevs.
Change-Id: I5384923fbf24f13f4ce720a797c5a628053d49f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Use a plain function pointer + callback context for the bdev I/O
completion callback. This is possible now because each I/O channel will
be polled on the core that submitted the I/O.
Change-Id: I29ee8e4a3430df11c74845adab840395b9bc5010
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
An old prototype SPDK AHCI driver would return
TASK_SET_FULL if all NCQ slots were full on a given
disk. This would kick the SCSI task back to the LUN
to be retried later. Since then, we have pushed
responsibility onto the bdev modules themselves
to handle this kind of queueing/retry logic.
Removing this logic allows us to make some additional
changes that enable tasks to get completed inline without
an extra event callback to handle completion. We also
no longer need to worry about checking if pending tasks
need to be executed in the complete_task() routine, since
the execute() routine will now always exhaust the pending_task
list.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If2dc3ab017e0dbc225c8f627e1f87c5a8e9b1e3e
The PCIe-specific unit tests still need to be updated; this patch just
moves the existing tests over and stubs out the necessary external
functions.
Change-Id: Ia6d46013231d8880df111b744523d02b56b9b37a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Now that the hotplug code is isolated in nvme_pcie.c, it can call the
PCIe transport attach function directly.
Change-Id: I2df3b9168473b537cc9b13367e06d3d3b6fa22be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
A future patch will call the bdev callback routine directly, rather
than deferring the callback routine to an event. So for these
tests we will no longer be able to free io channels in the context
of the callback routine - otherwise it will result in freeing
an NVMe I/O queue pair in the callback routine and then return
to the NVMe driver which will try to reference the now deleted
qpair.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0e4dcc5d9c5a78e8b78a4147b430570fd140d478
The spdk_nvme_qpair::num_entries value is never used in the common code,
so move it to the individual transport qpairs to make it clear that it
is a transport-specific implementation detail.
Change-Id: I5c8f0de4fcd808912ba6d248cf5cee816079fd32
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>
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>