From 3bcff0b2e4e1c36d5be71ce48c47af2f6cd6dc41 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 8 Oct 2021 13:47:11 +0200 Subject: [PATCH] pgkdep/git: Patch ice driver under ubuntu1804 This is needed for the older kernel builds which include the following change: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7240b60c98d6 Signed-off-by: Michal Berger Change-Id: I8ac86885028d663b776ae8de6d9fb500ed997523 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9808 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Monica Kenguva --- test/common/config/pkgdep/git | 6 ++++ .../patches/ice/0001-undef-skb-frag-off.patch | 29 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index fc7dafe52..9547fd1cf 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -483,6 +483,12 @@ function install_ice() { rm -rf "$GIT_REPOS/ice-$ICE_VERSION" curl -L -o- "$ICE_DRIVER" | tar -C "$GIT_REPOS" -xzf - + + if [[ $OSID == ubuntu && $OSVERSION == 18.04 ]]; then + if ge "$(< /proc/sys/kernel/osrelease)" 4.15.0-159; then + patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1 + fi < "$rootdir/test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch" + fi ( cd "$GIT_REPOS/ice-$ICE_VERSION/src" sudo make -j"$(nproc)" install diff --git a/test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch b/test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch new file mode 100644 index 000000000..784e386b3 --- /dev/null +++ b/test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch @@ -0,0 +1,29 @@ +Current versions of the ice driver redifine skb_frag_off*() on older kernels +(< 5.4.0). Unfortunately, ubuntu1804 kernel builds, 4.15, include this change +hence gcc complains with: + + kcompat_impl.h:46:28: error: redefinition of ‘skb_frag_off’ + +This patch is meant to be used on a particular version of ubuntu to make sure +the driver can be built against the shipped kernel. + +Details: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7240b60c98d6 + +--- + src/kcompat_impl.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/kcompat_impl.h b/src/kcompat_impl.h +index 10d268c..715ce2a 100644 +--- a/src/kcompat_impl.h ++++ b/src/kcompat_impl.h +@@ -42,6 +42,7 @@ static inline void net_prefetch(void *p) + * Implementing the wrappers directly for older kernels which still have the + * old implementation of skb_frag_t is trivial. + */ ++#undef NEED_SKB_FRAG_OFF_ACCESSORS + #ifdef NEED_SKB_FRAG_OFF_ACCESSORS + static inline unsigned int skb_frag_off(const skb_frag_t *frag) + { +--