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 68013A0543 for ; Mon, 6 Jun 2022 18:21:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60B6042685; Mon, 6 Jun 2022 18:21:10 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 128684069C; Mon, 6 Jun 2022 18:21:08 +0200 (CEST) Received: from [192.168.1.40] (unknown [188.170.81.145]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id CE6AF28B; Mon, 6 Jun 2022 19:21:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru CE6AF28B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1654532467; bh=6UcdHXlSZ5Mpy8PodIDU7OQCNAWHp04e9gK0QTdQ6uA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iNat5CxATy4o35vxX0HbNBy6Xbc94u1eh9J67lxzxLoybVbUP/BA/4MOActiR2LwA qXsheaHEadg4hyRQqIbr1tNmKEFofUrdO2T/VZ0H887Zo0uoJBSAo0kqYHfWE4yO6r gMRNEDuzHQdrIMULNxpZe7kJMzMxwK1gM8LKk+8I= Message-ID: Date: Mon, 6 Jun 2022 19:20:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v4] kni: fix build with Linux 5.18 Content-Language: en-US To: Jiri Slaby , dev@dpdk.org Cc: stable@dpdk.org, Stephen Hemminger , Ferruh Yigit , mingli.yu@windriver.com, "Min Hu (Connor)" , David Marchand References: <20220601065149.8031-1-jslaby@suse.cz> <20220601065358.8195-1-jslaby@suse.cz> <88cd54ca-9318-d240-4ce9-2be8b13d19ad@oktetlabs.ru> <23927135-c5d0-be83-4447-32e3fce0617d@suse.cz> From: Andrew Rybchenko In-Reply-To: <23927135-c5d0-be83-4447-32e3fce0617d@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 6/6/22 08:59, Jiri Slaby wrote: > On 05. 06. 22, 10:22, Andrew Rybchenko wrote: >> On 6/1/22 09:53, Jiri Slaby wrote: >>> 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. >>> >>> There were other attempts to fix this: >>> https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/ >>> >>> https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/ >>> >>> >>> But neither of them ensures netif_rx_ni() is used on older kernel. This >>> might lead to deadlocks or other problems there. >>> >>> Cc: stable@dpdk.org >>> Signed-off-by: Jiri Slaby >>> --- >>> [v4] >>> - really switch the #if test >>> [v3] >>> - reference other patches >>> - switch the #if test expressions to conform to the checker >>> [v2] >>> - forgot to amend the #else/#endif typo fix >>> >>>   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 664785674ff1..0db29a4a6f61 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 29e5b9e21f9e..a8b092b7567d 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); >>> +#else >>>           /* Update statistics */ >>>           dev->stats.rx_bytes += len; >> >> Applied to dpdk-next-net/main with minor fixes in the description, >> thanks. > > Sorry, it appears I sent the old version again. The latter #else should > have been #endif. Do you want me to send a followup patch? > > thanks, Oh, I'm sorry as well that I didn't catch it. Frankly speaking I'm surprised that all CI does not catch it. test-meson-build.sh does not catch it as well with default. I've tuned my build checks to care about it. Thomas, thanks a lot for the quick fix.