Spdk/lib/vhost
Darek Stojaczyk 2072d16e94 vhost: assign poll group in vhost_session_start_done
Threads were assigned to sessions inside
vhost_session_send_event() so far, but even the doxygen
comments say that sessions would be assigned to the thread
which called vhost_session_start_done(). Currently, Vhost
uses only vhost_session_send_event() to schedule starting
the session on some thread, so the code ends up working.
We're about to remove vhost_session_send_event(), so move
the thread (poll group) assignment to start_done().

While here, publish the vhost_poll_group struct definition
via vhost_internal.h. As a replacement for
vhost_session_send_event() we would like to use
spdk_thread_send_msg() which a requires a thread object -
one of the struct fields inside vhost_poll_group.

The code for starting a session could look as follows:

pg = vhost_get_poll_group(cpumask);
spdk_thread_send_msg(pg->thread, cb);
...
cb:
  // start_pollers
  vhost_session_start_done(0);

Change-Id: I563f61509674768c1dea0b03767e9f39a9fb0069
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467228
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: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-10-09 02:28:17 +00:00
..
Makefile make: add dependencies for the rte_vhost build. 2019-09-09 22:15:24 +00:00
rte_vhost_compat.c vhost: remove spdk_ prefix from private functions 2019-09-09 01:39:41 +00:00
vhost_blk.c vhost: make poll group refcount per-session 2019-09-09 01:39:41 +00:00
vhost_internal.h vhost: assign poll group in vhost_session_start_done 2019-10-09 02:28:17 +00:00
vhost_nvme.c rpc: Rename add_vhost_nvme_ns to vhost_nvme_controller_add_ns 2019-10-08 15:50:14 +00:00
vhost_rpc.c rpc: Rename add_vhost_nvme_ns to vhost_nvme_controller_add_ns 2019-10-08 15:50:14 +00:00
vhost_scsi.c vhost/scsi: don't clear svdev->poll_group 2019-10-09 02:28:17 +00:00
vhost.c vhost: assign poll group in vhost_session_start_done 2019-10-09 02:28:17 +00:00