path: root/examples/vhost_scsi
AgeCommit message (Collapse)Author
2018-10-22mk: build with _GNU_SOURCE defined by defaultAnatoly Burakov
We use _GNU_SOURCE all over the place, but often times we miss defining it, resulting in broken builds on musl. Rather than fixing every library's and driver's and application's makefile, fix it by simply defining _GNU_SOURCE by default for all builds. Remove all usages of _GNU_SOURCE in source files and makefiles, and also fixup a couple of instances of using __USE_GNU instead of _GNU_SOURCE. Signed-off-by: Anatoly Burakov <>
2018-07-12examples: make Linux environment check consistentThomas Monjalon
Some Makefiles are using CONFIG_RTE_EXEC_ENV and others are using CONFIG_RTE_EXEC_ENV_LINUXAPP. Use the latter one for consistency. We could remove CONFIG_RTE_EXEC_ENV later if considered useless. Signed-off-by: Thomas Monjalon <>
2018-05-13examples/vhost_scsi: replace strncpy with strlcpyReshma Pattan
Use strlcpy instead of strncpy. Fixes: db75c7af19 ("examples/vhost_scsi: introduce a new sample app") Cc: Signed-off-by: Reshma Pattan <> Acked-by: Bruce Richardson <>
2018-04-23examples/vhost_scsi: move to safe GPA translation APIMaxime Coquelin
This patch uses the new rte_vhost_va_from_guest_pa() API to ensure all the descriptor buffer is mapped contiguously in the application virtual address space. As the application did not checked return of previous API, this patch just print an error if the buffer address isn't in the vhost memory regions or if it is scattered. Ideally, it should handle scattered buffers gracefully. This issue has been assigned CVE-2018-1059. Signed-off-by: Maxime Coquelin <>
2018-04-17examples: disable unsupported examples on BSD buildBruce Richardson
When building with meson, set build to false when building unsupported example apps on FreeBSD. Signed-off-by: Bruce Richardson <> Tested-by: Harry van Haaren <>
2018-02-05examples/vhost_scsi: drop unimplemented event index featureStefan Hajnoczi
The vhost_scsi example application negotiates the VIRTIO_RING_F_EVENT_IDX feature bit but does not honor it when accessing vrings. In particular, commit e37ff954405addb8ea422426a2d162d00dcad196 ("vhost: support virtqueue interrupt/notification suppression") broke vring call because vq->last_used_idx is never updated by vhost_scsi. The vq->last_used_idx field is not even available via the librte_vhost public API, so VIRTIO_RING_F_EVENT_IDX is currently only usable by the built-in virtio_net.c driver in librte_vhost. This patch drops VIRTIO_RING_F_EVENT_IDX from vhost_scsi so that vring call works again. Signed-off-by: Stefan Hajnoczi <> Reviewed-by: Changpeng Liu <> Acked-by: Yuanhan Liu <>
2018-01-30build: replace license text with SPDX tagBruce Richardson
Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>
2018-01-30examples: enable linking both static and sharedBruce Richardson
Since the DPDK build now includes both static and shared libraries, we need a new way to enable building the examples using either method from the one installation. To do this, we add in a default "shared" target, and a separate "static" target which links in the DPDK static libraries. In both cases, the final application name is symlinked to the last-built static or shared target, with both binaries able to co-exist in the build directory. Signed-off-by: Bruce Richardson <> Acked-by: Luca Boccassi <>
2018-01-30examples: use pkg-config in makefilesBruce Richardson
Change the example app Makefiles to query if DPDK is installed and registered using pkg-config. If so, build directly using pkg-config info, otherwise fall back to using the original build system with RTE_SDK and RTE_TARGET This commit changes the makefiles for the basic examples, i.e. those which do not have multiple subdirectories underneath the main examples dir. Examples not covered are: * ethtool * multi_process * performance-thread * quota_watermark * netmap_compat * server_node_efd * vm_power_manager Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>
2018-01-30examples: put app name and sources at top of makefilesBruce Richardson
Reorder the text in the makefiles, so that the app name and the source files are listed first. This then will allow them to be shared later in a combined makefile building with pkg-config and RTE_SDK-based build system. Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>
2018-01-30examples: build some samples with mesonBruce Richardson
Add support for having selected example apps built as part of a meson, ninja build. By default none are built, and those to be built should be named directly in the -Dexamples='' meson configuration argument. This is useful for developers working on a feature who want to use a suitable example, or examples, to test that feature, as they can compile everything up in one go, and run the example without having to do a ninja install first. This commit adds examples which don't consist of multiple apps in subdirectories to the meson build, so they can be built by default by passing -Dexamples parameter to meson. Not included are the following examples: * ethtool * multi-process * netmap_compat * performance-thread * quota_watermark * server_node_efd * vm_power_manager To test the apps added here, use the following command, merged to one line, to add them to your meson build (command to be run inside the build directory): meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\ eventdev_pipeline_sw_pmd, exception_path,helloworld,\ ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\ ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\ l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\ link_status_interrupt,load_balancer,packet_ordering,ptpclient,\ qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\ timer,vhost,vhost_scsi,vmdq,vmdq_dcb Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>
2018-01-16vhost: introduce vring call APIStefan Hajnoczi
Users of librte_vhost currently implement the vring call operation themselves. Each caller performs the operation slightly differently. This patch introduces a new librte_vhost API called rte_vhost_vring_call() that performs the operation so that vhost-user applications don't have to duplicate it. Signed-off-by: Stefan Hajnoczi <> Reviewed-by: Maxime Coquelin <> Acked-by: Yuanhan Liu <>
2018-01-04examples: use SPDX tag for Intel copyright filesBruce Richardson
Replace the BSD license header with the SPDX tag for files with only an Intel copyright on them. Signed-off-by: Bruce Richardson <>
2017-10-25examples/vhost_scsi: fix product id string terminationJacek Piasecki
Use snprintf instead strncpy to get safe null string termination. There was possible to get not terminated string after strncpy operation. Coverity issue: 158631 Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app") Cc: Signed-off-by: Jacek Piasecki <> Acked-by: Maxime Coquelin <>
2017-07-19examples/vhost_scsi: introduce a new sample appChangpeng Liu
vhost-user protocol is common to many virtio devices, such as virtio_net/virtio_scsi/virtio_blk. Since DPDK vhost library removed the NET specific data structures, the vhost library is common to other virtio devices, such as virtio-scsi. Here we introduce a simple memory based block device that can be presented to Guest VM through vhost-user-scsi-pci controller. Similar with vhost-net, the sample application will process the I/Os sent via virt rings. Signed-off-by: Changpeng Liu <>