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 38B28A0548; Tue, 31 May 2022 18:25:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE09C4067B; Tue, 31 May 2022 18:25:53 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2084.outbound.protection.outlook.com [40.107.96.84]) by mails.dpdk.org (Postfix) with ESMTP id C17C840143; Tue, 31 May 2022 18:25:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQMH3IWymXT5S7uL0UGeo+U3NmMhbhLHzCVUJPxRfXae4y/PPLTsTsg9GGS+wnpuIjxmjelISpxY7PZ+Ri8PN4BYYGVWEQT8kMXC2IPPTfzAy8XQkMvubsRlSNy9q+gMHH6FxEPZ8iYS5ctwS8dGEGogxt4IVd9taxlptt4YLulTMEeGLzFxRAX6oyyhAZck45bRlEcbOjETEjG8OPq44UbobRK1xcl37oKpISEq94VG5gs9T5A1xDEij72tU0mSQFfFG6vfsAHZixKGBPrJifZqm5uR4UQrFdcD93PCjhoVgR5GO/NcblnxfODs4I5+mGNPHjSLQ6shHVdHrRUgoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8mDHeskt/Iu7Me61fdSg5gsNpXL/yENTn+6hFU6/hHo=; b=JLgv05385N/irPyT4UiG9hF3phg97Dj9UqVbCcMj958hSXKhv9woA6fZmB5fffjL6C0JKMPb2VzGSdo1eWqjGarACiqtFAOrQ6eLk9mEWztQl8vCHTbGLNsF2nGwfEP6KmEJtC0c+roqNj7pZdJ3ix9xuYO25BN+EGrmwsX1adP1pGpa+cbpZeKWI0Z9Bmz+wpGVofEV8dyMDNJl3M15D5Ffy2sRR0kZcTPLbrRE13bNGHu4i/1slkdbMkyj6NNBnXFXiY0hYhGaR0fwEe/wv+Cnzx/e1L0x7GeC4XvPwKuB0Ey+DSqhbbEqycj9SKtqGpK2caLY/1Ka8oCYbSP5xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=suse.cz smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8mDHeskt/Iu7Me61fdSg5gsNpXL/yENTn+6hFU6/hHo=; b=KGcr9VSvif60myYkM5rA4AaysK9fZ/KRV9gryuTGDx2Fdk1qNRjkIrLEFgBdjex6KWNIe+KVOwOBrDjOgW6Rd0KiRHpi40tTem0NUtf/+vbtC0BbDFDWrlOgc3vv30t1ilvXAFV3oWsoKBs2dt51x39jJHrjc3mm+o6E8NcL990= Received: from BN9PR03CA0909.namprd03.prod.outlook.com (2603:10b6:408:107::14) by SJ0PR02MB8372.namprd02.prod.outlook.com (2603:10b6:a03:3f0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 31 May 2022 16:25:50 +0000 Received: from BN1NAM02FT036.eop-nam02.prod.protection.outlook.com (2603:10b6:408:107:cafe::cf) by BN9PR03CA0909.outlook.office365.com (2603:10b6:408:107::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12 via Frontend Transport; Tue, 31 May 2022 16:25:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; pr=C Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by BN1NAM02FT036.mail.protection.outlook.com (10.13.2.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5293.13 via Frontend Transport; Tue, 31 May 2022 16:25:49 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 31 May 2022 17:25:49 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 31 May 2022 17:25:49 +0100 Envelope-to: jslaby@suse.cz, stable@dpdk.org, dev@dpdk.org Received: from [10.71.117.172] (port=13571) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nw4gm-0001Cf-VA; Tue, 31 May 2022 17:25:49 +0100 Message-ID: <9440b754-b523-2ebe-e02d-a6aaccb0ad4c@xilinx.com> Date: Tue, 31 May 2022 17:25:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2] kni: fix build with Linux 5.18 Content-Language: en-US To: Jiri Slaby CC: , References: <20220525101224.19748-1-jslaby@suse.cz> <20220525102641.20982-1-jslaby@suse.cz> From: Ferruh Yigit In-Reply-To: <20220525102641.20982-1-jslaby@suse.cz> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2a7c5ad-8988-406a-9c96-08da432239a2 X-MS-TrafficTypeDiagnostic: SJ0PR02MB8372:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cxxlos2XCGqASlkUTVo94JypnFJjxb0Q0LRx6SiFDcmWDMZPR1d0COI1RDJoaS8dsTTVh6envEtTuaCpSOGqPf3+x7Qz3SbvAI2fbxjAUd/MrCIWtZwAOGVJ/FQJDqZ5FCIjSxH6YeZVnIpkm9s9xPaaxR+5mww3Ad3V5X0xlbsHOVFJNq0NqQCktYsw/h++kBummorIaphLc3n+FRZqTHlzkOr0+hcd0jegxYBn4jJBOogoWubfslLhMwnfUH/79Wvw7wT2kOSBs0oFAG6ObNbtYa3HHNtLszB8/eXOfhq7EhODTmYbxU2NefFZwE+cecjOACZc0LojjLRC0wmuzN+b2m7+JPCSH0bhemqrqVNawn/c6HHs9vTb7+747ghnmLnYN6ArN75wNX7xkC7chWGx/28KIBtFUtv6i5ZIARCcMBppMPFVqc0jq1+dLpbZfxqrgKz6c+g2oyjB5jnNuaXW3Vg4w7QIwNLLRQDYe0KxjLSdTDwkJRv1bPRVntpj6wS8MhtFpm2mK80FW29eVijflxaLtiTqngA2LKS+Ng5iVg+viSmnLbyv0PCyF4CytiZc2Jl1ddyHTjnuEmSdg3NK1NdisnpXX76ISL8SMO355LydqZjQx5zQIyh7ebhyc/Or2fPr+gBJS6MFBA5spW9a3FV+wZ9UK6TDZ3gGaW5lzFWeyirQzRA6OjTVHHKRA7VbDvunsolTrN9heY6ltW+/Pch+z8JlnY+5tq60Zik= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(7636003)(8676002)(36860700001)(4326008)(31696002)(44832011)(53546011)(2906002)(83380400001)(9786002)(8936002)(356005)(5660300002)(26005)(40460700003)(508600001)(54906003)(6916009)(316002)(2616005)(47076005)(336012)(426003)(31686004)(36756003)(70206006)(186003)(82310400005)(70586007)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2022 16:25:49.9535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2a7c5ad-8988-406a-9c96-08da432239a2 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT036.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB8372 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 On 5/25/2022 11:26 AM, 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. > I think there is another commit that makes 'netif_rx()' usable in place of 'netif_rx_ni()', can you please document that commit too for reference. > Cc: stable@dpdk.org > Signed-off-by: Jiri Slaby > --- > [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..a81846a8a895 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 LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) > +#define HAVE_NETIF_RX_NI > +#endif Can you please switch sides in the comparison [1] to be compatible with rest of the file and to prevent checkpatch warning [2]? Rest looks good to me. [1] #if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE [2] WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test #97: FILE: kernel/linux/kni/compat.h:145: +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) > diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c > index 29e5b9e21f9e..41805fcabf7b 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;