[ovs-dev] [PATCH] DPDK: add support for v2.0.0

Daniele Di Proietto diproiettod at vmware.com
Wed Apr 8 17:15:42 UTC 2015


Thanks for the patch, I’m looking forward to use new
DPDK 2.0 features!

I have some doubts about the required -mssse3 option.
The main point is: does DPDK always requires a CPU
with SSSE3?

I believe the answer is yes (Please correct me if I’m wrong).
If CONFIG_RTE_MACHINE is set to “default", MACHINE_CFLAGS are
set to ‘-march=core2’ in mk/machine/default/rte.vars.mk.
If I remove -march=core2, rte_memcpy.h fails to compile.
(I’m using GCC 4.9.1 from Debian testing)

If this is the case (DPDK requires at least a core2 CPU, which
should support SSSE3 extension according to
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html),
I would prefer adding the ‘-mssse3’ option to OVS_CFLAGS in
OVS_CHECK_DPDK (acinclude.m4)


Last thing: on my system, clang (3.5.0) still needs
-Wno-error=cast-align to compile rte_memcpy.h.

What do you think?

Daniele

> On 8 Apr 2015, at 16:34, Mark Kavanagh <mark.b.kavanagh at intel.com> wrote:
> 
> Update relevant artifacts to add support for DPDK v2.0.0
> - INSTALL.DPDK.md
> - travis build script
> - 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 at intel.com>
> Signed-off-by: Panu Matilainen <pmatilai at redhat.com>
> ---
> .travis/build.sh  |    6 +++---
> INSTALL.DPDK.md   |   10 +++++++---
> lib/netdev-dpdk.c |    3 +--
> 3 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/.travis/build.sh b/.travis/build.sh
> index b6b701c..b6fe0eb 100755
> --- a/.travis/build.sh
> +++ b/.travis/build.sh
> @@ -68,11 +68,11 @@ fi
> 
> if [ "$DPDK" ]; then
>     if [ -z "$DPDK_VER" ]; then
> -	    DPDK_VER="1.8.0"
> +        DPDK_VER="2.0.0"
>     fi
>     install_dpdk $DPDK_VER
> -    # Disregard bad function casts until DPDK is fixed
> -    CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
> +    # Support older versions of GCC
> +    CFLAGS="-mssse3"
>     EXTRA_OPTS+="--with-dpdk=./dpdk-$DPDK_VER/build"
> elif [ $CC != "clang" ]; then
>     # DPDK headers currently trigger sparse errors
> diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
> index 60889d0..8e6f6af 100644
> --- a/INSTALL.DPDK.md
> +++ b/INSTALL.DPDK.md
> @@ -16,13 +16,13 @@ OVS needs a system with 1GB hugepages support.
> 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. Set `$DPDK_DIR`
> 
>      ```
> -     export DPDK_DIR=/usr/src/dpdk-1.8.0
> +     export DPDK_DIR=/usr/src/dpdk-2.0
>      cd $DPDK_DIR
>      ```
> 
> @@ -66,8 +66,12 @@ Required DPDK 1.8.0, `fuse`, `fuse-devel` (`libfuse-dev` on Debian/Ubuntu)
>    cd $(OVS_DIR)/openvswitch
>    ./boot.sh
>    ./configure --with-dpdk=$DPDK_BUILD
> -   make
> +   make [CFLAGS="-g -O2 -mssse3"]
>    ```
> +Note that users of older versions of GCC  must pass additional CFLAGS
> +("-g -O2 -mssse3") to 'make'. This issue has been observed with GCC versions
> +<= 4.8.3, and is not present in GCC v4.9.2 - applicability to interim versions is
> +untested.
> 
> To have better performance one can enable aggressive compiler optimizations and
> use the special instructions(popcnt, crc32) that may not be available on all
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index f69154b..5ab119a 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -117,8 +117,7 @@ static const struct rte_eth_conf port_conf = {
>     .rx_adv_conf = {
>         .rss_conf = {
>             .rss_key = NULL,
> -            .rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6
> -                    | ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP,
> +            .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP,
>         },
>     },
>     .txmode = {
> -- 
> 1.7.4.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_dev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=SmB5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=b6TCcALkXJRwrk15b5jrDqbBpGEWbDBxnXBSKdAYnjo&s=cHDYfYnLsmOAsNIfukJ5AjjEtU6JOjTPX-tyPT7-4kY&e= 




More information about the dev mailing list