numam-dpdk/doc/guides/prog_guide
Yuanhan Liu af14759181 vhost: introduce API to start a specific driver
We used to use rte_vhost_driver_session_start() to trigger the vhost-user
session. It takes no argument, thus it's a global trigger. And it could
be problematic.

The issue is, currently, rte_vhost_driver_register(path, flags) actually
tries to put it into the session loop (by fdset_add). However, it needs
a set of APIs to set a vhost-user driver properly:
  * rte_vhost_driver_register(path, flags);
  * rte_vhost_driver_set_features(path, features);
  * rte_vhost_driver_callback_register(path, vhost_device_ops);

If a new vhost-user driver is registered after the trigger (think OVS-DPDK
that could add a port dynamically from cmdline), the current code will
effectively starts the session for the new driver just after the first
API rte_vhost_driver_register() is invoked, leaving later calls taking
no effect at all.

To handle the case properly, this patch introduce a new API,
rte_vhost_driver_start(path), to trigger a specific vhost-user driver.
To do that, the rte_vhost_driver_register(path, flags) is simplified
to create the socket only and let rte_vhost_driver_start(path) to
actually put it into the session loop.

Meanwhile, the rte_vhost_driver_session_start is removed: we could hide
the session thread internally (create the thread if it has not been
created). This would also simplify the application.

NOTE: the API order in prog guide is slightly adjusted for showing the
correct invoke order.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2017-04-01 10:42:44 +02:00
..
img doc: add EFD library section in programmers guide 2017-01-18 20:55:25 +01:00
build_app.rst mk: remove NO_AUTOLIBS option 2015-05-12 15:13:15 +02:00
cryptodev_lib.rst doc: add cryptodev chapter in prog guide 2016-04-09 00:40:33 +02:00
dev_kit_build_system.rst mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
dev_kit_root_make_help.rst mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
efd_lib.rst doc: add thread-safety information about EFD library 2017-02-14 21:48:36 +01:00
env_abstraction_layer.rst ring: remove the yield when waiting for tail update 2017-03-29 22:25:29 +02:00
ext_app_lib_make_help.rst doc: fix prefix in file references 2015-03-31 02:55:07 +02:00
extend_dpdk.rst doc: drop old naming of the project 2016-02-10 15:47:51 +01:00
glossary.rst doc: convert prog guide glossary to definition list 2015-04-14 11:19:53 +02:00
hash_lib.rst hash: fix multi-process support 2016-04-01 18:56:27 +02:00
index.rst kni: remove KNI vhost support 2017-02-21 11:43:07 +01:00
intro.rst doc: fix mistakes in prog guide 2016-12-06 17:56:04 +01:00
ip_fragment_reassembly_lib.rst doc: fix references in guides 2016-04-11 23:56:34 +02:00
kernel_nic_interface.rst kni: remove KNI vhost support 2017-02-21 11:43:07 +01:00
link_bonding_poll_mode_drv_lib.rst doc: use corelist instead of coremask 2017-03-01 20:39:58 +01:00
lpm6_lib.rst lpm6: extend next hop field 2017-03-15 18:49:41 +01:00
lpm_lib.rst doc: fix references in guides 2016-04-11 23:56:34 +02:00
mbuf_lib.rst doc: fix description of attach to indirect mbuf 2016-12-06 18:06:43 +01:00
mempool_lib.rst doc: fix macro name in mempool guide 2016-07-22 18:03:43 +02:00
multi_proc_support.rst doc: use corelist instead of coremask 2017-03-01 20:39:58 +01:00
overview.rst doc: fix typos 2016-11-07 21:50:27 +01:00
packet_classif_access_ctrl.rst acl: allow zero verdict 2017-01-30 11:08:47 +01:00
packet_distrib_lib.rst doc: update distributor lib guide for new burst API 2017-03-29 16:46:58 +02:00
packet_framework.rst doc: fix spellings 2015-12-15 13:50:42 +01:00
pdump_lib.rst doc: fix default socket path names in pdump guide 2016-07-16 11:31:37 +02:00
perf_opt_guidelines.rst doc: remove Intel references from prog guide 2014-12-19 23:30:26 +01:00
poll_mode_drv.rst ethdev: add API to free consumed buffers in Tx ring 2017-03-27 17:17:33 +02:00
port_hotplug_framework.rst vfio: support hotplug 2017-03-30 18:40:15 +02:00
power_man.rst doc: remove Intel references from prog guide 2014-12-19 23:30:26 +01:00
profile_app.rst doc: add ARM profiling methods 2016-11-11 00:51:19 +01:00
qos_framework.rst doc: fix references in guides 2016-04-11 23:56:34 +02:00
reorder_lib.rst doc: new reorder library description 2015-02-18 16:52:05 +01:00
ring_lib.rst ring: remove watermark support 2017-03-29 22:25:34 +02:00
rte_flow.rst ethdev: add MPLS and GRE flow API items 2017-04-04 19:02:58 +02:00
source_org.rst ivshmem: remove library and its EAL integration 2016-08-23 12:23:58 +02:00
thread_safety_dpdk_functions.rst doc: drop old naming of the project 2016-02-10 15:47:51 +01:00
timer_lib.rst doc: fix spellings and typos 2015-04-29 18:34:58 +02:00
vhost_lib.rst vhost: introduce API to start a specific driver 2017-04-01 10:42:44 +02:00
writing_efficient_code.rst ring: return remaining entry count when dequeuing 2017-03-29 22:32:20 +02:00