[PATCH] kni: update kernel API to receive packets

Harold Huang baymaxhuang at gmail.com
Fri Apr 15 05:24:19 CEST 2022


On Thu, Apr 14, 2022 at 8:23 PM Gagandeep Singh <g.singh at 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 at 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.


More information about the dev mailing list