Skip to content

Commit 3c94676

Browse files
ddiproiettoPravin B Shelar
authored andcommitted
acinclude.m4: Restore --whole-archive option for DPDK.
The --whole-archive option is required to link vswitchd with DPDK, otherwise the PMD drivers are not going to be included. Omitting the option is not going to cause build failures, but OVS won't be able to use most physical NICs. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
1 parent d6f115f commit 3c94676

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

acinclude.m4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ AC_DEFUN([OVS_CHECK_DPDK], [
170170
171171
DPDK_INCLUDE=$RTE_SDK/include
172172
DPDK_LIB_DIR=$RTE_SDK/lib
173-
DPDK_LIB="-lintel_dpdk -lfuse "
173+
DPDK_LIB="-lintel_dpdk"
174+
DPDK_EXTRA_LIB="-lfuse"
174175
175176
ovs_save_CFLAGS="$CFLAGS"
176177
ovs_save_LDFLAGS="$LDFLAGS"
@@ -187,7 +188,7 @@ AC_DEFUN([OVS_CHECK_DPDK], [
187188
found=false
188189
save_LIBS=$LIBS
189190
for extras in "" "-ldl"; do
190-
LIBS="$DPDK_LIB $extras $save_LIBS"
191+
LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB"
191192
AC_LINK_IFELSE(
192193
[AC_LANG_PROGRAM([#include <rte_config.h>
193194
#include <rte_eal.h>],
@@ -206,15 +207,15 @@ AC_DEFUN([OVS_CHECK_DPDK], [
206207
OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR"
207208
OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE"
208209
209-
# DPDK 1.7 pmd drivers are not linked unless --whole-archive is used.
210+
# DPDK pmd drivers are not linked unless --whole-archive is used.
210211
#
211212
# This happens because the rest of the DPDK code doesn't use any symbol in
212213
# the pmd driver objects, and the drivers register themselves using an
213214
# __attribute__((constructor)) function.
214215
#
215216
# These options are specified inside a single -Wl directive to prevent
216217
# autotools from reordering them.
217-
DPDK_vswitchd_LDFLAGS=-Wl,$DPDK_LIB
218+
DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive
218219
AC_SUBST([DPDK_vswitchd_LDFLAGS])
219220
AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.])
220221
else

0 commit comments

Comments
 (0)