[dpdk-dev] [PATCH 0/2] kni: fix build with kernel 4.1

Miguel Bernal Marin miguel.bernal.marin at linux.intel.com
Fri Jun 26 16:36:41 CEST 2015



On 06/25/2015 04:56 PM, De Lara Guarch, Pablo wrote:
> Hi Miguel,
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Miguel Bernal
>> Marin
>> Sent: Thursday, June 25, 2015 8:10 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH 0/2] kni: fix build with kernel 4.1
>>
>> Due to API changes in netdevice.h in 4.1 kernel release, KNI modules
>> would not build.  This patch set adds the properly checks to fix
>> compilation.
>>
>> Miguel Bernal Marin (2):
>>    kni: fix igb_ndo_bridge_getlink in 4.1
>>    kni: fix header_ops in 4.1
>>
>>   lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 10 ++++++++++
>>   lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  5 +++++
>>   lib/librte_eal/linuxapp/kni/kni_net.c              |  4 ++++
>>   3 files changed, 19 insertions(+)
>>
>> --
>> 2.3.3
>
> I have tested your fix and it works for kernel 4.1, but I get and error if CONFIG_RTE_KNI_VHOST=y:
>
>    CC [M]  /root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.o
> /root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.c:593:2: error: initialization from incompatible pointer type [-Werror]
>    .sendmsg = kni_sock_sndmsg,
>    ^
> /root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.c:593:2: error: (near initialization for 'kni_socket_ops.sendmsg') [-Werror]
> /root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.c:594:2: error: initialization from incompatible pointer type [-Werror]
>    .recvmsg = kni_sock_rcvmsg,
>    ^
> /root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.c:594:2: error: (near initialization for 'kni_socket_ops.recvmsg') [-Werror]
> cc1: all warnings being treated as errors
> /home/kernel_test/kernels_rc/linux-4.1/scripts/Makefile.build:258: recipe for target '/root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.o' failed
> make[10]: *** [/root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/kni_vhost.o] Error 1
> /home/kernel_test/kernels_rc/linux-4.1/Makefile:1383: recipe for target '_module_/root/dpdk-latest/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni' failed
>
> The fix for this is to remove struct socket *sock from  kni_sock_sndmsg and kni_sock_rcvmsg in kni_vhost.c.
>
> Could you send a v2 with this fix as well?


Sure, I forgot to enable KNI_VHOST with 4.1.
Doing V2 and sending


>
> Thanks for this,
> Pablo
>
>


More information about the dev mailing list