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 B3720A00C3; Thu, 21 Apr 2022 05:45:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 905E3410FA; Thu, 21 Apr 2022 05:45:23 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80042.outbound.protection.outlook.com [40.107.8.42]) by mails.dpdk.org (Postfix) with ESMTP id D4122410E1 for ; Thu, 21 Apr 2022 05:45:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MsWh2PPnw/tYlKzyohZ51oqCasXbxVPa2OiN+PePtP2KxHXIXfOtoOUpRBwi8HbKcClB1/hl9MxxfxT/9SfS6pCOczTNaS+hBPL6c3a0pGFx8nSAG5nvKfOUBX+nosyLVxwfEEmyUhcDvY3r6y2ouC0wXFb8+1Ae8qlWuYzZAnASiC9od3jMe7TvAjwKICpw4AdDhR4aVQmklWaNv5sS4pSL+wu2M8B6Wz6WSJA8QlziFlA5sWnUJ9yyDg1WYixxnNMGSW2fgc99jEslAjHb0xsS++WC8i2dKp1O3nkPekkR6rmfWqVz+eIsZUtV61f+teyrdZY8sYy5NeV0PI9VwA== 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=SbVW09NtYRGW/5NEqpnF20k3mHm0FWJ9PhOVWFZWcFg=; b=AdIt4f8vx8tYZCHQHPhdGITpe5JvnnCUdLTES2KCRMZrvJ3cyslaQSxbHMoZcF5wYJa9tB/WjYMNFKJQWhtYliI3GCg/Pej51xdyrMCCH8r6MuGJifxrSKX5QWIAxyx+6O+L/nYHIVdnPqfpkLsnRvhBD5eDKQbN8VzUjxHZO4CjngDwG5+mt4VapVOWEyZYKRvAmsrmwRNWVd4yICxxrYFfZuD3pdYXfMk6PwCJfjEUtYmNOGfSf/s6A1xxQpUrN/bZSiHsArT/k6Y8ZINpVfViW8g+9ymEWYQdUEe2D/q+Rc3/1nPZXhqVs3LWdaWBOM/scHD7uL5Wdm5KvhbY+w== 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=SbVW09NtYRGW/5NEqpnF20k3mHm0FWJ9PhOVWFZWcFg=; b=adcQGrjEjCxO3LWdOoJiIFidDXV8ikjb1G+kPKOBn4Z4VHQPbYy7GoIVPljgYK9EGLCYY6E5pm8zhX16LB17NNpn2zLwKOHzG1g/l1T6gKGFqUUdmEVr2Ot8KkgBELkaauPDtA+CB3JFDWZvBYB0aG/TFRMMq98NZMqoVbIpRJs= 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 AM0PR04MB6035.eurprd04.prod.outlook.com (2603:10a6:208:138::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Thu, 21 Apr 2022 03:45:20 +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 03:45:20 +0000 From: Gagandeep Singh To: dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH v2] kni: update kernel API to receive packets Date: Thu, 21 Apr 2022 09:15:02 +0530 Message-Id: <20220421034502.1987597-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220420050309.1055593-1-g.singh@nxp.com> References: <20220420050309.1055593-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0043.apcprd02.prod.outlook.com (2603:1096:4:196::12) 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: dec8ef4c-af1f-4a7f-1a88-08da23495b4f X-MS-TrafficTypeDiagnostic: AM0PR04MB6035: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: UBfxskt1zq3szOJulljXwYRHeQdWUg+kQkOSFJU1CppXPDrlKqB9zCaQc9Bjy5jZcBGKrOGxjawEv01snMEmt3I5t32oI1DlQPB0skhuFoADQG81rMuoMCew/ivcURbbifWjI1tRnpXmrxzUKnGv/K1lJOttyWzwZQe4RODyVF+wj5sKmfQbsyQRvz9Jg3vPTCdz8EbjizTqBkwX4xu6IyYdOzgYrdVKn/pNJHFj6p4N+zrQiwI3TkFsZAT75dtzvZk7qvj4rsKG0qu8WD+29zrFrGVpo+gA0X8gpyDJ8i5C/Oe+xHsxo4lHjdcuiUm/EYmrSd1QRArGo/zaQcEj5nPL9e9JzBTnAny+2n8uYWySu29mlLr9uUB8wJ+RIzWETkeTcMwQHKCqaIFfCI31nsRoOokELe9/4KAS6hFocW9hP5otNjpBT6OPZyfo+iA8XVcERed8DDJgvcJEl5WrfAcqNKEsOl8yiK3+t23w1zwwU0U6oxYye7Q0Q6AN75EEJrw2HqRJFpOS8PtMW634BokwXDfvxHZaQy21bE+hvrXQFwQ96mLMC1Z62nsfpemMh4F2BFDwjrKf/DoanbHR/gUyIjsDmlRPexQomR9IHsbTS99SRbbtGlb0Mxkz6+C9KWT2jbaVkji19vLRNZNiope5kfSFxmdAViT6P43GY8VcZcgOz4QN/JP0m1NORihuRUPqQYJ1rH9T0CyGQGoWuw== 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)(55236004)(6506007)(6486002)(6666004)(52116002)(508600001)(316002)(83380400001)(66556008)(4326008)(66946007)(8676002)(66476007)(36756003)(186003)(26005)(15650500001)(5660300002)(6512007)(38100700002)(86362001)(38350700002)(6916009)(4744005)(2616005)(8936002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2Y9Uz1ugzoBeBm1j14Dnw9CUvM3+WOOdXCs/gdxQBsE0zIp8jrdzUKEg7mmK?= =?us-ascii?Q?l3WDbIkeU0x9t6bf0aKk+Nk6QPbG2HhGAnn7xJpACnnuAY5exGoFwuq3YaOz?= =?us-ascii?Q?sf1p4eNEipRZGvXzwp/SV0zVdVh1Z7NuGeY8WaCyHKzNigvnG1VFPQlmZBVy?= =?us-ascii?Q?YwDcSvhq+JnZ1VstWCyJ7JNL9Lsz79XLNALy6/vqtVHQ/sE9kVu6fcJ0zXJ7?= =?us-ascii?Q?JEfgUH+GhWq661y3xXdLml3/XTjjdKzjP85g+jNT1n4VXVfBXCIC3hIGtAur?= =?us-ascii?Q?3hUkpNXTjQfhw4eSZegs3OvebgZHUsLNHnSKJ3kAePXuIPyncfbf6Dj0eEsX?= =?us-ascii?Q?ppKw0e2QfooroajnBBwkv2LWFPl+tAOSW1w6PJazhpy+JoMIW+LyocNRA7YW?= =?us-ascii?Q?xDs12TdbMtlq1d45Jqxq3Rr8pDyGyn65o2iKckVfCCm9xlDbgXPPdHk39EKl?= =?us-ascii?Q?JxnlF4rriFRpn5znMkpgvTisLNCxyHYlSuW3OLVIB8eVlccna5RbaQNmyUqZ?= =?us-ascii?Q?zVP+AdNjiU+GAOS99oGvJnv2YAcFz7PAURWfo50yEps4dglysJa7/vkO6Y1d?= =?us-ascii?Q?LyjWceUU8x+RarT58i0hzFxtaKANaXr/I5SeMCgpXll1uTHU0LoYXFop6mD8?= =?us-ascii?Q?nWw/4jrjb+t0STMHFD//9eNmomj3/6G9WY/DzC3q/uG4V+tOkaCwFVl5RAMK?= =?us-ascii?Q?NP5qGShUOFokDvct3r+bpwLmjDaxrv6AEAoVcUw8ZJRCIVdEQ5K2z4qulwHL?= =?us-ascii?Q?DkAri13iOyv5xdmVcAkIRS/QtvAImWFKLGaJraaNzaYAIDFZYCdlbfGCTpv4?= =?us-ascii?Q?0TnCzk7J4aCv4lJy9/gz5ko6N34ql4jnsAhSwPJINBU2bDoHNNK7D3ndhXy9?= =?us-ascii?Q?SVzElXsQNS8dlP32ELXhrmhydTfDzAaKFji008qLXWY1liGJ+XEkfMfkY0qO?= =?us-ascii?Q?aconkw9Pi3eIcLs4pkpge4Md2LW3qAC12jlaPnC3BJ1xiYGSfGqp6VN7ls48?= =?us-ascii?Q?aEhv5Yhhqxh7oNI2bXf6snXRFKkWc51OMgvMD2hgm058Xu6FYR4h/PrdVUfv?= =?us-ascii?Q?lNel+4i2o1LrL3ONsriEhi5d2J8z8DoIXQzpJyRgv54JR/U663+hucgHF6Lw?= =?us-ascii?Q?6UGgR0/jvWj2blyzNryA9OiJULF63wpzjyzbooXFzn5VfyYNfu3PZ6WI0rsK?= =?us-ascii?Q?5fDdfID7td36nWVUFYY6CZhGavlZT2Da14irNeBTD3gOqX9nR0CXIIMp+EYc?= =?us-ascii?Q?Z4psYpxl4PvyhCKezwPzYfj7t4UnuzBrecq6MQComHitAEYjxJPylgl5ynv7?= =?us-ascii?Q?OXyKtHStnqNm/niTQFKXHDe1FYffFNiEYfsMlpICE9Wr5Tg1LosO4hBZNZtd?= =?us-ascii?Q?4vfL57MHEK/Sn+B4bh7adxZiFQnhiTZhBi+njva007WmX7Z9m+OTkSYBNOdq?= =?us-ascii?Q?sk3Wmy6pvBDzwpQAZM12KpBsMMn90s28odeSA3gkygN9UOqxxbDKXuQ4geub?= =?us-ascii?Q?DVF1b1dA52w807vJocbqUAuwbzcwRyzSmcasQzR25tJAKvyICxYO5AThvr5N?= =?us-ascii?Q?u8IoQ5UYp7jJpm/aqApxowgnfYzXVc3DzwjlzkUlIQiijs172rWjpoX8bn1q?= =?us-ascii?Q?LJFQtGQAThYQ1vOPeYKq9K+S4zBtHYYUQVTOj2WqqFCJ0+wpGEx9/XQRal6F?= =?us-ascii?Q?9gwrt+8AWt9cWgs2TbAjIhYQ7pSXen/vD6KsB1BZb9GY7kX7KQ7ghiubOoMM?= =?us-ascii?Q?l4l4uqGIBQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dec8ef4c-af1f-4a7f-1a88-08da23495b4f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 03:45:20.3635 (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: nqJK+ngpr5Z2VP6l2s2tvdl6LaftylEpW63erbAa1/YQCgbypS0EHNn9ZPtWQZKN X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6035 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 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 + netif_rx(skb); +#else netif_rx_ni(skb); +#endif /* Update statistics */ dev->stats.rx_bytes += len; -- 2.25.1