From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 498FAA00C2; Sun, 5 Jun 2022 09:55:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 013434021E; Sun, 5 Jun 2022 09:55:06 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id B25DA40041; Sun, 5 Jun 2022 09:55:04 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 115) id 89F604C1; Sun, 5 Jun 2022 10:54:56 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mail1.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id CBDF84C0; Sun, 5 Jun 2022 10:54:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru CBDF84C0 Authentication-Results: shelob.oktetlabs.ru/CBDF84C0; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Ferruh Yigit , Stephen Hemminger Cc: dev@dpdk.org, Min Hu , mingli.yu@windriver.com, Jiri Slaby , stable@dpdk.org Subject: [PATCH v3] kni: fix build with Linux 5.18 Date: Sun, 5 Jun 2022 10:54:49 +0300 Message-Id: <20220605075449.3095576-1-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220525101224.19748-1-jslaby@suse.cz> References: <20220525101224.19748-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jiri Slaby Since commit 2655926aea9b (net: Remove netif_rx_any_context() and netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx() can be called from any context. So define HAVE_NETIF_RX_NI for older releases and call the appropriate function in kni_net. Cc: stable@dpdk.org Signed-off-by: Jiri Slaby Signed-off-by: Andrew Rybchenko --- v3: - swap comparison in compat.h to make checkpatches.sh happy kernel/linux/kni/compat.h | 4 ++++ kernel/linux/kni/kni_net.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 664785674f..0db29a4a6f 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -141,3 +141,7 @@ #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE #define HAVE_TSK_IN_GUP #endif + +#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE +#define HAVE_NETIF_RX_NI +#endif diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index 29e5b9e21f..41805fcabf 100644 --- a/kernel/linux/kni/kni_net.c +++ b/kernel/linux/kni/kni_net.c @@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni) skb->ip_summed = CHECKSUM_UNNECESSARY; /* Call netif interface */ +#ifdef HAVE_NETIF_RX_NI netif_rx_ni(skb); +#else + netif_rx(skb); +#endif /* Update statistics */ dev->stats.rx_bytes += len; -- 2.30.2