2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-01 06:45:17 +00:00

DPDK: add support for v2.0.0

Update relevant artifacts to add support for DPDK v2.0.0
 - INSTALL.DPDK.md
 - travis build script
 - acinclude.m4: add 'mssse3' flag to OVS_CFLAGS
 - netdev-dpdk: fix build with unified offload types in DPDK v2.0.0

Note that this breaks compatibility with DPDK v1.8.0

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
Mark Kavanagh
2015-04-20 12:37:14 -07:00
committed by Pravin B Shelar
parent 66cabc46ec
commit 543342a41c
4 changed files with 18 additions and 11 deletions

View File

@@ -49,6 +49,7 @@ function install_dpdk()
find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/' find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp
sed -ri 's,(CONFIG_RTE_LIBRTE_VHOST=).*,\1y,' config/common_linuxapp sed -ri 's,(CONFIG_RTE_LIBRTE_VHOST=).*,\1y,' config/common_linuxapp
sed -ri 's,(CONFIG_RTE_LIBRTE_VHOST_USER=).*,\1n,' config/common_linuxapp
sed -ri '/CONFIG_RTE_LIBNAME/a CONFIG_RTE_BUILD_FPIC=y' config/common_linuxapp sed -ri '/CONFIG_RTE_LIBNAME/a CONFIG_RTE_BUILD_FPIC=y' config/common_linuxapp
sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk
make config CC=gcc T=x86_64-native-linuxapp-gcc make config CC=gcc T=x86_64-native-linuxapp-gcc
@@ -68,12 +69,14 @@ fi
if [ "$DPDK" ]; then if [ "$DPDK" ]; then
if [ -z "$DPDK_VER" ]; then if [ -z "$DPDK_VER" ]; then
DPDK_VER="1.8.0" DPDK_VER="2.0.0"
fi fi
install_dpdk $DPDK_VER install_dpdk $DPDK_VER
# Disregard bad function casts until DPDK is fixed if [ "$CC" = "clang" ]; then
CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align" # Disregard cast alignment errors until DPDK is fixed
EXTRA_OPTS+="--with-dpdk=./dpdk-$DPDK_VER/build" EXTRA_OPTS="$EXTRA_OPTS -Wno-cast-align"
fi
EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=./dpdk-$DPDK_VER/build"
elif [ "$CC" != "clang" ]; then elif [ "$CC" != "clang" ]; then
# DPDK headers currently trigger sparse errors # DPDK headers currently trigger sparse errors
SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error" SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"

View File

@@ -16,13 +16,13 @@ OVS needs a system with 1GB hugepages support.
Building and Installing: Building and Installing:
------------------------ ------------------------
Required DPDK 1.8.0, `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu) Required DPDK 2.0, `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu)
1. Configure build & install DPDK: 1. Configure build & install DPDK:
1. Set `$DPDK_DIR` 1. Set `$DPDK_DIR`
``` ```
export DPDK_DIR=/usr/src/dpdk-1.8.0 export DPDK_DIR=/usr/src/dpdk-2.0
cd $DPDK_DIR cd $DPDK_DIR
``` ```
@@ -32,9 +32,12 @@ Required DPDK 1.8.0, `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu)
`CONFIG_RTE_BUILD_COMBINE_LIBS=y` `CONFIG_RTE_BUILD_COMBINE_LIBS=y`
Update `config/common_linuxapp` so that DPDK is built with vhost Update `config/common_linuxapp` so that DPDK is built with vhost
libraries: libraries; currently, OVS only supports vhost-cuse, so DPDK vhost-user
libraries should be explicitly turned off (they are enabled by default
in DPDK 2.0).
`CONFIG_RTE_LIBRTE_VHOST=y` `CONFIG_RTE_LIBRTE_VHOST=y`
`CONFIG_RTE_LIBRTE_VHOST_USER=n`
Then run `make install` to build and install the library. Then run `make install` to build and install the library.
For default install without IVSHMEM: For default install without IVSHMEM:
@@ -65,10 +68,12 @@ Required DPDK 1.8.0, `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu)
``` ```
cd $(OVS_DIR)/openvswitch cd $(OVS_DIR)/openvswitch
./boot.sh ./boot.sh
./configure --with-dpdk=$DPDK_BUILD ./configure --with-dpdk=$DPDK_BUILD [CFLAGS="-g -O2 -Wno-cast-align"]
make make
``` ```
Note: 'clang' users may specify the '-Wno-cast-align' flag to suppress DPDK cast-align warnings.
To have better performance one can enable aggressive compiler optimizations and To have better performance one can enable aggressive compiler optimizations and
use the special instructions(popcnt, crc32) that may not be available on all use the special instructions(popcnt, crc32) that may not be available on all
machines. Instead of typing `make`, type: machines. Instead of typing `make`, type:

View File

@@ -205,7 +205,7 @@ AC_DEFUN([OVS_CHECK_DPDK], [
CFLAGS="$ovs_save_CFLAGS" CFLAGS="$ovs_save_CFLAGS"
LDFLAGS="$ovs_save_LDFLAGS" LDFLAGS="$ovs_save_LDFLAGS"
OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR" OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR"
OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE" OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE -mssse3"
# DPDK pmd drivers are not linked unless --whole-archive is used. # DPDK pmd drivers are not linked unless --whole-archive is used.
# #

View File

@@ -117,8 +117,7 @@ static const struct rte_eth_conf port_conf = {
.rx_adv_conf = { .rx_adv_conf = {
.rss_conf = { .rss_conf = {
.rss_key = NULL, .rss_key = NULL,
.rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6 .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP,
| ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP,
}, },
}, },
.txmode = { .txmode = {