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 43268A050D; Fri, 15 Apr 2022 14:30:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 181E64067E; Fri, 15 Apr 2022 14:30:40 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) by mails.dpdk.org (Postfix) with ESMTP id AC5D94067C for ; Fri, 15 Apr 2022 14:30:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I+2nu/r31FBa7M4Yrgj0NvEwjx4rr2MkxxBze6HGjBu4/Rcs81DW3xqfRooq0HYu7uDiGfAkAj/IG68cg3flauk76QL85htmnx2831uvaPiWO93n/kL5u8eKeLUZPKh8ESZaSi/LZxiKuBj2AnvhgbRONU3pBUCAEpUblqDNdHPEV85Wlg/8X/+sSO2PCRHCf1tolXeyXlQzyVbDct6zJ7ck+GYHFYWuOEG7yQAKhjcygT3/cU2202pKbRJ5dD62MPWau6YgMrolibJbvciU88l6QUr2Afimk6Bor06RiSJmoDZPoLDXpdFXFisZ8/48xtzUNMDyzWor/L69U0uKtw== 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=E+YN9wmQRqYlJTCMSuTmsR4Py8kZEuPchAnl80Cn8Zw=; b=LPs66hNFHgmpoadMaGA/IN2OIc3XQtfll8omypm00v05WZRXY6e7aSjYzvhAx1KVPEdZ33IKZoBWLiFrt6c2uh0yGli+rdrAXRK5A0tQ/Nq/R5kJvZPxxwkAjTm+2pfXZ248OOHY8zvW1b99zUrpO1f16+ChQ8yESFeITNRqDdNm/87eXMKP5NcQE/S6E/CYLJ22ujuSSJUsvMZsTCYp3G2LlcHU02mlMIl7ZK+bSQ/Mji3IvHy8FyK6N/dUDz8PejRrDVgEXaePkRWGNIi6T4wjob/qANkvThh+c2ISomlGjVgKyUumTV6FgpcWbpb/YoPQSWD1XvA+dXZ2+jaj+Q== 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=E+YN9wmQRqYlJTCMSuTmsR4Py8kZEuPchAnl80Cn8Zw=; b=ARbVkrqielubJ+n2ZO1k2mVh+DYVL3l3MaTD820fRhCA7+wBXj7WnVwhTTR+FSZHYcWTE1J55N7Wt0oqvMy+2EVBqClG5e4ErWHAUHYrVYX/zJxuMP/SzKWBlmIaH4m4v1J7NGJ05NV9JBkirsU/6dBaWS/0mo0E6OykhgIrdTY= Received: from SA9PR13CA0001.namprd13.prod.outlook.com (2603:10b6:806:21::6) by SJ0PR02MB7503.namprd02.prod.outlook.com (2603:10b6:a03:299::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Fri, 15 Apr 2022 12:30:36 +0000 Received: from SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com (2603:10b6:806:21:cafe::b6) by SA9PR13CA0001.outlook.office365.com (2603:10b6:806:21::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.9 via Frontend Transport; Fri, 15 Apr 2022 12:30:36 +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 SN1NAM02FT0042.mail.protection.outlook.com (10.97.4.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5164.19 via Frontend Transport; Fri, 15 Apr 2022 12:30:35 +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; Fri, 15 Apr 2022 13:30:34 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 15 Apr 2022 13:30:34 +0100 Envelope-to: G.Singh@nxp.com, baymaxhuang@gmail.com, dev@dpdk.org Received: from [10.71.118.1] (port=2399) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nfL5t-000812-Lv; Fri, 15 Apr 2022 13:30:34 +0100 Message-ID: Date: Fri, 15 Apr 2022 13:30:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] kni: update kernel API to receive packets Content-Language: en-US To: Gagandeep Singh , Harold Huang CC: "dev@dpdk.org" References: <20220414122319.3519271-1-g.singh@nxp.com> From: Ferruh Yigit In-Reply-To: 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: 7feb00e8-94af-4d03-f869-08da1edbbe13 X-MS-TrafficTypeDiagnostic: SJ0PR02MB7503: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: R7xoX+6BfhsfKuKcOAai3TxiByJHcfmXvwWvRKSII1zAJjaxXnNwGTEoHKlJEzkKv/y7cb3ZqdGulIqf+aUIYbpXyeZr/tXMuPC0p37kw9AEdV/DQuk/5LsLPyiHM3kKiN1kWGVC7BlHo4ivJYdQ0G7Xk75+mNmbN/Q2F9TlAvWJIlrHrTl96+ueDrQTdMJyDWvrlpfMcGEJjHu79s3rZshN7StK3sX/A/I2fMgiz8vmLMFJcYXHJ9h2AI6JEc9Qf4fBa79fxVI9s6sf5PvqmEdLN0fz0l3rMpfolh0n7NBsjZU3N6D3oGn0/a7HPQQpi5JXI49nf7yMh8QQZdGEw2r88avtHJkuEzbdOgFK2QEmO8UuBMeJza9ZKm2o4J6qd1/7wneuocNRdWHhZGAAqOKF0bvXfXq/1AVMHIyF/6d7HKukFShPmrBknXkALAlGMfozIU+hCnBkHoTA/Q5YvxNPkYKwxDbFF2npVPgh6AaimGcAW7VeKC5tpAYbUzNX/8DiIZZStQgfvNJiB6fOqQt4R/zxorfIlgE/KKsUDEv1LBFwVS4RZ17YVsDPwfopqmxQsn7Nsmk77kv4darwZlFgbbxF81aLmlYv4Yl9j9dLnnRHRuM+LvmnGsvro5iuVIeIp7GfZZ3cGFugmCNeTb1iYsDFdnBvsCp49aJ3183OZGnNdGE1wCci+Z6Utpgn21m5dp5vJHqOBUihcxmzjuwXnLlsJxfVJueg2E4V0wOtXUNXnH93teSoXIDA3RORob5hrlFG7BBy8f2VzOSAmnpjs8Uyn6jJu8RoBtZK36A= 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)(40470700004)(46966006)(36840700001)(8936002)(7636003)(40460700003)(4326008)(9786002)(15650500001)(82310400005)(2616005)(186003)(110136005)(31686004)(26005)(36756003)(47076005)(316002)(336012)(83380400001)(426003)(356005)(36860700001)(2906002)(70206006)(70586007)(8676002)(53546011)(31696002)(44832011)(508600001)(5660300002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2022 12:30:35.9185 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7feb00e8-94af-4d03-f869-08da1edbbe13 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: SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7503 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/15/2022 5:07 AM, Gagandeep Singh wrote: > Hi > >> -----Original Message----- >> From: Harold Huang >> Sent: Friday, April 15, 2022 8:54 AM >> To: Gagandeep Singh >> Cc: dev@dpdk.org >> Subject: Re: [PATCH] kni: update kernel API to receive packets >> >> On Thu, Apr 14, 2022 at 8:23 PM 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(). >> >> But this change would cause KNI kernel module does not work in the old kernel >> without this patch. I suggested using netif_rx_ni to keep compatibility. > > netif_rx() API exists from very older versions of kernel before v2.6. There will be > no compilation issues. Only difference was, netif_rx_ni() can be used in noninterrupt contexts > to improve performance. May not be compilation issue, but with old kernels won't the behavior be different when 'netif_rx_ni()' switched to 'netif_rx()'? > Now, in latest kernel, netif_rx_ni() is removed and netif_rx can handle all the contexts. > So we have to replace this API otherwise compilation will break on latest kernel. > >> >>> >>> Signed-off-by: Gagandeep Singh >>> --- >>> kernel/linux/kni/kni_net.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c >>> index 29e5b9e21f..e66b35314a 100644 >>> --- a/kernel/linux/kni/kni_net.c >>> +++ b/kernel/linux/kni/kni_net.c >>> @@ -441,7 +441,7 @@ kni_net_rx_normal(struct kni_dev *kni) >>> skb->ip_summed = CHECKSUM_UNNECESSARY; >>> >>> /* Call netif interface */ >>> - netif_rx_ni(skb); >>> + netif_rx(skb); >>> >>> /* Update statistics */ >>> dev->stats.rx_bytes += len; >>> -- >>> 2.25.1 >>> >> >> >> -- >> Thanks, Harold.