[v2] vhost: add experimental flag

Message ID 156931701484.14501.959600637205964114.stgit@jrharri1-skx (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] vhost: add experimental flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Harris, James R Sept. 24, 2019, 9:23 a.m. UTC
  This function is listed under EXPERIMENTAL in the
rte_vhost_version.map, so it needs to be marked
with __rte_experimental in the header file as well.

Found by check-experimental-syms.sh when trying to compile
DPDK with -finstrument-functions.  This script didn't
catch this in the normal case, since the function is
declared __rte_always_inline.

This also requires updating the vhost_scsi example to allow
use of this newly marked experimental API.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
---
 examples/vhost_scsi/Makefile    |    2 ++
 examples/vhost_scsi/meson.build |    1 +
 lib/librte_vhost/rte_vhost.h    |    1 +
 3 files changed, 4 insertions(+)
  

Comments

Maxime Coquelin Sept. 27, 2019, 7:50 a.m. UTC | #1
On 9/24/19 11:23 AM, Jim Harris wrote:
> This function is listed under EXPERIMENTAL in the
> rte_vhost_version.map, so it needs to be marked
> with __rte_experimental in the header file as well.
> 
> Found by check-experimental-syms.sh when trying to compile
> DPDK with -finstrument-functions.  This script didn't
> catch this in the normal case, since the function is
> declared __rte_always_inline.
> 
> This also requires updating the vhost_scsi example to allow
> use of this newly marked experimental API.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  examples/vhost_scsi/Makefile    |    2 ++
>  examples/vhost_scsi/meson.build |    1 +
>  lib/librte_vhost/rte_vhost.h    |    1 +
>  3 files changed, 4 insertions(+)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redat.com>

Thanks,
Maxime
  
Maxime Coquelin Sept. 27, 2019, 9:48 a.m. UTC | #2
On 9/24/19 11:23 AM, Jim Harris wrote:
> This function is listed under EXPERIMENTAL in the
> rte_vhost_version.map, so it needs to be marked
> with __rte_experimental in the header file as well.
> 
> Found by check-experimental-syms.sh when trying to compile
> DPDK with -finstrument-functions.  This script didn't
> catch this in the normal case, since the function is
> declared __rte_always_inline.
> 
> This also requires updating the vhost_scsi example to allow
> use of this newly marked experimental API.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  examples/vhost_scsi/Makefile    |    2 ++
>  examples/vhost_scsi/meson.build |    1 +
>  lib/librte_vhost/rte_vhost.h    |    1

Applied to dpdk-next-virtio/master.

Thanks,
Maxime
  
Ferruh Yigit Sept. 27, 2019, 7:31 p.m. UTC | #3
On 9/24/2019 10:23 AM, Jim Harris wrote:
> This function is listed under EXPERIMENTAL in the
> rte_vhost_version.map, so it needs to be marked
> with __rte_experimental in the header file as well.
> 
> Found by check-experimental-syms.sh when trying to compile
> DPDK with -finstrument-functions.  This script didn't
> catch this in the normal case, since the function is
> declared __rte_always_inline.
> 
> This also requires updating the vhost_scsi example to allow
> use of this newly marked experimental API.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  examples/vhost_scsi/Makefile    |    2 ++
>  examples/vhost_scsi/meson.build |    1 +
>  lib/librte_vhost/rte_vhost.h    |    1 +
>  3 files changed, 4 insertions(+)
> 
> diff --git a/examples/vhost_scsi/Makefile b/examples/vhost_scsi/Makefile
> index c5aec269e..6015c0241 100644
> --- a/examples/vhost_scsi/Makefile
> +++ b/examples/vhost_scsi/Makefile
> @@ -27,6 +27,8 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
>  LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
>  LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
>  
> +CFLAGS += -DALLOW_EXPERIMENTAL_API

example still fails to build, option needs to be enabled in the 'else' leg of
the makefile, I am fixing while merging to next-net.
  

Patch

diff --git a/examples/vhost_scsi/Makefile b/examples/vhost_scsi/Makefile
index c5aec269e..6015c0241 100644
--- a/examples/vhost_scsi/Makefile
+++ b/examples/vhost_scsi/Makefile
@@ -27,6 +27,8 @@  CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
 LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
 
diff --git a/examples/vhost_scsi/meson.build b/examples/vhost_scsi/meson.build
index 77e5201bd..384127d5b 100644
--- a/examples/vhost_scsi/meson.build
+++ b/examples/vhost_scsi/meson.build
@@ -15,6 +15,7 @@  if not cc.has_header('linux/virtio_scsi.h')
 endif
 
 deps += 'vhost'
+allow_experimental_apis = true
 sources = files(
 	'scsi.c', 'vhost_scsi.c'
 )
diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index 7fb172912..fc27bc21e 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -225,6 +225,7 @@  rte_vhost_gpa_to_vva(struct rte_vhost_memory *mem, uint64_t gpa)
  * @return
  *  the host virtual address on success, 0 on failure
  */
+__rte_experimental
 static __rte_always_inline uint64_t
 rte_vhost_va_from_guest_pa(struct rte_vhost_memory *mem,
 						   uint64_t gpa, uint64_t *len)