Pull out the duplicated min checks against the ibdev_attr values.
Change-Id: I774c355ba669486afde5c05c55a4ed653723db98
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Set a status code in the response capsule for each possible error case.
Also enforce CC.EN == 1 before I/O connect.
The NVMf spec requires that the controller is enabled before any I/O
queue Connect commands are allowed.
Change-Id: If56d6b4d6bedad00e9e845e77f05f715e3969f8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Drop the debug print in conn.c that was the only user.
We still have the connect data structure when determining the connection
type, and after that point, the queue ID is not needed.
Change-Id: Ida9e170099f977ec6b84478874863c40d6f7d8a1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The NVMf target is being refactored to split the RDMA transport-specific
code into its own file. Once this is complete, we should be able to
plug in other transports and build the NVMf target without any RDMA
dependency if desired.
To enable this, change the CONFIG option to RDMA; it still controls
whether the whole NVMf target is built for now, but once the RDMA
dependency is actually made optional, we will be able to build the
generic NVMf target code without libibverbs installed.
Change-Id: I8cd90a9aaa85dcefcc9b0f8f2e7b6af21958b2a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Move the configuration file parsing for subsystems
into the configuration file parsing file.
Change-Id: Ie16e73cdc65fae7f2f3c3b22f9cba7f167024fa1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The code for parsing the configuration file still
referred to a host as an init_grp, so fix it.
Change-Id: Ifa250b09de495dd7d393ccc3557fd6d56a54e790
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This never really made sense, so replace it with a list of
subsystems.
Change-Id: Ie7a9400083c091ac7142d01c23948200f515bdf7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This is just extra complication for no real benefit.
Change-Id: I528af98e799d0641e753390fe35ff561fa3d7d76
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This allows the custom UIO hotplug driver to be used as well as the
uio_pci_generic driver.
Change-Id: Ica3316ed716827ad305eb4a146d0864d61ff190f
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Linking this new library allows applications using
the framework to be killed via an RPC call.
This only works if the RPC subsystem is loaded.
Change-Id: Ifcf91c212add620fe410589eba5490337c635776
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Linking this library into an application makes the log
configurable via RPC. This only works if the rpc subsystem
is also loaded.
Change-Id: If1340cf2a845ef159290232c26f341150c98fb9a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Use the number of devices returned by ibv_get_device_list() instead of
stopping at 4.
While we're here, drop the unused MAX_SESSIONS_PER_DEVICE definition
too.
Change-Id: I21ca6c6c95b7f2cccc1de4d0a34b95217a522bfc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is the only file that calls it, so it can be static.
Change-Id: I47573b7b38b40ad37e758234245eedbe94ae0a12
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
These were internal-only APIs; initialize just checks to see that the
pool was initialized (which is already checked internally), and shutdown
just called spdk_nvmf_shutdown_nvme(), which we can call directly.
Change-Id: I95e1b912d61a38fa9934f58df7b1512678303452
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
These can be isolated in rdma.c rather than being part of the generic
transport API.
Change-Id: Idc2b969a2f7685420cda2f7c4aa12495ffc3fcbc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Just calculate the required number of requests once and store it in a
global variable.
Change-Id: Iffeb637a3ac5f69ec89989b84f03699bac483b6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
There can be only one session per subsystem.
Change-Id: I8ba85a5ebd11dd71fda2a4bafa97a0935609379f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
It is just a duplicate of the NVMe library request_mempool.
Change-Id: I2a5484e5d515b965503b2cfcd8d85ccfcb0dee05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Clean up everything that isn't strictly necessary in rdma.h.
Change-Id: Ied9acbed5f5b64860eae39816cdcb74620009a79
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This essentially turns the current nesting (of RDMA conn inside NVMf
conn) inside out. Now the transport owns the connection structure and
allocates it when necessary.
Change-Id: Ib5ca84e2a57b16741d84943a5b858e9c3297d44b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This sets up the RDMA layer to be able to embed the NVMf conn inside the
RDMA conn.
Change-Id: I5e3714ac8503826504d78d06fb5eaafabd025bb8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The whole cleanup process is now started by
spdk_shutdown_nvmf_subsystems(). Each subsystem will clean up its
session, if any, and each session will clean up its connections.
Change-Id: I9915d4547751ed4ffc4baa2c45c628698dd0b881
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The per-lcore connection counter was incremented and decremented, but it
is no longer actually read. The lcore allocation should happen at the
session level instead.
Change-Id: I7bdf1b521bfda4892304338d43fad3ed5123c494
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Nothing actually maps the shared memory region, so there is no need to
allocate the array of connections that way.
Change-Id: I3d5eca748f892e37fbb0ec52942f1c510e9f9dc8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
There is only one controller per subsystem, so therefore
there can be 0 or 1 sessions. Change the list of sessions
to a pointer that can be NULL if no session exists.
Change-Id: I2c0d042d9cecacae93da3e806093faf0155ddd6e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Subsystems only have one controller, so cntlid
is always 0.
Change-Id: I690a1793ad3a696adbaefca856e559dd0177b11a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This was intended to track the number of NVMe device
queues per session, but there is only one hardware
queue per session. It was conflated with the number
of RDMA queues in several places as well.
Change-Id: I74a1c56a5d395dea8bee4778882821e904cebcf9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Everything can be done when the session is created.
Change-Id: I7cb38c093b2b1b69460cabba465828eed0cec432
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The cntlid is inside the session, so no need for
duplicate data.
Change-Id: I5669ee6393807959506dfec36a7583af77386fc4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Since we only allocate workers to the master lcore,
remove the logic that places I/O conns on the same
lcore as the admin conn.
The "right" logic would be to place the I/O conn
on the same lcore as the whole session, and this
patch builds toward that.
Change-Id: I8983b56de41062ec834b0a169ba0fa61326c466d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Temporarily, only run on the master lcore. This makes
some temporary refactoring possible that is required
to move to a truly scalable threading model.
Change-Id: I13a2e03107a27f8ec18b023b15f653d374a137b5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This is a bit heavy handed, but really make sure all
activity has ceased.
Change-Id: Iaa1ce16fd9e059f9eaec6712226344d69075b243
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
A connection function was initializing some session data, so
move that code to the function that initializes the session.
Change-Id: I5f2d4349585cb97985a7bbd9fb8d6c66eeaa7d4e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
There was an extra layer of indirection complicating
things for no reason. This removes it.
Change-Id: I8d4e654eb17f8f6ec028d775329794f0745fb0f7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The NVMf target set the maximum data transfer size(MDTS) to the default value
of 128KB now, and the initiator driver will read the value and set it to the
block layer, so each command sent from initiator will not runoff 128KB.
Change-Id: I1d4f259e887b2fc70c7f1c5406c07c58f7fc9b8d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
There's no benefit of reloading the NIC drivers (unless the drivers
themselves are buggy), so save some time by skipping the rmmod of
drivers we are about to load.
Change-Id: I05c3fd06042a2e06333d0cac123d24e6cce65b23
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Only nvme-rdma should be loaded as part of the NVMf testing.
Change-Id: I232363bf0988ea9bd99a37df27c39cc8e9732ad5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>