[meta-intel] [meta-isg][fido][master][PATCH] meta-isg: dpdk: fix incorrect config fix-up patch and also tidy up dpdk.inc

chia.chuan.wu at intel.com chia.chuan.wu at intel.com
Mon Jul 27 04:14:05 PDT 2015


From: Ong Boon Leong <boon.leong.ong at intel.com>

This patch fixes issue in build configuration variables that were not correctly
parsed by do_configure() task. The environment variables introduced by below
patches, $(DPDK_TARGET_MACH) & $(CONFIG_VHOST_ENABLED) are not evaluated
because the config files under dpdk/config/ folder are not parsed by Makefile but
instead by cpp compiler.

 dpdk/dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch
 dpdk/dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch
 dpdk/dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch

Thanks to Anuj Mittal for detecting the issue above.

So, we fix the above issues by using sed command to fix-up the right values as follow

1) Override the value of CONFIG_RTE_MACHINE based on MACHINE_ARCH at
   config/defconfig_x86_64-native-linuxapp-gcc
   config/defconfig_i686-native-linuxapp-gcc

2) Override the value of CONFIG_RTE_KNI_VHOST, CONFIG_RTE_KNI_VHOST_VNET_HDR_EN and
   CONFIG_RTE_LIBRTE_VHOST based on PACKAGECONFIG[vhost] at
   config/common_linuxapp

Since we are here, we also take opportunity to tidy up dpdk.inc by integrating common
recipe from dpdk_1.8.0.bb & dpdpk_2.0.0.bb

Reported-by: Anuj Mittal <anujx.mittal at intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong at intel.com>
Tested-by: Wu Chia Chuan <chia.chuan.wu at intel.com>
Signed-off-by: Wu Chia Chuan <chia.chuan.wu at intel.com>
---
 meta-isg/common/recipes-extended/dpdk/dpdk.inc     | 29 +++++++++++++
 ....0-dpdk-defconfig-select-RTE_MACHINE-type.patch | 48 ---------------------
 ...ld-config-VHOST-in-common_linuxapp-config.patch | 43 -------------------
 ...T-and-ip_fragmentation-in-common_linuxapp.patch | 50 ----------------------
 .../common/recipes-extended/dpdk/dpdk_1.8.0.bb     | 22 ----------
 .../common/recipes-extended/dpdk/dpdk_2.0.0.bb     | 22 ----------
 6 files changed, 29 insertions(+), 185 deletions(-)
 delete mode 100644 meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch
 delete mode 100644 meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch
 delete mode 100644 meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch

diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk.inc b/meta-isg/common/recipes-extended/dpdk/dpdk.inc
index 85b88fa..3106959 100644
--- a/meta-isg/common/recipes-extended/dpdk/dpdk.inc
+++ b/meta-isg/common/recipes-extended/dpdk/dpdk.inc
@@ -3,6 +3,26 @@ HOMEPAGE = "http://dpdk.org"
 LICENSE = "BSD & LGPLv2 & GPLv2"
 LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe"
 
+SRC_URI = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \
+	   file://dpdk-1.8.0-and-2.0.0-examples-add-config-variable-to-enable-disable-dpdk.patch \
+	   file://dpdk-1.8.0-and-2.0.0-add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
+	   file://dpdk-1.8.0-and-2.0.0-add-sysroot-option-within-app-makefile.patch \
+	  "
+
+# dpdk example apps dpdk_qat and vhost have dependancy on fuse and qat.
+# fuse is in meta-filesystems and qat is not yet upstreamed.
+# So adding mechanism to explicitly disable the use of fuse and qat.
+# To enable, uncomment the below line or include in .bbappend.
+# PACKAGECONFIG ?= " dpdk_qat vhost libvirt"
+
+PACKAGECONFIG[dpdk_qat] = ",,qat"
+PACKAGECONFIG[vhost] = ",,fuse"
+PACKAGECONFIG[libvirt] = ",,libvirt"
+
+export CONFIG_EXAMPLE_DPDK_QAT = "${@base_contains('PACKAGECONFIG', 'dpdk_qat', 'y', 'n', d)}"
+export CONFIG_EXAMPLE_VM_POWER_MANAGER = "${@base_contains('PACKAGECONFIG', 'libvirt', 'y', 'n', d)}"
+export CONFIG_VHOST_ENABLED = "${@base_contains('PACKAGECONFIG', 'vhost', 'y', 'n', d)}"
+
 RDEPENDS_${PN} += "python-subprocess"
 DEPENDS = "virtual/kernel"
 do_configure[depends] += "virtual/kernel:do_shared_workdir"
