From 988112868ca21622c522807e0a72718f51420488 Mon Sep 17 00:00:00 2001 From: Matt Peters Date: Fri, 10 Aug 2018 09:39:42 -0500 Subject: [PATCH] Enable Mellanox PMDs in ovs-dpdk build The Mellanox devices are not currently supported by ovs-dpdk since they are not built into the set of PMDs enabled. Due to external build dependencies, the default DPDK configuration sets them to disabled. This update enables the mlx4 and mlx5 PMDs and adds the necessary build dependencies to the openvswitch.spec file to properly build and link the Mellanox PMDs. Story: 2003104 Task: 23218 Change-Id: I9048b1b39e279261622f5add02c6642fab21e532 Signed-off-by: Matt Peters --- networking/openvswitch/centos/build_srpm.data | 2 +- .../meta_patches/0007-enable-mlx-pmds.patch | 45 +++++++++++++++++++ .../centos/meta_patches/PATCH_ORDER | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 networking/openvswitch/centos/meta_patches/0007-enable-mlx-pmds.patch diff --git a/networking/openvswitch/centos/build_srpm.data b/networking/openvswitch/centos/build_srpm.data index 6e36f5d7f..b98158431 100644 --- a/networking/openvswitch/centos/build_srpm.data +++ b/networking/openvswitch/centos/build_srpm.data @@ -1,3 +1,3 @@ COPY_LIST="files/*" -TIS_PATCH_VER=0 +TIS_PATCH_VER=1 BUILD_IS_SLOW=12 diff --git a/networking/openvswitch/centos/meta_patches/0007-enable-mlx-pmds.patch b/networking/openvswitch/centos/meta_patches/0007-enable-mlx-pmds.patch new file mode 100644 index 000000000..a20174ede --- /dev/null +++ b/networking/openvswitch/centos/meta_patches/0007-enable-mlx-pmds.patch @@ -0,0 +1,45 @@ +diff --git a/SOURCES/x86_64-native-linuxapp-gcc-config b/SOURCES/x86_64-native-linuxapp-gcc-config +index f81d420..eab161c 100644 +--- a/SOURCES/x86_64-native-linuxapp-gcc-config ++++ b/SOURCES/x86_64-native-linuxapp-gcc-config +@@ -197,12 +197,12 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=n + CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y + CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y + # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD +-CONFIG_RTE_LIBRTE_MLX4_PMD=n ++CONFIG_RTE_LIBRTE_MLX4_PMD=y + CONFIG_RTE_LIBRTE_MLX4_DEBUG=n + CONFIG_RTE_LIBRTE_MLX4_DEBUG_BROKEN_VERBS=n + CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8 + # Compile burst-oriented Mellanox ConnectX-4 & ConnectX-5 (MLX5) PMD +-CONFIG_RTE_LIBRTE_MLX5_PMD=n ++CONFIG_RTE_LIBRTE_MLX5_PMD=y + CONFIG_RTE_LIBRTE_MLX5_DEBUG=n + CONFIG_RTE_LIBRTE_MLX5_TX_MP_CACHE=8 + # Compile burst-oriented Broadcom PMD driver +diff --git a/SPECS/openvswitch.spec b/SPECS/openvswitch.spec +index 29255d5..f392e95 100644 +--- a/SPECS/openvswitch.spec ++++ b/SPECS/openvswitch.spec +@@ -155,6 +155,7 @@ BuildRequires: libcap-ng libcap-ng-devel + %ifarch %{dpdkarches} + # DPDK driver dependencies + BuildRequires: zlib-devel libpcap-devel numactl-devel ++BuildRequires: rdma-core-devel + Requires: python-pyelftools + + # Virtual provide for depending on DPDK-enabled OVS +@@ -356,7 +357,12 @@ cd - + --dpdk \ + < rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \ + > rhel/usr_lib_systemd_system_ovs-vswitchd.service +-make %{?_smp_mflags} ++make %{?_smp_mflags} \ ++%if %{with dpdk} ++%ifarch %{dpdkarches} ++ LDFLAGS="-libverbs -lmlx4 -lmlx5" ++%endif ++%endif + + %install + rm -rf $RPM_BUILD_ROOT diff --git a/networking/openvswitch/centos/meta_patches/PATCH_ORDER b/networking/openvswitch/centos/meta_patches/PATCH_ORDER index 12dcf854c..1c6551c98 100644 --- a/networking/openvswitch/centos/meta_patches/PATCH_ORDER +++ b/networking/openvswitch/centos/meta_patches/PATCH_ORDER @@ -4,3 +4,4 @@ 0004-add-pmon-conf-files.patch 0005-log-rotation-config.patch 0006-rpm-check-with-condition.patch +0007-enable-mlx-pmds.patch