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 96008A00C3; Thu, 21 Apr 2022 10:30:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3436E40042; Thu, 21 Apr 2022 10:30:06 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2062.outbound.protection.outlook.com [40.107.212.62]) by mails.dpdk.org (Postfix) with ESMTP id 5331A40040 for ; Thu, 21 Apr 2022 10:30:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZD+PVqrS+O0cPwQfBPzUHF5y1UDhe6e9LIbqQmUs9bsEhVAyt1+XvqYVbznQ/POT3k9zmzxMmeSgT53LHq/Xg+vQQKeypA6M39YSW3pTu8GQJvApVVxT5kl716A5lcpH6+qWG8o3HFsJBoosbVZgRPBIeoR0CeaZuCAkghfdYgaTdgCmUOCMYELhC6Q+s0+8Oozt0kY5qNo7M5Hyomv2+JLVn3hVuvPYd4ebh/rUfIPmwDXaHwdULKlzRVSp/RaRK7wsbIPzSGS1jI+LUeN1F+zwhTaUZUdQLJB23WSHt6pE4Blmrt/atCeFDzGV8id6AxlNvFnYA8CykErj9IbXqw== 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=jP+U/b3ujbYOhgRS7mCbySHlnlQ04Zu9ZJBinQDsHZY=; b=k4yDaCMFDKOIqd/Y5B45UEoVYMOsZoGM6J8t7VlJjR+/3TKc7DbFxtZU6H4ZgpMo8ngbS3K9jrp2xarlHbp3c01omK+wqCBPUYJTbnwHszGXKEEZ/SssBmHcvdRfKDciNmE0UMSU8r3vSXfdacegRTZbgfuD3SiFGUTztuY7p+YPJgvErtY1Fqhr0+F6WqupONTx1O5Y6mRAcDyUUbL3K41veY4fSGYIDw7iCmf7M2g1pVSonJcrXsO3Lo7g9aTJnwa/tiBEbnFH0jw0i2mZxjiLp74gsTLWQN6nETAb2p9xobpZv/vzUyxCTxpa+KKtWV+g3pEHCR0JXkdHASKOHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=nxp.com 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=jP+U/b3ujbYOhgRS7mCbySHlnlQ04Zu9ZJBinQDsHZY=; b=WMEZc6EOQ5McJnjPB7M1ctc14lUuK8o+21x2+YUakewmlS+N3lZccDYV8aB6Gh5g6Pds+xrO/YKoNH3VAiD6W51PLjGSOgzSboEZ6pFnQ3v3ABw0+goALxV+X6QMMSqUJnIg8Wm1PZ0bhoyXZqrRVOZcAnng+4oSmMEJzw/Dlu4= Received: from DS7PR05CA0001.namprd05.prod.outlook.com (2603:10b6:5:3b9::6) by MWHPR02MB2398.namprd02.prod.outlook.com (2603:10b6:300:5b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Thu, 21 Apr 2022 08:30:01 +0000 Received: from DM3NAM02FT049.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::5d) by DS7PR05CA0001.outlook.office365.com (2603:10b6:5:3b9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15 via Frontend Transport; Thu, 21 Apr 2022 08:30:01 +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-pvapexch01.xlnx.xilinx.com; Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT049.mail.protection.outlook.com (10.13.5.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5186.14 via Frontend Transport; Thu, 21 Apr 2022 08:30:00 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 21 Apr 2022 09:29:59 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 21 Apr 2022 09:29:59 +0100 Envelope-to: g.singh@nxp.com, dev@dpdk.org Received: from [10.71.117.75] (port=63001) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nhSCN-0007Ed-Hc; Thu, 21 Apr 2022 09:29:59 +0100 Message-ID: Date: Thu, 21 Apr 2022 09:29:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v2] kni: update kernel API to receive packets Content-Language: en-US To: Gagandeep Singh , References: <20220420050309.1055593-1-g.singh@nxp.com> <20220421034502.1987597-1-g.singh@nxp.com> From: Ferruh Yigit In-Reply-To: <20220421034502.1987597-1-g.singh@nxp.com> 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: 7cd62fe7-c0c0-4f1c-f1f2-08da23712073 X-MS-TrafficTypeDiagnostic: MWHPR02MB2398: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: rMz+TWqmox7OZAMv+81poF2Ua9WIiLA858RWQLIyh662LAGzW0KQkNrNYUiSUmQyq/7NEZ09DyJrXvLELH/Vrbz3kAB7dS/64YsUpkvzm68qXWAHNitG07mWibiQtTuIFHuWNtq9wBm/5uj/KUmtTTC3PCIFr7E8vMNdQsnSd9WQoUoMFkn9bduQ4jo531whsjxrrR2GwiN57cV69LBOuniJ4rMgwQcGK4vgc2dT5EJWbYeoLTVH41ZQ8B7vJNBF/0dr6SbTJqfedhyQ25tfhvbSdRAguaxSdb39TKEzVvT0uTfIJDOcwSwB5diJ2NAsZ2Eg5EZ4qHtInaKH7CBXFSkmCJ9eR0QYmRvCzv/UweTSeWcUesWFzLhe0e7/5QBwF4m1g2xXr0oDcfYbzKBCb5wJ0eMwvQEgOS7joojCoW7F75gCAp41w8jYqxpc8464vu4rZXRajjKjFqDH1p4xaY800DaZk8wFvcYmlp5ZjQY7+QIfg7exscBWOyW9Xqu81QN3VmR6X6VqJ3zkUZdJYcomHaSaSjYBoaV7U5qOKoFi1DVJerTiB7hyeT+/ZtLDdNgWQAPyHtwo86s+oCrPu4MLTzWK430QPCSfkvUDtJN/iYLbD4kR71xPM3Tut2b38/DpRqmty90lr9zZk+1VS/4Rb4/DApF/Zx5/ZX77eKrVzrB922snX73J9YC6mbGR9F/H/+knEI3OoOAQLsyYbcG08uyyguTUGtMBv9D5uEg= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(9786002)(508600001)(36860700001)(31696002)(8936002)(110136005)(40460700003)(356005)(316002)(26005)(47076005)(426003)(36756003)(336012)(15650500001)(186003)(83380400001)(44832011)(7636003)(53546011)(70586007)(31686004)(70206006)(2906002)(5660300002)(2616005)(82310400005)(8676002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 08:30:00.6905 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7cd62fe7-c0c0-4f1c-f1f2-08da23712073 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-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT049.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2398 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 4/21/2022 4:45 AM, Gagandeep Singh wrote: > API 'netif_rx_ni()' has been removed in kernel with commit: > baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") > > The API netif_rx() can be used for any context to receive packets > from device drivers. > > This patch replaces the API netif_rx_ni() with netif_rx() for > kernel version 5.18 and above. > > Signed-off-by: Gagandeep Singh > > Change-log: > Added a #if for kernel version 5.18 and above for API change. > --- > kernel/linux/kni/kni_net.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c > index 29e5b9e21f..7a576b9ebc 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 */ > +#if KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE Can you please put the version check to 'kernel/linux/kni/compat.h', there are multiple samples there. As you will see there, the version comparison is not straightforward when distro kernels are involved, so it is good to move that clutter away from the source code. > + netif_rx(skb); > +#else > netif_rx_ni(skb); > +#endif > > /* Update statistics */ > dev->stats.rx_bytes += len;