@@ -46,6 +66,15 @@ do_configure () {
 	#############################################################
 	unset prefix
 
+	# Fix-up CONFIG_RTE_MACHINE based on target machine
+	sed -e "s#CONFIG_RTE_MACHINE=\"native\"#CONFIG_RTE_MACHINE=\"${DPDK_TARGET_MACH}\"#" -i ${S}/config/defconfig_x86_64-native-linuxapp-gcc
+	sed -e "s#CONFIG_RTE_MACHINE=\"native\"#CONFIG_RTE_MACHINE=\"${DPDK_TARGET_MACH}\"#" -i ${S}/config/defconfig_i686-native-linuxapp-gcc
+
+	# Fix-up vhost configs based on package config
+	sed -e "s#CONFIG_RTE_KNI_VHOST=n#CONFIG_RTE_KNI_VHOST=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linuxapp
+	sed -e "s#CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n#CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linuxapp
+	sed -e "s#CONFIG_RTE_LIBRTE_VHOST=n#CONFIG_RTE_LIBRTE_VHOST=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linuxapp
+
 	make O=$RTE_TARGET T=$RTE_TARGET config
 }
 
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch
deleted file mode 100644
index 979541e..0000000
--- a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 6eaf6b1a61321acb824f9672c12d0e30a2110f52 Mon Sep 17 00:00:00 2001
-From: Ong Boon Leong <boon.leong.ong at intel.com>
-Date: Mon, 16 Mar 2015 11:10:43 +0800
-Subject: [PATCH] DPDK: defconfig: add selectable RTE_MACHINE option
-
-In order to make sure that DPDK build environment config can handle the
-package being built on different build machine for different target machine
-which will have different x86 architecture intrinsics than the build machine,
-we introduce DPDK_TARGET_MACH to be tunable from dpdk recipe. The machine
-type can be under mk/machine folder.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Ong Boon Leong <boon.leong.ong at intel.com>
----
- config/defconfig_i686-native-linuxapp-gcc   |    2 +-
- config/defconfig_x86_64-native-linuxapp-gcc |    2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/config/defconfig_i686-native-linuxapp-gcc b/config/defconfig_i686-native-linuxapp-gcc
-index a90de9b..c9a74a5 100644
---- a/config/defconfig_i686-native-linuxapp-gcc
-+++ b/config/defconfig_i686-native-linuxapp-gcc
-@@ -32,7 +32,7 @@
- 
- #include "common_linuxapp"
- 
--CONFIG_RTE_MACHINE="native"
-+CONFIG_RTE_MACHINE=$(DPDK_TARGET_MACH)
- 
- CONFIG_RTE_ARCH="i686"
- CONFIG_RTE_ARCH_I686=y
-diff --git a/config/defconfig_x86_64-native-linuxapp-gcc b/config/defconfig_x86_64-native-linuxapp-gcc
-index 60baf5b..0e4802d 100644
---- a/config/defconfig_x86_64-native-linuxapp-gcc
-+++ b/config/defconfig_x86_64-native-linuxapp-gcc
-@@ -32,7 +32,7 @@
- 
- #include "common_linuxapp"
- 
--CONFIG_RTE_MACHINE="native"
-+CONFIG_RTE_MACHINE=$(DPDK_TARGET_MACH)
- 
- CONFIG_RTE_ARCH="x86_64"
- CONFIG_RTE_ARCH_X86_64=y
--- 
-1.7.9.5
-
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch
deleted file mode 100644
index e8ded8d..0000000
--- a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From c1a59d62f2aa7656060d8ebcc8e45e852d931ff1 Mon Sep 17 00:00:00 2001
-From: Ong Boon Leong <boon.leong.ong at intel.com>
-Date: Tue, 17 Feb 2015 00:23:12 +0800
-Subject: [PATCH] dpdk: enable VHOST build config in common_linuxapp config
-
-Introduce CONFIG_VHOST_ENABLED for package config selection purpose in
-building vhost feature.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Ong Boon Leong <boon.leong.ong at intel.com>
----
- config/common_linuxapp |    6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/config/common_linuxapp b/config/common_linuxapp
-index 2f9643b..67f5edb 100644
---- a/config/common_linuxapp
-+++ b/config/common_linuxapp
-@@ -361,9 +361,9 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
- #
- CONFIG_RTE_LIBRTE_KNI=y
- CONFIG_RTE_KNI_KO_DEBUG=n
--CONFIG_RTE_KNI_VHOST=n
-+CONFIG_RTE_KNI_VHOST=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
--CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n
-+CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_KNI_VHOST_DEBUG_RX=n
- CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
- 
-@@ -372,7 +372,7 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
- # fuse-devel is needed to run vhost.
- # fuse-devel enables user space char driver development
- #
--CONFIG_RTE_LIBRTE_VHOST=n
-+CONFIG_RTE_LIBRTE_VHOST=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_LIBRTE_VHOST_DEBUG=n
- 
- #
--- 
-1.7.9.5
-
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch
deleted file mode 100644
index 45ce5e0..0000000
--- a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 3d3c03d947394696565b3bb7bed8c900de057a28 Mon Sep 17 00:00:00 2001
-From: WU CHIA CHUAN <chia.chuan.wu at intel.com>
-Date: Thu, 2 Jul 2015 15:59:18 +0800
-Subject: [PATCH] dpdk enable VHOST and ip_fragmentation in common_linuxapp config
-
-Introduce CONFIG_VHOST_ENABLED for package config selection purpose in
-building vhost feature.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: WU CHIA CHUAN <chia.chuan.wu at intel.com>
----
- config/common_linuxapp |   11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/config/common_linuxapp b/config/common_linuxapp
-index 0b25f34..000f950 100644
---- a/config/common_linuxapp
-+++ b/config/common_linuxapp
-@@ -406,19 +406,24 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
- CONFIG_RTE_LIBRTE_KNI=y
- CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
- CONFIG_RTE_KNI_KO_DEBUG=n
--CONFIG_RTE_KNI_VHOST=n
-+CONFIG_RTE_KNI_VHOST=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
--CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n
-+CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_KNI_VHOST_DEBUG_RX=n
- CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
- 
- #
-+# Compile ip_fragmentation
-+#
-+CONFIG_RTE_IP_FRAG=y
-+
-+#
- # Compile vhost library
- # fuse-devel is needed to run vhost-cuse.
- # fuse-devel enables user space char driver development
- # vhost-user is turned on by default.
- #
--CONFIG_RTE_LIBRTE_VHOST=n
-+CONFIG_RTE_LIBRTE_VHOST=$(CONFIG_VHOST_ENABLED)
- CONFIG_RTE_LIBRTE_VHOST_USER=y
- CONFIG_RTE_LIBRTE_VHOST_DEBUG=n
- 
--- 
-1.7.9.5
-
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk_1.8.0.bb b/meta-isg/common/recipes-extended/dpdk/dpdk_1.8.0.bb
index 5265a9c..b1a3aea 100644
--- a/meta-isg/common/recipes-extended/dpdk/dpdk_1.8.0.bb
+++ b/meta-isg/common/recipes-extended/dpdk/dpdk_1.8.0.bb
@@ -1,33 +1,11 @@
 include dpdk.inc
 
