From 8dd007ff67614616c33cde0f1ad6e478ece98628 Mon Sep 17 00:00:00 2001 From: yangl777 Date: Tue, 18 Jul 2023 07:04:58 +0000 Subject: [PATCH] fix build error beacuse of kernel api changes --- backport-fix-build-error-with-Linux-6.4.patch | 91 +++++++++++++++++++ iavf.spec | 10 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 backport-fix-build-error-with-Linux-6.4.patch diff --git a/backport-fix-build-error-with-Linux-6.4.patch b/backport-fix-build-error-with-Linux-6.4.patch new file mode 100644 index 0000000..a615fbd --- /dev/null +++ b/backport-fix-build-error-with-Linux-6.4.patch @@ -0,0 +1,91 @@ +From 068c38ad88ccb09e5e966d4db5cedab0e02b3b95 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Wed, 26 Oct 2022 15:22:14 +0200 +Subject: net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). + +Now that the 32bit UP oddity is gone and 32bit uses always a sequence +count, there is no need for the fetch_irq() variants anymore. + +Convert to the regular interface. + +Signed-off-by: Thomas Gleixner +Signed-off-by: Sebastian Andrzej Siewior +Acked-by: Peter Zijlstra (Intel) +Signed-off-by: Jakub Kicinski + +--- + src/iavf_ethtool_stats.h | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/iavf_ethtool_stats.h b/src/iavf_ethtool_stats.h +index 2c658aa..2733c0e 100644 +--- a/src/iavf_ethtool_stats.h ++++ b/src/iavf_ethtool_stats.h +@@ -228,7 +228,7 @@ enum iavf_chnl_stat_type { + * @stat_type: stat_type could be TX/TX/VECTOR + * + * Queue statistics must be copied while protected by +- * u64_stats_fetch_begin_irq, so we can't directly use iavf_add_ethtool_stats. ++ * u64_stats_fetch_begin, so we can't directly use iavf_add_ethtool_stats. + * Assumes that queue stats are defined in iavf_gstrings_queue_stats. If the + * ring pointer is null, zero out the queue stat values and update the data + * pointer. Otherwise safely copy the stats from the ring into the supplied +@@ -273,12 +273,12 @@ iavf_add_queue_stats_chnl(u64 **data, struct iavf_ring *ring, + + /* To avoid invalid statistics values, ensure that we keep retrying + * the copy until we get a consistent value according to +- * u64_stats_fetch_retry_irq. But first, make sure our ring is ++ * u64_stats_fetch_retry. But first, make sure our ring is + * non-null before attempting to access its syncp. + */ + #ifdef HAVE_NDO_GET_STATS64 + do { +- start = !ring ? 0 : u64_stats_fetch_begin_irq(&ring->syncp); ++ start = !ring ? 0 : u64_stats_fetch_begin(&ring->syncp); + #endif + for (i = 0; i < size; i++) { + void *ptr = ring; +@@ -289,7 +289,7 @@ iavf_add_queue_stats_chnl(u64 **data, struct iavf_ring *ring, + &stats[i]); + } + #ifdef HAVE_NDO_GET_STATS64 +- } while (ring && u64_stats_fetch_retry_irq(&ring->syncp, start)); ++ } while (ring && u64_stats_fetch_retry(&ring->syncp, start)); + #endif + + /* Once we successfully copy the stats in, update the data pointer */ +@@ -302,7 +302,7 @@ iavf_add_queue_stats_chnl(u64 **data, struct iavf_ring *ring, + * @ring: the ring to copy + * + * Queue statistics must be copied while protected by +- * u64_stats_fetch_begin_irq, so we can't directly use iavf_add_ethtool_stats. ++ * u64_stats_fetch_begin, so we can't directly use iavf_add_ethtool_stats. + * Assumes that queue stats are defined in iavf_gstrings_queue_stats. If the + * ring pointer is null, zero out the queue stat values and update the data + * pointer. Otherwise safely copy the stats from the ring into the supplied +@@ -322,19 +322,19 @@ iavf_add_queue_stats(u64 **data, struct iavf_ring *ring) + + /* To avoid invalid statistics values, ensure that we keep retrying + * the copy until we get a consistent value according to +- * u64_stats_fetch_retry_irq. But first, make sure our ring is ++ * u64_stats_fetch_retry. But first, make sure our ring is + * non-null before attempting to access its syncp. + */ + #ifdef HAVE_NDO_GET_STATS64 + do { +- start = !ring ? 0 : u64_stats_fetch_begin_irq(&ring->syncp); ++ start = !ring ? 0 : u64_stats_fetch_begin(&ring->syncp); + #endif + for (i = 0; i < size; i++) { + iavf_add_one_ethtool_stat(&(*data)[i], ring, + &stats[i]); + } + #ifdef HAVE_NDO_GET_STATS64 +- } while (ring && u64_stats_fetch_retry_irq(&ring->syncp, start)); ++ } while (ring && u64_stats_fetch_retry(&ring->syncp, start)); + #endif + + /* Once we successfully copy the stats in, update the data pointer */ +-- +2.33.0 + diff --git a/iavf.spec b/iavf.spec index 9714710..5df788e 100644 --- a/iavf.spec +++ b/iavf.spec @@ -9,7 +9,7 @@ Name: iavf Summary: Intel(R) Ethernet Adaptive Virtual Function Driver Version: 4.7.0 -Release: 1 +Release: 2 Vendor: Intel Corporation License: GPL-2.0 URL: http://support.intel.com @@ -19,6 +19,8 @@ Requires: kernel, findutils, gawk, bash, hwdata BuildRequires: kernel-devel hwdata uname-build-checks gcc +Patch0: backport-fix-build-error-with-Linux-6.4.patch + %description This package contains the Intel(R) Ethernet Adaptive Virtual Function Driver. @@ -396,6 +398,12 @@ else fi %changelog +* Tue Jul 18 2023 yanglu - 4.7.0-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix build error beacuse of kernel api changes + * Wed Feb 01 2023 yanglu - 4.7.0-1 - Type:bugfix - ID:NA -- Gitee