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 735DAA0543 for ; Tue, 7 Jun 2022 10:14:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D1D24282D; Tue, 7 Jun 2022 10:14:54 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by mails.dpdk.org (Postfix) with ESMTP id 201EE40A7F; Mon, 6 Jun 2022 07:59:55 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C9D6021A24; Mon, 6 Jun 2022 05:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1654495194; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lzHhI65DfRLPu3M+LoJ9PakjioQs25uq0uO3g4kJupY=; b=fHY78xevbLDECFgInwIYGw7M0FsaDmFfsnOQ2Zxkvu1eWYPCL05zS+hxTkXdv+GCubdvrh fsImWwv1gDVBmG9C9CMPQhtoEIAvG+2LSB0O6ccE14XY6UREpoN1taieKyCVGtBYck10sj xKRefUZ2dM9BAWCe/24CecovBLWcbJI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1654495194; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lzHhI65DfRLPu3M+LoJ9PakjioQs25uq0uO3g4kJupY=; b=xQ/KTKpn4bSfzwupaTjMGDten2U1BXcVHLNsIbjIe+W8fZ99XmxWvCUAvCXTxvlVU7dJff GYVIbVdY4Wu14MAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 98022139F5; Mon, 6 Jun 2022 05:59:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Mp/gItqXnWLDOgAAMHmgww (envelope-from ); Mon, 06 Jun 2022 05:59:54 +0000 Message-ID: <23927135-c5d0-be83-4447-32e3fce0617d@suse.cz> Date: Mon, 6 Jun 2022 07:59:54 +0200 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: Andrew Rybchenko , dev@dpdk.org Cc: stable@dpdk.org, Stephen Hemminger , Ferruh Yigit , mingli.yu@windriver.com, "Min Hu (Connor)" References: <20220601065149.8031-1-jslaby@suse.cz> <20220601065358.8195-1-jslaby@suse.cz> <88cd54ca-9318-d240-4ce9-2be8b13d19ad@oktetlabs.ru> From: Jiri Slaby In-Reply-To: <88cd54ca-9318-d240-4ce9-2be8b13d19ad@oktetlabs.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 07 Jun 2022 10:14:54 +0200 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 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, -- js suse labs