From e909ce962b520ef1deaf02f9b53889f0db9e9212 Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Fri, 1 Oct 2021 13:51:00 -0700 Subject: Fix iavf driver build failure With kernel 4.15.0-159, Ubuntu added the skb_frag_off functions to the kernel headers. Issue-ID: MULTICLOUD-1396 Signed-off-by: Todd Malsbary Change-Id: I283d6ea394ac4685be842339acd2a89548295b4f --- .../installers/Dockerfile.iavf-driver-installer | 1 + .../installers/entrypoint-iavf-driver-installer.sh | 6 ++++++ kud/deployment_infra/installers/skb-frag-off.patch | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 kud/deployment_infra/installers/skb-frag-off.patch diff --git a/kud/deployment_infra/installers/Dockerfile.iavf-driver-installer b/kud/deployment_infra/installers/Dockerfile.iavf-driver-installer index 9882c2f7..8d4593a6 100644 --- a/kud/deployment_infra/installers/Dockerfile.iavf-driver-installer +++ b/kud/deployment_infra/installers/Dockerfile.iavf-driver-installer @@ -19,6 +19,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY _common.sh / +COPY skb-frag-off.patch / COPY entrypoint-iavf-driver-installer.sh /entrypoint.sh CMD /entrypoint.sh diff --git a/kud/deployment_infra/installers/entrypoint-iavf-driver-installer.sh b/kud/deployment_infra/installers/entrypoint-iavf-driver-installer.sh index 6cfc373d..d47e3b97 100755 --- a/kud/deployment_infra/installers/entrypoint-iavf-driver-installer.sh +++ b/kud/deployment_infra/installers/entrypoint-iavf-driver-installer.sh @@ -2,6 +2,7 @@ #set -x source _common.sh +SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") IAVF_DRIVER_VERSION="${IAVF_DRIVER_VERSION:-4.0.2}" IAVF_DRIVER_DOWNLOAD_URL_DEFAULT="https://downloadmirror.intel.com/30305/eng/iavf-${IAVF_DRIVER_VERSION}.tar.gz" @@ -27,10 +28,15 @@ download_iavf_src() { pushd "${IAVF_INSTALL_DIR_CONTAINER}" > /dev/null curl -L -sS "${IAVF_DRIVER_DOWNLOAD_URL}" -o "${IAVF_DRIVER_ARCHIVE}" tar xf "${IAVF_DRIVER_ARCHIVE}" --strip-components=1 + info "Patching IAVF source ... " + # Ubuntu 18.04 added the skb_frag_off definitions to the kernel + # headers beginning with 4.15.0-159 + patch -p1 < "${SCRIPT_DIR}/skb-frag-off.patch" popd > /dev/null } build_iavf_src() { + info "Building IAVF source ... " pushd "${IAVF_INSTALL_DIR_CONTAINER}/src" > /dev/null KSRC=${KERNEL_SRC_DIR} SYSTEM_MAP_FILE="${ROOT_MOUNT_DIR}/boot/System.map-$(uname -r)" INSTALL_MOD_PATH="${ROOT_MOUNT_DIR}" make install diff --git a/kud/deployment_infra/installers/skb-frag-off.patch b/kud/deployment_infra/installers/skb-frag-off.patch new file mode 100644 index 00000000..935828ee --- /dev/null +++ b/kud/deployment_infra/installers/skb-frag-off.patch @@ -0,0 +1,14 @@ +diff --git a/src/kcompat.h b/src/kcompat.h +index 21e9818..97abc2f 100644 +--- a/src/kcompat.h ++++ b/src/kcompat.h +@@ -7074,7 +7074,8 @@ devlink_flash_update_status_notify(struct devlink __always_unused *devlink, + /*****************************************************************************/ + #if (LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)) + #if (!(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,2)) && \ +- !(SLE_VERSION_CODE >= SLE_VERSION(15,2,0))) ++ !(SLE_VERSION_CODE >= SLE_VERSION(15,2,0)) && \ ++ !(UBUNTU_VERSION_CODE >= UBUNTU_VERSION(4,15,0,159))) + static inline unsigned int skb_frag_off(const skb_frag_t *frag) + { + return frag->page_offset; -- cgit 1.2.3-korg