Skip to content

Commit

Permalink
dpdk: Fix detection of vhost_cuse in dpdk rte_config.h
Browse files Browse the repository at this point in the history
Dpdk allows users to create a config that includes other config files and
then override values.

Eg.
defconfig_x86_64-native_vhost_cuse-linuxapp-gcc:

CONFIG_RTE_BUILD_COMBINE_LIBS=y
CONFIG_RTE_BUILD_SHARED_LIB=n
CONFIG_RTE_LIBRTE_VHOST=y
CONFIG_RTE_LIBRTE_VHOST_USER=n

This allows you to have both a vhostuser and vhostcuse config in the same
source tree without the need to replicate everything in those config files
just to change a couple of settings. The resultant .config file has all of
the settings from the included files with the updated settings at the end.
The resultant rte_config.h contains multiple undefs and defines for the
overridden settings.

Eg.
  > grep RTE_LIBRTE_VHOST_USER x86_64-native_vhost_cuse-linuxapp-gcc/include/rte_config.h
  #undef RTE_LIBRTE_VHOST_USER
  #define RTE_LIBRTE_VHOST_USER 1
  #undef RTE_LIBRTE_VHOST_USER

The current mechanism to detect the RTE_LIBRTE_VHOST_USER setting merely
greps the rte_config.h file for the string "define RTE_LIBRTE_VHOST_USER 1"
rather than the final setting of RTE_LIBRTE_VHOST_USER. The following patch
changes this test to detect the final setting of RTE_LIBRTE_VHOST_USER.

Signed-off-by: Gary Mussar <gmussar@ciena.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com
  • Loading branch information
Gary Mussar authored and Pravin B Shelar committed Jul 28, 2015
1 parent adc48a5 commit 693e113
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion acinclude.m4
Expand Up @@ -175,7 +175,11 @@ AC_DEFUN([OVS_CHECK_DPDK], [
DPDK_LIB="-lintel_dpdk"
DPDK_EXTRA_LIB=""
OVS_GREP_IFELSE([$RTE_SDK/include/rte_config.h], [define RTE_LIBRTE_VHOST_USER 1],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <$RTE_SDK/include/rte_config.h>
#if !RTE_LIBRTE_VHOST_USER
#error
#endif], [])],
[], [AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse support enabled, vhost-user disabled.])
DPDK_EXTRA_LIB="-lfuse"])
Expand Down

0 comments on commit 693e113

Please sign in to comment.