diff options
| author | Anuj Mittal <anujx.mittal@intel.com> | 2015-10-08 23:50:01 +0800 |
|---|---|---|
| committer | Saul Wold <sgw@linux.intel.com> | 2015-10-19 08:46:09 -0700 |
| commit | cd5d22bb686a062e6df9ad09935f60f57dd6657b (patch) | |
| tree | c91c1ca3ffaf42cc4173f58309c11041576522d6 | |
| parent | 723b2078aec8382b52d47bcb4bcc633b8e73aca9 (diff) | |
| download | meta-intel-cd5d22bb686a062e6df9ad09935f60f57dd6657b.tar.gz | |
meta-isg: dpdk: fix v1.8.0 build with kernel 4.1
Backported fixes from upstream dpdk sources to
ensure dpdk 1.8.0 compiles against kernel 4.1.
Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
3 files changed, 232 insertions, 1 deletions
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-kni-fix-build-with-kernel-3.19.patch b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-kni-fix-build-with-kernel-3.19.patch new file mode 100644 index 00000000..014fc63b --- /dev/null +++ b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-kni-fix-build-with-kernel-3.19.patch | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | From 4e6326ae5375d55966a5c872f391cf99de373057 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 3 | Date: Sun, 22 Mar 2015 18:02:16 +0000 | ||
| 4 | Subject: [PATCH] kni: fix build with kernel 3.19 | ||
| 5 | |||
| 6 | Upstream-Status: Backport [2.1.0] | ||
| 7 | |||
| 8 | Due to API changes in functions ndo_dflt_bridge_getlink | ||
| 9 | (commit 2c3c031c) and ndo_fdb_add (commit f6f6424b) | ||
| 10 | in kernel 3.19, DPDK would not build. | ||
| 11 | |||
| 12 | This patch solves the problem, by checking the kernel version | ||
| 13 | and adding the necessary new parameters. | ||
| 14 | |||
| 15 | Mind that function igb_ndo_fdb_add does not need the extra parameter | ||
| 16 | if USE_CONST_DEV_UC_CHAR is not set, since that macro is only defined | ||
| 17 | when kernel is greater or equal than 3.7 | ||
| 18 | |||
| 19 | Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 20 | Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 21 | (cherry picked from commit 98f255ed0a4a73bf785e884dc2069405de840546) | ||
| 22 | Signed-off-by: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com> | ||
| 23 | --- | ||
| 24 | lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ | ||
| 25 | lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ | ||
| 26 | 2 files changed, 11 insertions(+) | ||
| 27 | |||
| 28 | diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | ||
| 29 | index a802a02..24b147d 100644 | ||
| 30 | --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | ||
| 31 | +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | ||
| 32 | @@ -2103,6 +2103,9 @@ static int igb_set_features(struct net_device *netdev, | ||
| 33 | static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | ||
| 34 | struct net_device *dev, | ||
| 35 | const unsigned char *addr, | ||
| 36 | +#ifdef HAVE_NDO_FDB_ADD_VID | ||
| 37 | + u16 vid, | ||
| 38 | +#endif | ||
| 39 | u16 flags) | ||
| 40 | #else | ||
| 41 | static int igb_ndo_fdb_add(struct ndmsg *ndm, | ||
| 42 | @@ -2259,7 +2262,11 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | ||
| 43 | else | ||
| 44 | mode = BRIDGE_MODE_VEPA; | ||
| 45 | |||
| 46 | +#ifdef HAVE_NDO_FDB_ADD_VID | ||
| 47 | + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); | ||
| 48 | +#else | ||
| 49 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); | ||
| 50 | +#endif /* HAVE_NDO_FDB_ADD_VID */ | ||
| 51 | } | ||
| 52 | #endif /* HAVE_BRIDGE_ATTRIBS */ | ||
| 53 | #endif /* NTF_SELF */ | ||
| 54 | diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | ||
| 55 | index 1213cc6..2e7e714 100644 | ||
| 56 | --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | ||
| 57 | +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | ||
| 58 | @@ -3881,4 +3881,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) | ||
| 59 | #define HAVE_VF_MIN_MAX_TXRATE 1 | ||
| 60 | #endif /* >= 3.16.0 */ | ||
| 61 | |||
| 62 | +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) ) | ||
| 63 | +#define HAVE_NDO_FDB_ADD_VID | ||
| 64 | +#endif /* >= 3.19.0 */ | ||
| 65 | + | ||
| 66 | #endif /* _KCOMPAT_H_ */ | ||
| 67 | -- | ||
| 68 | 1.9.1 | ||
| 69 | |||
diff --git a/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-mk-rework-gcc-version-detection-to-permit-versions-n.patch b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-mk-rework-gcc-version-detection-to-permit-versions-n.patch new file mode 100644 index 00000000..9bd0b66b --- /dev/null +++ b/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-1.8.0-mk-rework-gcc-version-detection-to-permit-versions-n.patch | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | From ccb0f3b60c1ec84a97698d9699a4b7e5cf074b21 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Panu Matilainen <pmatilai@redhat.com> | ||
| 3 | Date: Mon, 23 Feb 2015 16:53:56 +0200 | ||
| 4 | Subject: [PATCH] mk: rework gcc version detection to permit versions newer | ||
| 5 | than 4.x | ||
| 6 | |||
| 7 | Upstream-Status: Backport [2.1.0] | ||
| 8 | |||
| 9 | Separately comparing major and minor versions becomes seriously clumsy | ||
| 10 | when with major version changes, convert the entire version string into | ||
| 11 | a numeric value (ie 4.6.0 becomes 460 and 5.0.0 becomes 500) and use | ||
| 12 | that for comparisons, eliminate unnecessary negations while at it. | ||
| 13 | This makes the comparisons simpler, more obvious and makes gcc 5.0 | ||
| 14 | naturally recognized at least as capable as newest 4.x. | ||
| 15 | |||
| 16 | This three-digit scheme would run into trouble if gcc ever went to | ||
| 17 | two-digit version segments, but that hasn't happened in the last 10+ | ||
| 18 | years so it seems like a safe assumption. | ||
| 19 | |||
| 20 | Signed-off-by: Panu Matilainen <pmatilai@redhat.com> | ||
| 21 | Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 22 | (cherry picked from commit 71f0ab1849b4fc3ca928deb566df12ca725ed150) | ||
| 23 | Signed-off-by: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com> | ||
| 24 | |||
| 25 | Conflicts: | ||
| 26 | lib/librte_pmd_fm10k/Makefile | ||
| 27 | Makefile part of fm10k feature enabled as part of | ||
| 28 | commit a6061d9e7075b5457a9234117d75a2c05227457d which we ae not | ||
| 29 | backporting. Makefile changes not taken. | ||
| 30 | --- | ||
| 31 | lib/librte_pmd_i40e/Makefile | 2 +- | ||
| 32 | lib/librte_pmd_ixgbe/Makefile | 6 +++--- | ||
| 33 | lib/librte_pmd_vmxnet3/Makefile | 2 +- | ||
| 34 | mk/toolchain/gcc/rte.toolchain-compat.mk | 22 ++++++++++------------ | ||
| 35 | 4 files changed, 15 insertions(+), 17 deletions(-) | ||
| 36 | |||
| 37 | diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile | ||
| 38 | index 98e4bdf..61c3675 100644 | ||
| 39 | --- a/lib/librte_pmd_i40e/Makefile | ||
| 40 | +++ b/lib/librte_pmd_i40e/Makefile | ||
| 41 | @@ -65,7 +65,7 @@ CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast | ||
| 42 | CFLAGS_BASE_DRIVER += -Wno-format-nonliteral | ||
| 43 | CFLAGS_BASE_DRIVER += -Wno-format-security | ||
| 44 | |||
| 45 | -ifeq ($(shell test $(GCC_MAJOR_VERSION) -ge 4 -a $(GCC_MINOR_VERSION) -ge 4 && echo 1), 1) | ||
| 46 | +ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) | ||
| 47 | CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable | ||
| 48 | endif | ||
| 49 | |||
| 50 | diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile | ||
| 51 | index 3588047..592fe74 100644 | ||
| 52 | --- a/lib/librte_pmd_ixgbe/Makefile | ||
| 53 | +++ b/lib/librte_pmd_ixgbe/Makefile | ||
| 54 | @@ -56,18 +56,18 @@ else | ||
| 55 | # | ||
| 56 | # CFLAGS for gcc | ||
| 57 | # | ||
| 58 | -ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1) | ||
| 59 | +ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) | ||
| 60 | CFLAGS += -Wno-deprecated | ||
| 61 | endif | ||
| 62 | CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value | ||
| 63 | CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args | ||
| 64 | |||
| 65 | -ifeq ($(shell test $(GCC_MAJOR_VERSION) -ge 4 -a $(GCC_MINOR_VERSION) -ge 6 && echo 1), 1) | ||
| 66 | +ifeq ($(shell test $(GCC_VERSION) -ge 460 && echo 1), 1) | ||
| 67 | CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable | ||
| 68 | CFLAGS_ixgbe_x550.o += -Wno-unused-but-set-variable -Wno-maybe-uninitialized | ||
| 69 | endif | ||
| 70 | |||
| 71 | -ifeq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 6 && echo 1), 1) | ||
| 72 | +ifeq ($(shell test $(GCC_VERSION) -le 460 && echo 1), 1) | ||
| 73 | CFLAGS_ixgbe_x550.o += -Wno-uninitialized | ||
| 74 | CFLAGS_ixgbe_phy.o += -Wno-uninitialized | ||
| 75 | endif | ||
| 76 | diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile | ||
| 77 | index 6872c74..3b7674e 100644 | ||
| 78 | --- a/lib/librte_pmd_vmxnet3/Makefile | ||
| 79 | +++ b/lib/librte_pmd_vmxnet3/Makefile | ||
| 80 | @@ -56,7 +56,7 @@ else | ||
| 81 | # | ||
| 82 | # CFLAGS for gcc | ||
| 83 | # | ||
| 84 | -ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1) | ||
| 85 | +ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1) | ||
| 86 | CFLAGS += -Wno-deprecated | ||
| 87 | endif | ||
| 88 | CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value | ||
| 89 | diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/rte.toolchain-compat.mk | ||
| 90 | index e40e103..a867559 100644 | ||
| 91 | --- a/mk/toolchain/gcc/rte.toolchain-compat.mk | ||
| 92 | +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk | ||
| 93 | @@ -38,17 +38,15 @@ | ||
| 94 | |||
| 95 | #find out GCC version | ||
| 96 | |||
| 97 | -GCC_MAJOR_VERSION = $(shell $(CC) -dumpversion | cut -f1 -d.) | ||
| 98 | +GCC_VERSION = $(subst .,,$(shell $(CC) -dumpversion)) | ||
| 99 | |||
| 100 | -# if GCC is not 4.x | ||
| 101 | -ifneq ($(GCC_MAJOR_VERSION),4) | ||
| 102 | +# if GCC is older than 4.x | ||
| 103 | +ifeq ($(shell test $(GCC_VERSION) -lt 400 && echo 1), 1) | ||
| 104 | MACHINE_CFLAGS = | ||
| 105 | -$(warning You are not using GCC 4.x. This is neither supported, nor tested.) | ||
| 106 | +$(warning You are using GCC < 4.x. This is neither supported, nor tested.) | ||
| 107 | |||
| 108 | |||
| 109 | else | ||
| 110 | - GCC_MINOR_VERSION = $(shell $(CC) -dumpversion | cut -f2 -d.) | ||
| 111 | - | ||
| 112 | # GCC graceful degradation | ||
| 113 | # GCC 4.2.x - added support for generic target | ||
| 114 | # GCC 4.3.x - added support for core2, ssse3, sse4.1, sse4.2 | ||
| 115 | @@ -57,18 +55,18 @@ else | ||
| 116 | # GCC 4.6.x - added support for corei7, corei7-avx | ||
| 117 | # GCC 4.7.x - added support for fsgsbase, rdrnd, f16c, core-avx-i, core-avx2 | ||
| 118 | |||
| 119 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -le 7 && echo 1), 1) | ||
| 120 | + ifeq ($(shell test $(GCC_VERSION) -le 470 && echo 1), 1) | ||
| 121 | MACHINE_CFLAGS := $(patsubst -march=core-avx-i,-march=corei7-avx,$(MACHINE_CFLAGS)) | ||
| 122 | MACHINE_CFLAGS := $(patsubst -march=core-avx2,-march=core-avx2,$(MACHINE_CFLAGS)) | ||
| 123 | endif | ||
| 124 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 6 && echo 1), 1) | ||
| 125 | + ifeq ($(shell test $(GCC_VERSION) -lt 460 && echo 1), 1) | ||
| 126 | MACHINE_CFLAGS := $(patsubst -march=corei7-avx,-march=core2 -maes -mpclmul -mavx,$(MACHINE_CFLAGS)) | ||
| 127 | MACHINE_CFLAGS := $(patsubst -march=corei7,-march=core2 -maes -mpclmul,$(MACHINE_CFLAGS)) | ||
| 128 | endif | ||
| 129 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 5 && echo 1), 1) | ||
| 130 | + ifeq ($(shell test $(GCC_VERSION) -lt 450 && echo 1), 1) | ||
| 131 | MACHINE_CFLAGS := $(patsubst -march=atom,-march=core2 -mssse3,$(MACHINE_CFLAGS)) | ||
| 132 | endif | ||
| 133 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 4 && echo 1), 1) | ||
| 134 | + ifeq ($(shell test $(GCC_VERSION) -lt 440 && echo 1), 1) | ||
| 135 | MACHINE_CFLAGS := $(filter-out -mavx -mpclmul -maes,$(MACHINE_CFLAGS)) | ||
| 136 | ifneq ($(findstring SSE4_2, $(CPUFLAGS)),) | ||
| 137 | MACHINE_CFLAGS += -msse4.2 | ||
| 138 | @@ -77,12 +75,12 @@ else | ||
| 139 | MACHINE_CFLAGS += -msse4.1 | ||
| 140 | endif | ||
| 141 | endif | ||
| 142 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 3 && echo 1), 1) | ||
| 143 | + ifeq ($(shell test $(GCC_VERSION) -lt 430 && echo 1), 1) | ||
| 144 | MACHINE_CFLAGS := $(filter-out -msse% -mssse%,$(MACHINE_CFLAGS)) | ||
| 145 | MACHINE_CFLAGS := $(patsubst -march=core2,-march=generic,$(MACHINE_CFLAGS)) | ||
| 146 | MACHINE_CFLAGS += -msse3 | ||
| 147 | endif | ||
| 148 | - ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 2 && echo 1), 1) | ||
| 149 | + ifeq ($(shell test $(GCC_VERSION) -lt 420 && echo 1), 1) | ||
| 150 | MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS)) | ||
| 151 | endif | ||
| 152 | endif | ||
| 153 | -- | ||
| 154 | 1.9.1 | ||
| 155 | |||
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 a6b2aed6..82f801e8 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,6 +1,13 @@ | |||
| 1 | include dpdk.inc | 1 | include dpdk.inc |
| 2 | 2 | ||
| 3 | SRC_URI += "file://dpdk-1.8.0-and-2.0.0-examples-add-config-variable-to-enable-disable-dpdk.patch" | 3 | SRC_URI += "file://dpdk-1.8.0-and-2.0.0-examples-add-config-variable-to-enable-disable-dpdk.patch \ |
| 4 | file://dpdk-1.8.0-and-2.0.0-ixgbe-fix-a-build-warning-being-treated-as-error.patch \ | ||
| 5 | file://dpdk-1.8.0-kni-fix-build-with-kernel-3.19.patch \ | ||
| 6 | file://dpdk-2.0.0-kni-fix-build-with-kernel-4.0.patch \ | ||
| 7 | file://dpdk-2.0.0-kni-fix-igb-build-with-kernel-4.1.patch \ | ||
| 8 | file://dpdk-2.0.0-kni-net-fix-build-with-kernel-4.1.patch \ | ||
| 9 | file://dpdk-1.8.0-mk-rework-gcc-version-detection-to-permit-versions-n.patch \ | ||
| 10 | " | ||
| 4 | 11 | ||
| 5 | SRC_URI[dpdk.md5sum] = "11ad8785aaa869cc87265bcb8d828f22" | 12 | SRC_URI[dpdk.md5sum] = "11ad8785aaa869cc87265bcb8d828f22" |
| 6 | SRC_URI[dpdk.sha256sum] = "9f5386830bd999355182e20408f3fc2cfa0802a4497fdded8d43202feede1939" | 13 | SRC_URI[dpdk.sha256sum] = "9f5386830bd999355182e20408f3fc2cfa0802a4497fdded8d43202feede1939" |
