numam-dpdk/lib
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
..
librte_acl mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_cfgfile mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_cmdline cmdline: fix check in port list parsing 2015-02-20 10:50:16 +01:00
librte_compat mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_distributor mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_eal eal/linux: allow to map BARs with MSI-X tables 2015-02-23 21:57:31 +01:00
librte_ether ethdev: support optional Rx and Tx callbacks 2015-02-24 00:38:27 +01:00
librte_hash hash: slice CRC data into 8-byte pieces 2015-02-23 18:30:05 +01:00
librte_ip_frag mbuf: remove build option to disable refcnt 2015-02-23 19:31:24 +01:00
librte_ivshmem mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_kni mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_kvargs mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_lpm mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_malloc mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_mbuf mbuf: remove build option to disable refcnt 2015-02-23 19:31:24 +01:00
librte_mempool mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_meter mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_net net: change arp header struct declaration 2015-02-20 22:10:52 +01:00
librte_pipeline mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_pmd_af_packet mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_pmd_bond ethdev: rename interrupt callbacks field 2015-02-24 00:38:14 +01:00
librte_pmd_e1000 ethdev: unification of RSS offload types 2015-02-22 23:56:20 +01:00
librte_pmd_enic mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_pmd_fm10k ethdev: unification of RSS offload types 2015-02-22 23:56:20 +01:00
librte_pmd_i40e i40e: enable internal switch of PF 2015-02-15 07:39:43 +01:00
librte_pmd_ixgbe mbuf: remove build option to disable refcnt 2015-02-23 19:31:24 +01:00
librte_pmd_pcap mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_pmd_ring ethdev: rename interrupt callbacks field 2015-02-24 00:38:14 +01:00
librte_pmd_virtio virtio: remove Rx hotspots from early return 2015-02-20 19:19:21 +01:00
librte_pmd_vmxnet3 ethdev: unification of RSS offload types 2015-02-22 23:56:20 +01:00
librte_pmd_xenvirt mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_port mbuf: remove build option to disable refcnt 2015-02-23 19:31:24 +01:00
librte_power mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_reorder reorder: new library 2015-02-18 16:52:05 +01:00
librte_ring mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_sched mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_table mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_timer mk: add library version extension 2015-02-03 16:56:58 +01:00
librte_vhost vhost: support dynamically registering server 2015-02-24 01:38:17 +01:00
Makefile reorder: new library 2015-02-18 16:52:05 +01:00