DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gagandeep Singh <G.Singh@nxp.com>
To: Harold Huang <baymaxhuang@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] kni: update kernel API to receive packets
Date: Fri, 15 Apr 2022 04:07:19 +0000	[thread overview]
Message-ID: <AS8PR04MB8198CD635DAEAEA76B18FCB8E1EE9@AS8PR04MB8198.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAHJXk3ZXbscD6FhOZq3ePfiOXJkZ_s=ix179fzYEp4HHT=se4w@mail.gmail.com>

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.

  reply	other threads:[~2022-04-15  4:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 12:23 Gagandeep Singh
2022-04-15  3:24 ` Harold Huang
2022-04-15  4:07   ` Gagandeep Singh [this message]
2022-04-15 12:30     ` Ferruh Yigit
2022-04-15 14:59       ` Stephen Hemminger
2022-04-18 11:33         ` Gagandeep Singh
2022-04-20  5:03 ` Gagandeep Singh
2022-04-20  7:45   ` Wang, Haiyue
2022-04-20 10:39     ` Gagandeep Singh
2022-04-21  3:45   ` [PATCH v2] " Gagandeep Singh
2022-04-21  8:29     ` Ferruh Yigit
2022-04-21  8:59     ` [PATCH v3] " Gagandeep Singh
2022-05-23  9:15       ` Min Hu (Connor)
2022-06-26 13:25       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8PR04MB8198CD635DAEAEA76B18FCB8E1EE9@AS8PR04MB8198.eurprd04.prod.outlook.com \
    --to=g.singh@nxp.com \
    --cc=baymaxhuang@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).