kni: fix ethtool build with kernel 4.11
PATCH 1/1 kni: fix ethtool build with kernel 4.11
build error:.../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration]
err = pci_enable_msix(pdev,
^~~~~~~~~~~~~~~
This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option enabled.
Following Linux commit removes the pci_enable_msix()
Linux: 4244de1c64de ("PCI: remove pci_enable_msix")
Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux igb driver uses this function.
---
Cc: Nicolas Dichtel <[email protected]>
--- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 7 +++++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 ++++ 2 files changed, 11 insertions(+)
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +7 -0
@@ -1031,8 +1031,15 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)for (i =0 ; i < numvecs; i++) adapter->msix_entries[i].entry = i; +#ifdef HAVE_PCI_ENABLE_MSIX err =pci_enable_msix (pdev, adapter->msix_entries, numvecs); +#else + err =pci_enable_msix_range (pdev, + adapter->msix_entries, + numvecs, + numvecs); +#endif if (err ==0 )break ; }
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +4 -0
@@ -3937,4 +3937,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)#define HAVE_VF_VLAN_PROTO #endif /* >= 4.9.0, >= SLES12SP3 */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,8 ,0 ) +#define HAVE_PCI_ENABLE_MSIX +#endif +#endif /* _KCOMPAT_H_ */
Signature · 1 line
2.9.3
Quoted 7 lines · Ferruh Yigit
build error:
.../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration]
err = pci_enable_msix(pdev,
^~~~~~~~~~~~~~~
Quoted 8 lines
This build error observed when
CONFIG_RTE_KNI_KMOD_ETHTOOLconfig option enabled.Following Linux commit removes the
pci_enable_msix()
Linux:4244de1c64de("PCI: removepci_enable_msix")Switch to
pci_enable_msix_range()for kernel > 4.8 since current Linux igb driver uses this function.
When looking at the kernel patches, it seems that the way to go is to use pci_alloc_irq_vectors(), but it needs a bit more work.
Exemple :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da6f4cf58e40
Regards,
Nicolas
Quoted 11 lines · Nicolas Dichtel
Quoted 10 lines · Ferruh Yigit
build error:
.../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration]
err = pci_enable_msix(pdev,
^~~~~~~~~~~~~~~This build error observed when
CONFIG_RTE_KNI_KMOD_ETHTOOLconfig option enabled.
Quoted 7 lines
Quoted 5 lines
Following Linux commit removes the
pci_enable_msix()
Linux:4244de1c64de("PCI: removepci_enable_msix")Switch to
pci_enable_msix_range()for kernel > 4.8 since current Linux igb driver uses this function.When looking at the kernel patches, it seems that the way to go is to use
pci_alloc_irq_vectors(), but it needs a bit more work.
I remember this from your igb_uio fix, but latest igb kernel driver uses pci_enable_msix_range(), I found it easy and safe to replicate it.
We can update it when kernel igb driver updates the code, unless you have a strong opinion to switch pci_alloc_irq_vectors() in advance?
Thanks,
ferruh
Quoted 8 lines
Exemple :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da6f4cf58e40Regards,
Nicolas
Nicolas Dichtel
Acked-byQuoted 15 lines · Ferruh Yigit
Quoted 14 lines · Nicolas Dichtel
Quoted 13 lines · Ferruh Yigit
build error:
.../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration]
err = pci_enable_msix(pdev,
^~~~~~~~~~~~~~~This build error observed when
CONFIG_RTE_KNI_KMOD_ETHTOOLconfig option enabled.Following Linux commit removes the
pci_enable_msix()
Linux:4244de1c64de("PCI: removepci_enable_msix")
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Switch to
pci_enable_msix_range()for kernel > 4.8 since current Linux igb driver uses this function.When looking at the kernel patches, it seems that the way to go is to use
pci_alloc_irq_vectors(), but it needs a bit more work.I remember this from your
igb_uiofix, but latest igb kernel driver usespci_enable_msix_range(), I found it easy and safe to replicate it.
Ok.
Quoted 3 lines
We can update it when kernel igb driver updates the code, unless you have a strong opinion to switch
pci_alloc_irq_vectors()in advance?
No, I don't mind.
Regards,
Nicolas
Thomas Monjalon
Applied03/05/2017 19:06, Nicolas Dichtel:
Quoted 23 lines · Ferruh Yigit
Quoted 15 lines · Nicolas Dichtel
Quoted 14 lines · Ferruh Yigit
Quoted 13 lines
build error:
.../build/build/lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’ [-Werror=implicit-function-declaration]
err = pci_enable_msix(pdev,
^~~~~~~~~~~~~~~This build error observed when
CONFIG_RTE_KNI_KMOD_ETHTOOLconfig option enabled.Following Linux commit removes the
pci_enable_msix()
Linux:4244de1c64de("PCI: removepci_enable_msix")Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Switch to
pci_enable_msix_range()for kernel > 4.8 since current Linux igb driver uses this function.When looking at the kernel patches, it seems that the way to go is to use
pci_alloc_irq_vectors(), but it needs a bit more work.I remember this from your
igb_uiofix, but latest igb kernel driver usespci_enable_msix_range(), I found it easy and safe to replicate it.
Quoted 8 lines
Ok.
Quoted 3 lines
We can update it when kernel igb driver updates the code, unless you have a strong opinion to switch
pci_alloc_irq_vectors()in advance?No, I don't mind.
Acked-by Nicolas Dichtel <[email protected]>
Applied, thanks