[PATCH] kni: update kernel API to receive packets

Gagandeep Singh G.Singh at nxp.com
Mon Apr 18 13:33:01 CEST 2022



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Friday, April 15, 2022 8:30 PM
> To: Ferruh Yigit <ferruh.yigit at xilinx.com>
> Cc: Gagandeep Singh <G.Singh at nxp.com>; Harold Huang
> <baymaxhuang at gmail.com>; dev at 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 at 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. 


More information about the dev mailing list