DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: Gagandeep Singh <g.singh@nxp.com>, <dev@dpdk.org>
Subject: Re: [PATCH v3] kni: update kernel API to receive packets
Date: Mon, 23 May 2022 17:15:32 +0800	[thread overview]
Message-ID: <8f4f1ab9-2c21-1495-77c4-36665314d081@huawei.com> (raw)
In-Reply-To: <20220421085931.2429443-1-g.singh@nxp.com>


Acked-by: Min Hu (Connor) <humin29@huawei.com>
在 2022/4/21 16:59, Gagandeep Singh 写道:
> 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 <g.singh@nxp.com>
> 
> 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;
> 

  reply	other threads:[~2022-05-23  9:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 12:23 [PATCH] " Gagandeep Singh
2022-04-15  3:24 ` Harold Huang
2022-04-15  4:07   ` Gagandeep Singh
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) [this message]
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=8f4f1ab9-2c21-1495-77c4-36665314d081@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    /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).