Message ID | 20220414122319.3519271-1-g.singh@nxp.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D3393A0508; Thu, 14 Apr 2022 14:23:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B205140694; Thu, 14 Apr 2022 14:23:46 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2085.outbound.protection.outlook.com [40.107.22.85]) by mails.dpdk.org (Postfix) with ESMTP id 7EC3840687 for <dev@dpdk.org>; Thu, 14 Apr 2022 14:23:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3hgZ2e911QyB/vBIhEc5WtCVr5vzWuOzUQvZ3XjjVKBB50QYa7BM6Lkz+GZO0MLbDiKscFMcRMUXxuWdSVR/NVkcWcAaPOaqV/VtiHgJsYO7aYiJXuT63JK2RPjv2SEoiweKHXG6e2R3AoSN7jGVxconTNZOx8/bbJpYHRAcAFb33cC+tnLIzp1xpGdl/2gyYa+iyH3p07aON4DW/tYtwW30k0iMqzSxX1kRBOLPE4X4ybh/muYBtzViBiJRgB9f+tNdzveN92DA6z1IVwjfjz+XgFBPgJIxO3eitlirahSHFNlt7lMiQYY5kM3V9oV58a10Vu32tuIYjJD9udGCw== 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=vN/1VW4YKjzaVt4HAe0A64Q8AHvkUquKQT5iRkWBGKw=; b=TXH0bOxZemkYodMBEhQddliTsww/HRBZJ2rk0/jwooFynedcHqtAD5Op3NMI/I5NR13PuGi8gQnq7epbvh6HPyff96kapo46M24SCei0tqIouejhC1kfGV/2IIIlpMlv8SRD5xxRzE2rddqBfjY/iqxByxoqvLGhJNzhyIpih6sgBtxuss14zCmesLrG7o20nL88gq+wa4Xs5YyJMwKHRz+cBSjyCKyYWl6pDwECJR0gMrkHNFYP0TSDuxRoZ6hLSXBb/U+pNr77qjhwxhPhuLZsucORgql1u3EqeNfmZR48MBe7TfBVsYn6kzH5P405jBmZBroANz3QOVCQODhrBg== 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=vN/1VW4YKjzaVt4HAe0A64Q8AHvkUquKQT5iRkWBGKw=; b=B8MkY4jLUrS2iXDULXUigrRBMnSX5mwQoqoq1LgLKOyXOYRDWEQoQkpbP0GMeqLLHrnMUJUlP7KF43Jp9ZAzddluHez+osP1AxouCu8teyjFcWN/8i2o86mGzPKmdwBmtSJci5Hnc4tHhogufj5xyVgQc6zZAMgP/3DevFxMsGo= 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 DBBPR04MB6140.eurprd04.prod.outlook.com (2603:10a6:10:c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.30; Thu, 14 Apr 2022 12:23:43 +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.5144.030; Thu, 14 Apr 2022 12:23:43 +0000 From: Gagandeep Singh <g.singh@nxp.com> To: dev@dpdk.org Cc: Gagandeep Singh <g.singh@nxp.com> Subject: [PATCH] kni: update kernel API to receive packets Date: Thu, 14 Apr 2022 17:53:19 +0530 Message-Id: <20220414122319.3519271-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0206.apcprd06.prod.outlook.com (2603:1096:4:68::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: 1a345e23-701b-4115-3db6-08da1e119cf6 X-MS-TrafficTypeDiagnostic: DBBPR04MB6140:EE_ X-Microsoft-Antispam-PRVS: <DBBPR04MB6140330C1B240C986A5FB57EE1EF9@DBBPR04MB6140.eurprd04.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hxp+1AnyksPJIVZUDdJ+ef2SEKnovH/hIbVbNx0ed0LtHyXwDGwi0+A61iDLUAGG3q7wREIso9hXHIlmSSqiJ8FDByDZjNSgsSXTmhTVjPFWxHPm/+f7sZUUwvMSt/gEf3XHKgEDitNimSGNv3H5kc3kuyNAo8M3UWKUyAUEsznAIQ5yTPz7vaaNjxEzIwVcTgsnzTE5eXKEXOrNBui1XL+y7AsM9pnTE99Nx7pPYzQgJ0oXT+F8HKP4jRQpcoC221z6YkSv1X6/S+thpGrOuaRfePh74v7TMT4B11l+9STVTSlLBAQNKpy8rKqJb0YsECjjjzlUe1E8pPRdq7ctAe7Z3zEIdtOYlKshe1u//lHobRMJj4res2j+pOVv+sJD9xhDzqiuBpBsIgEBU+fPrttYqaPizCjgaGxHaXjEiWaKIVideZJXHdX2yfVubDvJGWsYomeiGb3lZVIGdnHIVK8VXuC3krr3AXAU53HfqHuMcsdMNTIa/WvyuciVlxZf6OJFjxqDvdD5hGhUlb6X/7EOM+FtFCy7JpzUOXSH5bcho7VKpycAyQ6Uxdc/AQzkLOBftGMfxhRPP2FlzDgmocpOm8f9/HlqK1NpSE5DLTIIJjmsart0HrXXKJQDj4BzVLcBYnQtNOsGqkk0a30Vq4W/Xzs/rLHAeX4futcB//OndF1l8BUGco9MH9bWstvkQeguTKdfWmPE5ih+7ITIAA== 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)(6486002)(4744005)(6512007)(6666004)(1076003)(508600001)(316002)(2906002)(66556008)(8936002)(186003)(86362001)(66946007)(38350700002)(38100700002)(2616005)(26005)(66476007)(6916009)(4326008)(8676002)(55236004)(6506007)(5660300002)(83380400001)(52116002)(36756003)(15650500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oVyBZJdSnGEad2tj/DzUkhCAgZjLJ6OQ8c+GZrsHwkDjX6i57ncjvcKQCbC3BpYQ8ah9+7woH60mEd1PUIw/sMXt6A7z2fvYqhAnQWSHYdhaNzOafqimPI1IsPEI5IR0HuJv4cO9MBfed0j7OvjFbetYrcx9rfCSNPdeSR3ZBiJslu+J+mdK+kwYeaaroF7k5CyCj+q/N1FeNYrUV1W+tyXMG5fD/DTKiXejvCQ7D2WrPftDc3iVM2MFpzwPAKguwiJd0Np7iabxlM2YAItx30eAfh/EQZjl+VB5QfD1Tt7Qr5/wAZrhjO/Mq3PSY4KJq1Iwd3Db1tnHpdGjZcjdGULj72b7ykRU9IgAsD8nX2GDl0XneG/OpUd9Oc6d1ZIA5FL5pAVNWK8xn9cMJ/2qf4O1eShYS9fGb6gKd0q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4L0rdGv618yR9XRbmjb6dro71RgafCavUp8Gk36bEdDhW6dlr7TNNOvkY6ZoXBCPVZcCvNzIZU5GOFIwtEXwOeDwQfUtk28P2EL9Rwl1HnWdD+E2gsYeH1NH4qdhkT6PfIVwUIsfjwbAo/n5gwitCJrJxGqvNsQDTpAVMA4IHGLVJ/fNaXFiFa3PnLUxW5LH7QtxW7CY2roN1TNp49D5BBGasSbqQaZKGlUxdphGRK8eUA9WWm8vgACBq12ug== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a345e23-701b-4115-3db6-08da1e119cf6 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2022 12:23:43.1443 (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: r3EH12KpV4KkXGUcCiSY2KySo3beocQZEO0YCyBI8xbFBnBpxT86SD9TkXGRznQ1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6140 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
kni: update kernel API to receive packets
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | warning | coding style issues |
ci/Intel-compilation | success | Compilation OK |
ci/iol-mellanox-Performance | success | Performance Testing PASS |
ci/iol-intel-Functional | success | Functional Testing PASS |
ci/github-robot: build | success | github build: passed |
ci/iol-intel-Performance | fail | Performance Testing issues |
ci/iol-aarch64-unit-testing | success | Testing PASS |
ci/iol-aarch64-compile-testing | success | Testing PASS |
ci/iol-x86_64-compile-testing | success | Testing PASS |
ci/iol-x86_64-unit-testing | success | Testing PASS |
ci/iol-abi-testing | success | Testing PASS |
ci/intel-Testing | success | Testing PASS |
Commit Message
Gagandeep Singh
April 14, 2022, 12:23 p.m. UTC
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().
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
kernel/linux/kni/kni_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Apr 14, 2022 at 8:23 PM Gagandeep Singh <g.singh@nxp.com> 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. > > Signed-off-by: Gagandeep Singh <g.singh@nxp.com> > --- > 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 >
Hi > -----Original Message----- > From: Harold Huang <baymaxhuang@gmail.com> > Sent: Friday, April 15, 2022 8:54 AM > To: Gagandeep Singh <G.Singh@nxp.com> > 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 <g.singh@nxp.com> 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. 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 <g.singh@nxp.com> > > --- > > 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.
On 4/15/2022 5:07 AM, Gagandeep Singh wrote: > Hi > >> -----Original Message----- >> From: Harold Huang <baymaxhuang@gmail.com> >> Sent: Friday, April 15, 2022 8:54 AM >> To: Gagandeep Singh <G.Singh@nxp.com> >> 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 <g.singh@nxp.com> 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 <g.singh@nxp.com> >>> --- >>> 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.
On Fri, 15 Apr 2022 13:30:33 +0100 Ferruh Yigit <ferruh.yigit@xilinx.com> wrote: > >> 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() Probably best handled by #ifdef on kernel version but will be a mess for backports to distro kernels. Looks like: Older -> New netif_rx_ni netif_rx neitf_rx __netif_rx
> -----Original Message----- > From: Stephen Hemminger <stephen@networkplumber.org> > Sent: Friday, April 15, 2022 8:30 PM > To: Ferruh Yigit <ferruh.yigit@xilinx.com> > Cc: Gagandeep Singh <G.Singh@nxp.com>; Harold Huang > <baymaxhuang@gmail.com>; dev@dpdk.org > Subject: Re: [PATCH] kni: update kernel API to receive packets > > On Fri, 15 Apr 2022 13:30:33 +0100 > Ferruh Yigit <ferruh.yigit@xilinx.com> wrote: > > > >> 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() > > Probably best handled by #ifdef on kernel version but will be a mess for > backports to distro kernels. > > Looks like: > > Older -> New > netif_rx_ni netif_rx > neitf_rx __netif_rx If it is ok for everyone, I can add #ifdef for kernel version >= 5.17 to use API netif_rx, to avoid any functional/performance impact with old kernels.
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;