With this commit we move our DPDK support to 1.7.0.
DPDK binaries (starting with dpdk 1.7.0) should be linked with --whole-archive
to include pmd drivers
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Building and Installing:
------------------------
-Recommended to use DPDK 1.6.
+Required DPDK 1.7.
DPDK:
-Set dir i.g.: export DPDK_DIR=/usr/src/dpdk-1.6.0r2
+Set dir i.g.: export DPDK_DIR=/usr/src/dpdk-1.7.0
cd $DPDK_DIR
-update config/defconfig_x86_64-default-linuxapp-gcc so that dpdk generate single lib file.
+update config/common_linuxapp so that dpdk generate single lib file.
CONFIG_RTE_BUILD_COMBINE_LIBS=y
-make install T=x86_64-default-linuxapp-gcc
+make install T=x86_64-native-linuxapp-gcc
For details refer to http://dpdk.org/
Linux kernel:
OVS:
cd $(OVS_DIR)/openvswitch
./boot.sh
-export DPDK_BUILD=/usr/src/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc
+export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc/
./configure --with-dpdk=$DPDK_BUILD
make
- insert uio.ko
e.g. modprobe uio
- insert igb_uio.ko
- e.g. insmod DPDK/x86_64-default-linuxapp-gcc/kmod/igb_uio.ko
- - Bind network device to ibg_uio.
- e.g. DPDK/tools/pci_unbind.py --bind=igb_uio eth1
+ e.g. insmod $DPDK_BUILD/kmod/igb_uio.ko
+ - Bind network device to igb_uio.
+ e.g. $DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio eth1
Alternate binding method:
Find target Ethernet devices
lspci -nn|grep Ethernet
DPDK_INCLUDE=$RTE_SDK/include
DPDK_LIB_DIR=$RTE_SDK/lib
+ DPDK_LIB=-lintel_dpdk
LDFLAGS="$LDFLAGS -L$DPDK_LIB_DIR"
CFLAGS="$CFLAGS -I$DPDK_INCLUDE"
found=false
save_LIBS=$LIBS
for extras in "" "-ldl"; do
- LIBS="-lintel_dpdk $extras $save_LIBS"
+ LIBS="$DPDK_LIB $extras $save_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <rte_config.h>
#include <rte_eal.h>],
AC_MSG_ERROR([cannot link with dpdk])
fi
+ # DPDK 1.7.0 pmd drivers are not linked unless --whole-archive is used.
+ #
+ # This happens because the rest of the DPDK code doesn't use any symbol in
+ # the pmd driver objects, and the drivers register themselves using an
+ # __attribute__((constructor)) function.
+ #
+ # These options are specified inside a single -Wl directive to prevent
+ # autotools from reordering them.
+ vswitchd_ovs_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive
+ AC_SUBST([vswitchd_ovs_vswitchd_LDFLAGS])
AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.])
else
RTE_SDK=
{
int result;
- result = rte_pmd_init_all();
- if (result) {
- VLOG_ERR("Cannot init PMD");
- return -result;
- }
-
result = rte_eal_pci_probe();
if (result) {
VLOG_ERR("Cannot probe PCI");
return ENOMEM;
}
- err = rte_eth_from_rings(&ivshmem->cring_rx, 1, &ivshmem->cring_tx, 1, SOCKET0);
+ err = rte_eth_from_rings(dev_name, &ivshmem->cring_rx, 1,
+ &ivshmem->cring_tx, 1, SOCKET0);
+
if (err < 0) {
rte_free(ivshmem);
return ENODEV;
ovs_abort(result, "Cannot init EAL\n");
}
- rte_memzone_dump();
+ rte_memzone_dump(stdout);
rte_eal_init_ret = 0;
if (argc > result) {
*/
static char buffer[sizeof(MP_CLIENT_RXQ_NAME) + 2];
- rte_snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_RXQ_NAME, id);
+ snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_RXQ_NAME, id);
return buffer;
}
*/
static char buffer[sizeof(MP_CLIENT_TXQ_NAME) + 2];
- rte_snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_TXQ_NAME, id);
+ snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_TXQ_NAME, id);
return buffer;
}