Poller should return status > 0 when it did some work
(CPU was used for some time) marking its call as busy
CPU time.
Active pollers should return BUSY status only if they
did any meangful work besides checking some conditions
(e.g. processing requests, do some complicated operations).
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Id4636a0997489b129cecfe785592cc97b50992ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2164
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
If the vhost dev can't unregister successfully then we
leave the io channel and desc. In the bdev remove callback
we will free them or It would cause heap-use-after-free
issue.
Fix github issue: #1443
Change-Id: I09f4616e181d6657add3acef0ff92336fb9a9643
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2924
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
The packed ring can supply up to 10% performance promotion.
Let's set the packed ring format as default.
Change-Id: Ie722417d20f3355769eefce4fec9831c60976e6f
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2821
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Having spdk_vhost_blk_get_dev required us to bump up the SO version
the vhost library when we updated bdev.h but spdk_vhost_blk_get_dev
has not been used publicly, and can be inlined very simply.
So remove spdk_vhost_blk_get_dev from include/spdk/vhost.h and inline
it to the place which had used it.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I98c233b81d7980d4e2c5bd3c0a65d747f183e1e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2747
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Also, while we are here, consolidate setting SO_SUFFIX to one spot.
Previously, it was possible for a library to slip through
without an SO version.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I4db5fa5839502d266c6259892e5719b05134518c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2361
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This variable is only used in this function.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib1836662e8068f6a459ce8746b45b5dca08079e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2305
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
In current implementation, lib/vhost assumes that it always runs
together with lib/event, and would call lib/event's functions in
vhost.c. This is not necessary and make program unable to
create/destroy vhost module without init/fini the whole spdk env. It
would cause problems when program runs with vhost and other spdk
components together.
In this patch, we remove the dependency of lib/vhost on lib/event by
adding a global vairable g_vhost_core_mask so that it could handle
core mask by itself.
Signed-off-by: Kyle Zhang <kyle@smartx.com>
Change-Id: I38ceb92ac39b6980955346fda41e968aaead863d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1204
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When starting qemu with vhost-user-blk multiqueue(set num-queues to
more than 1), the vhost device will be started/stopped many times
(related to the queue num), as the vhost-user backend doesn't know the
exact number of queues used for this device.
The target have to stop and start the device once got a valid IO queue.
When stoping and starting the vhost device, the backend bdev io device
will be deleted and created repeatly.
If the backend bdev is a distribution system, the cost is large as the
network RTT.
In this patch, add a dummy_io_channel to hold a reference to the io
device, so that the io device will not be deleted.
Change-Id: I5737248ec52bee06342ff0873bb89fd0a51665c2
Signed-off-by: Li Feng <fengli@smartx.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2020
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
If the vdev is marked for hotremove, it is possible that the
name has already been freed resulting in a heap use after free,
so remove the warning about a vdev being marked for hotremove
to avoid a segfault when removing a device.
This was observed in the vhost fuzz tests.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I2891ca2bee70d72fb7b0dff96d569e9b92fe84eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2071
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
For the NVMe interface virtualization, we are developing the
MUSER as the replacement for vhost_nvme target, before the
MUSER solution be merged to SPDK, here we still maintain
vhost_nvme for the coming 20.04 release.
Change-Id: Ife117474330bf9e3fab1071dae2beb0f6897dff8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1936
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
spdk_scsi_dev_get_lun will never return null when we
ask for lun 0, but some static analysis tools complain.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I09aa8e03c28f1a3448f68d6f4d9aa6e7003c4c1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1983
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
This is executed on hot path for I/O. Inline it.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6ded0dd3c15e81954350a9eb372156e9d38f87e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1725
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
We will be create fine name for each poller but it will need large
effort. Replacing spdk_poller_register by the macro SPDK_POLLER_REGISTER
will provide better name than function address with minimum effort.
Following patches may improve function name for clarification.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If862a274c5879065c3f7cb04dcb5ca7844523e68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1781
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Community-CI: Broadcom CI
Update vhost blk contruct rpc, make it enable to
support packed ring feature.
Change-Id: Ia1f75e72e8441e8d82fad89073e4875f89e5b9cd
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Support the packed ring for the blk backend.The relative
APIs has been submitted to the DPDK upstream and merged.
About the packed ring see below:
https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-610007
Change-Id: I43488604bf18d40a14c76b95206e07db76a14c0d
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/759
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Add the packed ring operations in spdk vhost.
Change-Id: I25c9701aadbb283f8f3ecccf599a863395d1c7f0
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/758
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Add the packed ring support in spdk vhost.
Negotiate packed ring feature when start device.
Change-Id: Idef50a1426b6e38d789d8c6982a3ed7594e32cf5
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/672
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Add scsi_blk_init function to replace the common
code of task initlization. The same to process_vq
function.
Change-Id: Ied0582ad7f087990c581e6e7aacde6ec201964dc
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1613
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Extract _spdk_thread_exit() from spdk_thread_exit() and
_spdk_thread_poll() calls _spdk_thread_exit() if the thread is in
the exiting state. spdk_thread_exit() changes to move the state to
the exiting state. The spdk_thread_poll() loop will end after the
thread moves to the exited state because the caller of
spdk_thread_poll() will check if the thread is in the exited state,
and break the loop if true.
If the user does not call spdk_thread_exit() explicitly, the reactor
has to terminate all existing threads at its shutdown. In this case,
multiple threads may have some dependency to release I/O channels or
unregister pollers. So the reactor has the large two loops, the first
loop calls spdk_thread_exit() on all threads, the second loop calls
spdk_thread_destroy() if exited or spdk_thread_poll() otherwise for
each thread until all threads are destroyed.
Besides, change the return value of spdk_thread_exit() to return
always 0. Keep it for ABI compatibility. Change ERRLOG to INFOLOG
for _spdk_thread_exit() because it is called repeatedly now. Remove
the check of I/O reference count from _spdk_thread_exit() because
_free_thread() cannot free I/O channel. Refine the unit test
accordingly.
Fixes issue #1288.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iee5fb984a96bfac53110fe991dd994ded31dffa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Add process_blk_task to replace the common codes
of the process_vq and submit_inflight_desc for making
code simple.
Change-Id: I5ff146e904874714dd59249f5191a3606e523c3e
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1348
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Fix the vdev->name to vsession->name for making it
same with the process_vq.
Change-Id: Ie0e9733bdbfbddbbf7e665b8c9431bfdbcb8a569
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1367
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Not context passed to vhost_dev_for_each_session() but struct
spdk_vhost_session had been passed to the callback to
vhost_dev_for_each_session() by mistake.
This patch fixes the bug. Besides, rename ctx by ev_ctx to avoid
potential future degradation.
Fixes issue #1306.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8ceed4e1bb7c0c27fb75516527e3bad91a054b02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1432
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
There's no reason not to publish those. Especially if
they're needed in other public headers.
Change-Id: I7dfc6922fcc0dfc46822ad8a16a375f997b98e84
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1041
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This will allow us to keep track of compatibility issues on a
per-library basis.
Change-Id: Ib0c796adb1efe1570212a503ed660bef6f142b6e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1067
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This will be re-used in the muser transport of nvmf.
Change-Id: If00e6ea79ffdc0c3bda0402f39c5f9f4f411788b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/425
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
By sending message to the thread with which controller is associated,
we can simplify vhost_dev_foreach_session(). We can iterate
sessions list and we do not have to differentiate if session is
started or not.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I59767a5788c190545a81976e75871609da703f45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1147
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Currently each controller is associated with one of the poll groups.
For each controller, all sessions are associated with the poll
groups with which the corresponding controller is associated.
Vhost poll group does not have any polling loop but its usage was
very complex.
Association of controller with poll group is done based on the
specified cpumask, and poll group is created per CPU core.
This is as same as association of thread with CPU core.
So in this patch, replace poll group per session by thread per
controller.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifa1e136caae11959f7b097b06a22910bc2169b30
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1146
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
The next patch will create a SPDK thread in vhost_dev_register()
and exit the SPDK thread in vhost_dev_unregister().
As a preparation, simplify error paths in vhost_dev_register()
by changing some gotos to return, moving free after the out label,
and moving insertion after succeeding vhost_register_unix_socket().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id1a2a50b4ba5732f91598a326a08de5c652fd136
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1145
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Replace g_tmp_cpuset by tmp_cpuset local in vhost_get_poll_group()
without any side effect.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibb01d2c77d6d82d7cc81df722e7848b357d4e9e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/840
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Use the payload to construct iovs so that split desc
or packed desc can both work.
Change-Id: Ib2c60b6eb53d0d615594e97b3d3ae1a365908b6c
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1000
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Solve the problem that the /sys/block/vd../max_segments is always 1 in the virtual
machine,and avoid the problem of low sequential read and write performance caused
by this limitation in the general block device layer of some lower kernels.
Signed-off-by: suhua <suhua1@kingsoft.com>
Change-Id: I3289b4c6c74d9225f34e117f444f310bf8bc8ea2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/975
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
We will not enable the live recovery feature for SPDK internal vhost library,
so we unmask the protocol flag for internal vhost library.
For the purpose to make it can be compiled with latest DPDK version, some
mandatory APIs are required, so add them here.
Change-Id: I34fab7ed90c86a0fb612852a47f6cadeb8a072f3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482069
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Commit 1a1cbdf30 changed the struct spdk_vhost_dev to have static
cpumask variable which broke the complilation. This patch will
fix that.
Change-Id: I8d0ef90f491e4fc4f0fae6faff2909fd3bd68053
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479500
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
There are for loops to do these calculations for vhost session memory region.
we can inline these for both in vhost_session_mem_register and
vhost_session_mem_unregister.
It not only removed the duplicated codes but also reduced the stack consumption.
Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: Idb9f5ea13e09aef6b24fa27a2bb809b15ece50e2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478820
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Following the recent effort and the last patch, allocate g_tmp_cpuset
statically in lib/vhost/vhost.c.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5ed6179f9d5942cd868be008c3be6c35d755b455
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478579
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Following the recent effort, allocate struct spdk_cpuset statically
for struct spdk_vhost_dev. In vhost_dev_register(), a dynamically
allocated cpumask had been set to spdk_vhost_dev, but change it
to spdk_cpuset_copy(). So use local cpuset instance in vhost_dev_register()
accordingly.
To reduce the size of patch, this patch doesn't include the change
for g_tmp_cpuset. This will be done by the next patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic97753d1f470cbfd9ae7fc7f2af8ced5a31c8477
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478578
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This patch is for the vhost-blk live recovery feature
which can make spdk recover from crash or killing.
The relate rte_xx functions are in the the shared memory
protocol patches which have been merged in DPDK 19.11.
Change-Id: Ia0ac99f8ba0bd66dc9f525f2c72bd1de141ec596
Signed-off-by: Li Lin <lilin24@baidu.com>
Signed-off-by: Ni Xun <nixun@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471235
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Add the protocol_features in vdev. There are two features
would be used in vhost device one is the virtio_features
the other is the vhost-user protocol_features. For different
vhost device, the supported features are different so we can
separate them.
Another reason is that I tested the VHOST_USER_PROTOCOL_F_
INFLIGHT_SHMFD in vhost-scsi with QEMU(version:4.0) and found
that Qemu can not boot up. After investigating found that inflight
flag is negotiated but the Qemu doesn't support this feature
and in DPDK function it is handled as an error and disconnect
with Qemu. It's a bug in DPDK and will fix it.
Change-Id: I72e418cb1885bf7dcbd0285d9cec1ad6af0665de
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478814
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
In vhost-blk, choose supported features based on what
backend bdev supports instead of disabling not supported features.
This will prevent from enabling not supported feature in runtime.
Change-Id: Ie9453c7c02eb6d0a0ff0f1887048f4092cb7b14f
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476617
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Replace usage of rte_vhost_driver_enable_features() by
setting disabled_features field dynamically.
This patch doesn't change functionality, but simplifies
initialization and removes usage of socket operation.
Call to drive_enable_features() had to be done when
features field was static, but now it is mutable so
the call became redundant.
Change-Id: I6efc63883773e4ba6d931efd057a38a705c53217
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476616
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This will enable us to make features dynamic, dependent on underlying
backend device, and to remove usage of rte_vhost functions in
vhost-blk implementation which will improve encapsulation
and enable us to write tests that use vhost-blk functions directly.
Dynamic features are used in vhost_blk, but backend structure is
assumed to be static, so we had to call
rte_vhost_driver_enable_features() after registering it with
some features initially disabled.
This patch moves feature fields to vdev structure where it
can be set dynamically.
Change-Id: Icd76bdd76a3d67ec74e0ac992d8da639beead593
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470460
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
For now we don't provide #ifdef to users, SPDK_CACHE_LINE_SIZE is defined with 64 bytes.
Change-Id: I8ddb01a382008a3e333967650200c5aa8b93e09e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477385
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>