kni: fix build on RHEL 9.1

Message ID 20230106201315.1179306-1-ferruh.yigit@amd.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series kni: fix build on RHEL 9.1 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Ferruh Yigit Jan. 6, 2023, 8:13 p.m. UTC
  Linux kernel in the RHEL9.1 seems backported Linux commit [1] that drops
netif_rx_ni().

This was fixed in DPDK [2] for vanilla Linux kernel.

Adding RHEL9.1 check for the netif_rx_ni() usage to fix build error.

[1]
2655926aea9b ("net: Remove netif_rx_any_context() and netif_rx_ni().")

[2]
Commit c98600d4bed6 ("kni: fix build with Linux 5.18")

Bugzilla ID: 1076
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---

Cc: daxuex.gao@intel.com
---
 kernel/linux/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Gao, DaxueX Jan. 9, 2023, 2:28 a.m. UTC | #1
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: 2023年1月7日 4:13
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: David Marchand <david.marchand@redhat.com>; dev@dpdk.org;
> stable@dpdk.org; Gao, DaxueX <daxuex.gao@intel.com>
> Subject: [PATCH] kni: fix build on RHEL 9.1
> 
> Linux kernel in the RHEL9.1 seems backported Linux commit [1] that drops
> netif_rx_ni().
> 
> This was fixed in DPDK [2] for vanilla Linux kernel.
> 
> Adding RHEL9.1 check for the netif_rx_ni() usage to fix build error.
> 
> [1]
> 2655926aea9b ("net: Remove netif_rx_any_context() and netif_rx_ni().")
> 
> [2]
> Commit c98600d4bed6 ("kni: fix build with Linux 5.18")
> 
> Bugzilla ID: 1076
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
  
David Marchand Jan. 9, 2023, 9:07 a.m. UTC | #2
Hi Ferruh,

On Fri, Jan 6, 2023 at 9:13 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> Linux kernel in the RHEL9.1 seems backported Linux commit [1] that drops
> netif_rx_ni().
>
> This was fixed in DPDK [2] for vanilla Linux kernel.
>
> Adding RHEL9.1 check for the netif_rx_ni() usage to fix build error.
>
> [1]
> 2655926aea9b ("net: Remove netif_rx_any_context() and netif_rx_ni().")
>
> [2]
> Commit c98600d4bed6 ("kni: fix build with Linux 5.18")
>
> Bugzilla ID: 1076
> Cc: stable@dpdk.org
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>

LGTM.
Tested compilation with 9.0 and 9.1 kernel devel packages.
Reviewed-by: David Marchand <david.marchand@redhat.com>
  
David Marchand Jan. 9, 2023, 5:43 p.m. UTC | #3
On Mon, Jan 9, 2023 at 10:07 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> Hi Ferruh,
>
> On Fri, Jan 6, 2023 at 9:13 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
> >
> > Linux kernel in the RHEL9.1 seems backported Linux commit [1] that drops
> > netif_rx_ni().
> >
> > This was fixed in DPDK [2] for vanilla Linux kernel.
> >
> > Adding RHEL9.1 check for the netif_rx_ni() usage to fix build error.
> >
> > [1]
> > 2655926aea9b ("net: Remove netif_rx_any_context() and netif_rx_ni().")
> >
> > [2]
> > Commit c98600d4bed6 ("kni: fix build with Linux 5.18")
> >
> > Bugzilla ID: 1076
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
>
> LGTM.
> Tested compilation with 9.0 and 9.1 kernel devel packages.
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks Ferruh.
  

Patch

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 3a86d12bbc5c..7aa6cd9fca75 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -146,6 +146,8 @@ 
 #define HAVE_ETH_HW_ADDR_SET
 #endif
 
-#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE && \
+	(!(defined(RHEL_RELEASE_CODE) && \
+	 RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE))
 #define HAVE_NETIF_RX_NI
 #endif