Go to file
Huawei Xie dbfa62d63f vhost: support dynamically registering server
* support calling rte_vhost_driver_register after rte_vhost_driver_session_start
* add mutext to protect fdset from concurrent access
* add busy flag in fdentry. this flag is set before cb and cleared after cb is finished.

mutex lock scenario in vhost:

* event_dispatch(in rte_vhost_driver_session_start) runs in a separate thread, infinitely
processing vhost messages through cb(callback).
* event_dispatch acquires the lock, get the cb and its context, mark the busy flag,
and releases the mutex.
* vserver_new_vq_conn cb calls fdset_add, which acquires the mutex and add new fd into fdset.
* vserver_message_handler cb frees data context, marks remove flag to request to delete
connfd(connection fd) from fdset.
* after cb returns, event_dispatch
  1. clears busy flag.
  2. if there is remove request, call fdset_del, which acquires mutex, checks busy flag, and
removes connfd from fdset.
* rte_vhost_driver_unregister(not implemented) runs in another thread, acquires the mutex,
calls fdset_del to remove fd(listenerfd) from fdset. Then it could free data context.

The above steps ensures fd data context isn't freed when cb is using.

VM(s) should have been shutdown before rte_vhost_driver_unregister.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
2015-02-24 01:38:17 +01:00
app ethdev: rename interrupt callbacks field 2015-02-24 00:38:14 +01:00
config ethdev: support optional Rx and Tx callbacks 2015-02-24 00:38:27 +01:00
doc app/testpmd: new commands for ntuple filter 2015-02-22 04:04:53 +01:00
examples examples/rxtx_callbacks: show use of callbacks 2015-02-24 00:38:31 +01:00
lib vhost: support dynamically registering server 2015-02-24 01:38:17 +01:00
mk mk: support x32 ABI 2015-02-18 20:26:33 +01:00
pkg version: 1.8.0 2014-12-20 00:38:39 +01:00
scripts scripts: find areas without maintainer 2015-02-09 15:15:04 +01:00
tools tools: enable binding device to uio_pci_generic 2015-02-20 23:34:44 +01:00
.gitignore init DPDK repository 2013-03-07 10:57:42 +01:00
GNUmakefile remove trailing whitespaces 2014-06-11 00:29:34 +02:00
LICENSE.GPL doc: GPL/LGPL licenses 2013-07-25 14:43:06 +02:00
LICENSE.LGPL doc: fix file format (dos to unix) 2013-09-06 11:43:07 +02:00
MAINTAINERS examples/rxtx_callbacks: show use of callbacks 2015-02-24 00:38:31 +01:00
Makefile remove trailing whitespaces 2014-06-11 00:29:34 +02:00