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 19E5FA00BE; Wed, 20 Apr 2022 07:03:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6B874068E; Wed, 20 Apr 2022 07:03:32 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2064.outbound.protection.outlook.com [40.107.22.64]) by mails.dpdk.org (Postfix) with ESMTP id 6CB5C40687 for ; Wed, 20 Apr 2022 07:03:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWncdDXDsUnMcwceMjW4yDjEZNPg+6hsOt6vAJe8ixIy6XkYA/cydvOviaVdnLRQF1hLrypKztPgf41ZR02nLlnNePcRAQ6JyKT6sjzaG6MV8RjlWCfMzAB5jHvsbNd46eyD3kI8uvGjZXK8RvFXv0JZupQv+RhIsK3PQNT+IS07Z70Fmpf8tE3HxtV77Yvrm2SlGGGrM+/AkxuhGl1kXzkZpuVJ4vmAdixwZuT9dSFMPY+B9hUhowHCs7PJutX8Vm8TN4ze8iJc1WYKSdHuHn47RE/JmMlBGF9aBPH7b3YFsCHhgOaMVv6VW6m/HwFGcu8pcgaBo0iZDu2bXYF61w== 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=RQ6aW7P2xYoHfPMC6gwQM95HBwi9ABiK93rGrY5ER3A=; b=G5ffRE6pEb1tTU3PV7TYyPP5XUW0kim1v73sBf1zKM3fvZQqlVcXLn/nzvLW7z0ttJ/rTbmOQl6jaRuaW0N7qqhaPbJ2XMQ9B+2BCFgOaQYMImVJ4r/vb0DR4W72oDQL7SP4l4lUghV4xfljTIG1h3KYXSeZ7Y0a54xM64tfP9t5BMYX+aR7u1aTgXnUnrSkGdDvhwcz9E/HlhcM8fGAyXlX9KDUEzeSCEzQifrPRCxMTAItyrSToHXqQ1StWgMp8l3dKHF92jOKHOpOKTb1Z2/7VUbTZkUr+rmhIMFqNrtXpLu0DRXFSTL8YYwm27z8HU8AXYWD+lTC7evWQROdWg== 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=RQ6aW7P2xYoHfPMC6gwQM95HBwi9ABiK93rGrY5ER3A=; b=ol50VW+qYK9vWkR9/Id1o0cUs9hYg5rNPqvaWzTkJkJ1Qap+G9Fg80cKMjXXYK2tmezGwpp2Y/OS5GWiPccOdanWHg0xcd1HC82Vm2EKfiXAwj5x2F10YLkD2OQuzjvZtTCZ0+vtj+g20vem7Jhqo75XiziOi5iufKezU2gh73M= 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 VI1PR04MB5679.eurprd04.prod.outlook.com (2603:10a6:803:ea::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Wed, 20 Apr 2022 05:03:29 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::95b4:26a1:d97d:6916]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::95b4:26a1:d97d:6916%7]) with mapi id 15.20.5164.025; Wed, 20 Apr 2022 05:03:29 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH] kni: update kernel API to receive packets Date: Wed, 20 Apr 2022 10:33:09 +0530 Message-Id: <20220420050309.1055593-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220414122319.3519271-1-g.singh@nxp.com> References: <20220414122319.3519271-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR06CA0003.apcprd06.prod.outlook.com (2603:1096:4:186::14) 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: 58e7f543-3d91-456a-6d3f-08da228b1b93 X-MS-TrafficTypeDiagnostic: VI1PR04MB5679: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: D0scHkaEw0vC+v1qWd8HdChHgX0hgJp4+W98rRMv84xv3QR7ezwrNFo4CxpFNizopQZj94dpmmZcGON0/dNixE2QgHQZX9QG9IxoPT33l3fQxW0z9tuuvshL0mh33NeZd/+fnE5Tfhl7UskutRLdKYkOmtygv5Y0ZPf42pQnYuUr4E1l4QGBqoyZOMKmkFyRn8WZ1yCSt2IVyiAlPmrletqS35jW6CCw8DgrVU53EBRF6Lory2g8GOB3jnEwLr4HScHlxB31jVSDaTAtZ1suwgSjSs7lWYw42cLfIVHM47JxU3N+qkXp+WulD+y5QcPx/GcSw7YlSGAQiKyjC4HwfWufZSefQU1wYE4W0LUqGG4hPXmfcPHZFysuwEgf0Wm2wejVo4S1nSddcOso1vzux8njfiBUGWukPie7UgsBv5O94kmFVJfIMY6zYbRoe0izbybY1ic8NC+qecEyOVshm3Afk4wodtONsymqaNDTGH7uvcACVUlvlixLugBLV0EzIerttY/lEgbTHKatpdjUsBx6FTRoS1ICp+LeUh4cIxFwIoERB6u8A63DDjD7WjLIRwX5jTW6RGVwET4qEoeATDEpFs5wJtm6DvovrkLmum1l1WiHWHuChoi+gDq/C3gIbDCnc9v1Bq4Wg3TTEYPen93mnBFjQ7/W66wTKC309L2jf5TFwXWBFsxDIGD9oJBqpSQK4XgGrMSQ+Tcssi7z5A== 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)(66556008)(186003)(2616005)(66946007)(8676002)(4744005)(38350700002)(38100700002)(83380400001)(8936002)(5660300002)(508600001)(26005)(15650500001)(4326008)(2906002)(6512007)(6666004)(52116002)(6506007)(55236004)(6916009)(316002)(36756003)(66476007)(6486002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bKGTKMTrqhKmCDQqzoaZl9qXp5KlIhd1flb3+3PQPDJpae70+phPz0bG197w?= =?us-ascii?Q?GumMJCyqr5G6O0+9yT7IHN9lWgoA2/ei4+b94zuRx0014jmM5rTI5O1fu4a2?= =?us-ascii?Q?PZKkKOqdd6h1e3rXhOXxXh7QJz933sC8sv25YvXoexcJpR+OEvkd1Z2gk6+e?= =?us-ascii?Q?UAnd92DGXXlZvDQK4T9+yuozGGFl5SgRLcjq6p8rqa/X2MoS+xF8t1lV2Gbz?= =?us-ascii?Q?4oSG+0ugZ8ZqvifJVgHvrs2GoHvO8Kgl2F+GgRnWPHGp2yF2MtLUH9yi30wQ?= =?us-ascii?Q?laT+FL81OIvxLgOTBczIopeu6W/HCtE/IBTxbSwlGKzcsgqCZoY+S/Dy/lMu?= =?us-ascii?Q?po7sqhLACLbhlaZ9IgdT10Xj34kZqunSrOpfwcATLpd0g6Ai44TJPs6JgVyE?= =?us-ascii?Q?VBgMf2bBp/FnwZvuvvEpt4t+9Eiba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us-ascii?Q?KE4gvNBTjhBpYc2PaXDJnmx1vuMDE//952YFjSfhVbkpOXfa4YLmO0bSEAL6?= =?us-ascii?Q?tAZs1MiuXTBIOgp+5mAU/JXORG3l8Ki4/2geHqF4/AlJ6RRdFXqXEDmH/6NB?= =?us-ascii?Q?6w/ZYIoMihzhCg0WUhRGgQy89ymhCnkT+bi61KNKFnLLrUfwMLdS5DmKtsgl?= =?us-ascii?Q?hEbgiX8G49hk/+Rp2VbKbDVDnKzEkgTkqNgvaDXcQ+bf/G+2Rto4u3d/Q1QZ?= =?us-ascii?Q?rK2NYCA+8RZIFFoe7caan9uiAgmQCUW6rbBBGqSek9hm/JjIXRL1cWLIg3R9?= =?us-ascii?Q?J9q0hdO7bF0a8lR08BwwxSwd4OJhmCsH9JXlPGZyEaNURcSocHoK1C7+L4ow?= =?us-ascii?Q?nooIwAejLvbWceryeCy8NcxOpmpj8+Z+alOLdnCwkFhNrXvouMvP64VGeGA0?= =?us-ascii?Q?pKYsFmHvcQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e7f543-3d91-456a-6d3f-08da228b1b93 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 05:03:28.9634 (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: gdpZmIIQ77OrbxyE237fv2C2XEQjz2wbu7YFrCyD5X/p5Tn6Jx6fcztvRXTYO7Qe X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5679 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.17 and above. Signed-off-by: Gagandeep Singh --- 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..764ac0b225 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 LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) + netif_rx(skb); +#else netif_rx_ni(skb); +#endif /* Update statistics */ dev->stats.rx_bytes += len; -- 2.25.1