* [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11
@ 2017-05-03 16:00 Ferruh Yigit
2017-05-03 16:39 ` Nicolas Dichtel
0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-05-03 16:00 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit, Nicolas Dichtel
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.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
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(+)
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index c0d52db..5f1f3a6 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -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;
}
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 4abab4a..4c52da3 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -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_ */
--
2.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11
2017-05-03 16:00 [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11 Ferruh Yigit
@ 2017-05-03 16:39 ` Nicolas Dichtel
2017-05-03 16:43 ` Ferruh Yigit
0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Dichtel @ 2017-05-03 16:39 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev
Le 03/05/2017 à 18:00, Ferruh Yigit a écrit :
> 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.
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11
2017-05-03 16:39 ` Nicolas Dichtel
@ 2017-05-03 16:43 ` Ferruh Yigit
2017-05-03 17:06 ` Nicolas Dichtel
0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-05-03 16:43 UTC (permalink / raw)
To: nicolas.dichtel, Thomas Monjalon; +Cc: dev
On 5/3/2017 5:39 PM, Nicolas Dichtel wrote:
> Le 03/05/2017 à 18:00, Ferruh Yigit a écrit :
>> 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.
> 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
>
> Exemple :
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da6f4cf58e40
>
>
> Regards,
> Nicolas
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11
2017-05-03 16:43 ` Ferruh Yigit
@ 2017-05-03 17:06 ` Nicolas Dichtel
2017-05-05 13:46 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Dichtel @ 2017-05-03 17:06 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev
Le 03/05/2017 à 18:43, Ferruh Yigit a écrit :
> On 5/3/2017 5:39 PM, Nicolas Dichtel wrote:
>> Le 03/05/2017 à 18:00, Ferruh Yigit a écrit :
>>> 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.
>> 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.
Ok.
>
> 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 <nicolas.dichtel@6wind.com>
Regards,
Nicolas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11
2017-05-03 17:06 ` Nicolas Dichtel
@ 2017-05-05 13:46 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-05-05 13:46 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, nicolas.dichtel
03/05/2017 19:06, Nicolas Dichtel:
> Le 03/05/2017 à 18:43, Ferruh Yigit a écrit :
> > On 5/3/2017 5:39 PM, Nicolas Dichtel wrote:
> >> Le 03/05/2017 à 18:00, Ferruh Yigit a écrit :
> >>> 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.
> >> 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.
> Ok.
>
> >
> > 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 <nicolas.dichtel@6wind.com>
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-05 13:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 16:00 [dpdk-dev] [PATCH] kni: fix ethtool build with kernel 4.11 Ferruh Yigit
2017-05-03 16:39 ` Nicolas Dichtel
2017-05-03 16:43 ` Ferruh Yigit
2017-05-03 17:06 ` Nicolas Dichtel
2017-05-05 13:46 ` Thomas Monjalon
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).