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> |
||
---|---|---|
.. | ||
Makefile | ||
rte_vhost_compat.c | ||
vhost_blk.c | ||
vhost_internal.h | ||
vhost_nvme.c | ||
vhost_rpc.c | ||
vhost_scsi.c | ||
vhost.c |