-SRC_URI = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \
-	   file://dpdk-1.8.0-dpdk-enable-build-config-VHOST-in-common_linuxapp-config.patch \
-	   file://dpdk-1.8.0-and-2.0.0-examples-add-config-variable-to-enable-disable-dpdk.patch \
-	   file://dpdk-1.8.0-and-2.0.0-add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
-	   file://dpdk-1.8.0-and-2.0.0-add-sysroot-option-within-app-makefile.patch \
-	   file://dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch \
-	   "
-
 SRC_URI[dpdk.md5sum] = "11ad8785aaa869cc87265bcb8d828f22"
 SRC_URI[dpdk.sha256sum] = "9f5386830bd999355182e20408f3fc2cfa0802a4497fdded8d43202feede1939"
 
 export EXAMPLES_BUILD_DIR = "${RTE_TARGET}"
 export ARCHDIR = "generic"
 
-# dpdk example apps dpdk_qat and vhost have dependancy on fuse and qat.
-# fuse is in meta-filesystems and qat is not yet upstreamed.
-# So adding mechanism to explicitly disable the use of fuse and qat.
-# To enable, uncomment the below line or include in .bbappend.
-# PACKAGECONFIG ?= " dpdk_qat vhost libvirt"
-
-PACKAGECONFIG[dpdk_qat] = ",,qat"
-PACKAGECONFIG[vhost] = ",,fuse"
-PACKAGECONFIG[libvirt] = ",,libvirt"
-
-export CONFIG_EXAMPLE_DPDK_QAT = "${@base_contains('PACKAGECONFIG', 'dpdk_qat', 'y', 'n', d)}"
-export CONFIG_EXAMPLE_VM_POWER_MANAGER = "${@base_contains('PACKAGECONFIG', 'libvirt', 'y', 'n', d)}"
-export CONFIG_VHOST_ENABLED = "${@base_contains('PACKAGECONFIG', 'vhost', 'y', 'n', d)}"
-
 do_install_append () {
 
 	install -m 0755 -d ${D}/${INSTALL_PATH}/${RTE_TARGET}/hostapp
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk_2.0.0.bb b/meta-isg/common/recipes-extended/dpdk/dpdk_2.0.0.bb
index cb158b9..0e9350b 100644
--- a/meta-isg/common/recipes-extended/dpdk/dpdk_2.0.0.bb
+++ b/meta-isg/common/recipes-extended/dpdk/dpdk_2.0.0.bb
@@ -1,29 +1,7 @@
 include dpdk.inc
 
-SRC_URI = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \
-	   file://dpdk-2.0.0-dpdk-enable-VHOST-and-ip_fragmentation-in-common_linuxapp.patch \
-	   file://dpdk-1.8.0-and-2.0.0-examples-add-config-variable-to-enable-disable-dpdk.patch \
-	   file://dpdk-1.8.0-and-2.0.0-add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
-	   file://dpdk-1.8.0-and-2.0.0-add-sysroot-option-within-app-makefile.patch \
-	   file://dpdk-1.8.0-and-2.0.0-dpdk-defconfig-select-RTE_MACHINE-type.patch \
-	   "
-
 SRC_URI[dpdk.md5sum] = "e9e7935c9eec920841ad373949514934"
 SRC_URI[dpdk.sha256sum] = "643789a3be5ba44dd84d6b248cdf5471b260f8736dada177dadf076aebfbff3f"
 
 export EXAMPLES_BUILD_DIR = "${RTE_TARGET}"
 export ARCHDIR = "generic"
-
-# dpdk example apps dpdk_qat and vhost have dependancy on fuse and qat.
-# fuse is in meta-filesystems and qat is not yet upstreamed.
-# So adding mechanism to explicitly disable the use of fuse and qat.
-# To enable, uncomment the below line or include in .bbappend.
-# PACKAGECONFIG ?= " dpdk_qat vhost libvirt"
-
-PACKAGECONFIG[dpdk_qat] = ",,qat"
-PACKAGECONFIG[vhost] = ",,fuse"
-PACKAGECONFIG[libvirt] = ",,libvirt"
-
-export CONFIG_EXAMPLE_DPDK_QAT = "${@base_contains('PACKAGECONFIG', 'dpdk_qat', 'y', 'n', d)}"
-export CONFIG_EXAMPLE_VM_POWER_MANAGER = "${@base_contains('PACKAGECONFIG', 'libvirt', 'y', 'n', d)}"
-export CONFIG_VHOST_ENABLED = "${@base_contains('PACKAGECONFIG', 'vhost', 'y', 'n', d)}"
-- 
1.9.1



More information about the meta-intel mailing list