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 B4240A00C3; Thu, 21 Apr 2022 10:59:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92FE840042; Thu, 21 Apr 2022 10:59:51 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150051.outbound.protection.outlook.com [40.107.15.51]) by mails.dpdk.org (Postfix) with ESMTP id 93FE340040 for ; Thu, 21 Apr 2022 10:59:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dAAZ+XoizVcKA0P2c4vdfqDVBVCP4tBwcTG7xsST6CSMbcEOL2eqlHFsGyriwSy9NliFhTAHbQgkOlAuL5QXzJCmdOUL4WOcmevzBRWWGfZJRZQAUjD5q1banJ5VgmPu+sgrhROZS9hLr641Bup13kdZHZLOKpzj+lYFX6p7O+dNRg4WFidl7mxujdK5BKBh27wCKoPmYJFcGmBFWy33dCptjv26uZPE5nqWkTnA3o2P/jNeD08lo7wINF0DlBLUCk85NXd7b8Fcy7ddfY44pIsrBx+DWIwLRrTZJ6WEnaHBV8iv60yPFbxz4UoxTL8XAaD1s8nKwHrKX+MukS4Tzw== 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=FA8y2vwYeeVQ4iyJnzWKdX/U4VBq54W3rpIN6TbSrTc=; b=Nj6aixvDq8TlDgreHcEoU5hi3bPtVMQyzxnuMJVGkvlFW80/jdG4vMe21JfSHjOtQa+B9bXlWZyDjwqezFgaC/M+VUHFzE53LWKyy+PeenyKItbqAfCi9+LRknZrAlBoSJkHdHWCfBoqEoaoNt5N3mSVOuEUgSP2M8lbCMeX5e2aWQo0gyO0dfeuO8PoKjhxJXudiBNwYIySLfICBjg/vQ3P35hBk+undPJFi9apx1/r7P8MvGwoVVubQXZj3sk5yJDJF1EQlw1C0ezJc7iS2hqdgdJueRCKKOaGiodulNZA8HvxpCCSVT4VtSShWOzwk/a9RYytcWHR6qL+UHZkRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FA8y2vwYeeVQ4iyJnzWKdX/U4VBq54W3rpIN6TbSrTc=; b=RD+dPRYwCM1drArjyWBeN6YupROOzz54AzKWLut3HsJlO+8k0Wh8z0ljR/T3tyXL6qjZ3ywjAaLzaKFZJOZXYlqTW+hw/6nuSPIV0a6HQh/SzVcX8XPD/GNQ+34AvF32TDjvGojo/KetByxRZpY3egLhBtvP8Wm5Sb1MuFCrMIE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by VI1PR0402MB3824.eurprd04.prod.outlook.com (2603:10a6:803:22::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Thu, 21 Apr 2022 08:59:48 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%7]) with mapi id 15.20.5186.014; Thu, 21 Apr 2022 08:59:48 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH v3] kni: update kernel API to receive packets Date: Thu, 21 Apr 2022 14:29:31 +0530 Message-Id: <20220421085931.2429443-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421034502.1987597-1-g.singh@nxp.com> References: <20220421034502.1987597-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR06CA0001.apcprd06.prod.outlook.com (2603:1096:4:186::21) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b29b1c54-e2b6-413b-f91a-08da2375495f X-MS-TrafficTypeDiagnostic: VI1PR0402MB3824: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: 57IEcLT6zbo4cyrymsfh9ai8iM5q6cKVohVTTIsOuKgWL59umJwYSeld4Mgyuws6bcjW1Fbegy4/azIAH4yOYE9cFpcqCQiT+OxsHUFOGmqTwomvssPI5mvglzLnQSdb5upWIDuX43kgegpgPfDKQipQGIICB5ESuF9JUoSN0sIlAGRjEbOtOSXKdhq2OICZr44cCJ8K3VDianQb4KVuxA1VEC8b56uUN4J63PMu2C38Q6iTwB+ZvZWuq3p2f9LXWmy6oJAtsz0HbBswHOxyBiYStykYcH9FkWdg3awdL4oZ15M10WhvPKz79p41fqeB15g2TBQHD1zx6SNzXiqA/hGwabpVMiabalW0YrFPprPjijBkA2bd0+tDDDsDbpDuWNUME7D8Z6glIMcuKkWLHTpxymimyKiMpYwm6qgGjhbvfh6auOVypYfAhV1b/DfUdIWeW+k5oXv0ZqEFmr5cdMnobqbWiOb0PK55DmbZ8lTZN7R+DjYHvIwqOZKpTQNhqNK2r0i4KPGCL56kuGQcCb7Pq2S2xVkVQAsOjl+jWqyGeZSmVsHpqK4PeLK0fRVjj0oPxnzGTqlgyvRl9nOepsltog/UyEC/sHzmJAYpOm3DwDfiIK4fZqPPUb4jCpsapPFRUwNWJZ6ATnzJcf/2nwFsgfxGafzaK3q9rb4hDnxUKE/SH3dVmcptWgs8Yow4gIqSpOOhg2MvYjWeQGowNg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(1076003)(4326008)(66946007)(86362001)(2616005)(66556008)(316002)(186003)(36756003)(66476007)(8676002)(52116002)(83380400001)(38350700002)(5660300002)(6666004)(8936002)(6486002)(508600001)(6512007)(26005)(2906002)(55236004)(15650500001)(38100700002)(6506007)(6916009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hBHPxQs/EMfJWPtBPU2tGkjen10gqJivigyxqvz6Yv5XpjcPCAmQ+8Ptf4O2?= =?us-ascii?Q?gWhPG6wVa4Ukp2o2vmYp9RZMu1qJhBcMpceACm3RDuRZzChrRUwLEjqZTrdC?= =?us-ascii?Q?5WxD3XGCTBLyqUBdVoAwxg8oWGqFzE/+N4P+h3Myo+QU7PmDgG1Q1eIuZist?= =?us-ascii?Q?Mrb14KGVEwA3n8yJRS2xjp+pb+itmjFEGrGTLKU6CVhzczdRTe1MZjVrUbzS?= =?us-ascii?Q?jIq0hWljNelnh4iJ/c4e0MfTSv+D0GQFbcyYB0OSUNP6QFyr7LcI5Wa9x3q2?= =?us-ascii?Q?hkl7UNXf+FbmmjIXH23lhSA8aOxgAhvosIIXsqKC6e1HZ6sVoeifCiHfdGSe?= =?us-ascii?Q?JLKYa+gJsv1S8hbcQlda8exaFBrR6tASqrFHNb1hLtByM6NDQx6qIWzWcNke?= =?us-ascii?Q?niuAfXO7eTQ9gVoY000J4KIS058yL578eRE88W3lVt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XSBsfhBVLBjwAECVzQXQtEdu98IhlyxkXgq?= =?us-ascii?Q?IYV+7QsA5tfOFz068Vp1ELbPzCOv4/amZtPaLchpVIv+7gTyEqxagI7zXTUF?= =?us-ascii?Q?j5fTLgmcnChguLJoux3zsRK9PeJ0OQ5Y471MuaJYj4SMggpeXYLRYaiRWcYp?= =?us-ascii?Q?m6vFmTzyFYSkHejxwYoI73gd1wYCLd5boX7NJGoV2rn2GQYEBp6Ya7HGKpKQ?= =?us-ascii?Q?uj/ttbw7ZWN0Xz0eZvEEnWBQWkDIQ/Vnc29kQ/BWRnXtNvEY7tx4RKeC9q99?= =?us-ascii?Q?cU/63jXcbzWd2r3djN7IbErgQCrraJgWEjwpnH1+qKwhAfNqFMmY9Rgt3pa+?= =?us-ascii?Q?F0do15U93M7kTYMhN0z6Q+hIIf1pOXs0LgQv7LHZTc59UO1XtNy8XDc/KyXY?= =?us-ascii?Q?wBNXrz5OuA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b29b1c54-e2b6-413b-f91a-08da2375495f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 08:59:48.1621 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y/7aysvmTaOZlnCMIlYMz0zpUn9FheF2eBvxTDs0v5LpH6nO4GFBXe/87Wl6yGT4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3824 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 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 v2 Change-log: Added a #if for kernel version 5.18 and above for API change. v3 Change-log: Moved #if of kernel check to compat.h --- 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 664785674f..6451295270 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_CHANGE_NETIF_RX +#endif diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index 29e5b9e21f..80ead13b75 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_CHANGE_NETIF_RX + netif_rx(skb); +#else netif_rx_ni(skb); +#endif /* Update statistics */ dev->stats.rx_bytes += len; -- 2.25.1