kni: fix build for debian kernel 3.2
PATCH 1/1 kni: fix build for debian kernel 3.2
Following debian kernel headers upgrade to 3.2.57-3, pci capability accessors have been backported (upstream commit 8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca, ("PCI: Add accessors for PCI Express Capability", v3.7-rc1)).
It results in the same compilation error as redhat 6.x.
However, there is no clear way to determine we are building on a debian kernel. So, rather than determine if we are building on a distribution kernel, look at PCI_EXP_LNKSTA2 that appeared in this upstream commit.
--- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +2 -4
@@ -3691,8 +3691,7 @@ static inline u8 pci_pcie_type(struct pci_dev *pdev) #define ptp_clock_register(caps, args...) ptp_clock_register(caps) -#if !(SLE_VERSION_CODE &&SLE_VERSION_CODE >=SLE_VERSION (11 ,3 ,0 )) && \ - !(RHEL_RELEASE_CODE &&RHEL_RELEASE_CODE >=RHEL_RELEASE_VERSION (6 ,5 )) +#ifndef PCI_EXP_LNKSTA2 int __kc_pcie_capability_read_word (struct pci_dev *dev,int pos,u16 *val);#define pcie_capability_read_word (d,p,v) __kc_pcie_capability_read_word(d,p,v)int __kc_pcie_capability_write_word (struct pci_dev *dev,int pos,u16 val);
@@ -3709,8 +3708,7 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, {return __kc_pcie_capability_clear_and_set_word (dev, pos, clear,0 ); } -#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ -!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */ +#endif /* !PCI_EXP_LNKSTA2 */ #if (SLE_VERSION_CODE &&SLE_VERSION_CODE >=SLE_VERSION (11 ,3 ,0 ))#define USE_CONST_DEV_UC_CHAR
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1398780963-3694-1-git-send-email-david.marchand-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Neil Horman
Acked-byQuoted 42 lines · David Marchand
Following debian kernel headers upgrade to 3.2.57-3, pci capability accessors have been backported (upstream commit
8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca, ("PCI: Add accessors for PCI Express Capability", v3.7-rc1)).It results in the same compilation error as redhat 6.x.
However, there is no clear way to determine we are building on a debian kernel. So, rather than determine if we are building on a distribution kernel, look atPCI_EXP_LNKSTA2that appeared in this upstream commit.Signed-off-by David Marchand <[email protected]>--- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +2
-4@@ -3691,8 +3691,7 @@ static inline u8 pci_pcie_type(struct pci_dev *pdev) #define ptp_clock_register(caps, args...) ptp_clock_register(caps) -#if !(SLE_VERSION_CODE &&SLE_VERSION_CODE >=SLE_VERSION (11 ,3 ,0 )) && \ - !(RHEL_RELEASE_CODE &&RHEL_RELEASE_CODE >=RHEL_RELEASE_VERSION (6 ,5 )) +#ifndef PCI_EXP_LNKSTA2 int __kc_pcie_capability_read_word (struct pci_dev *dev,int pos,u16 *val);#define pcie_capability_read_word (d,p,v) __kc_pcie_capability_read_word(d,p,v)int __kc_pcie_capability_write_word (struct pci_dev *dev,int pos,u16 val);@@ -3709,8 +3708,7 @@ static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, {return __kc_pcie_capability_clear_and_set_word (dev, pos, clear,0 ); } -#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) && \ -!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) */ +#endif /* !PCI_EXP_LNKSTA2 */ #if (SLE_VERSION_CODE &&SLE_VERSION_CODE >=SLE_VERSION (11 ,3 ,0 ))#define USE_CONST_DEV_UC_CHAR Signature · 1 line
1.7.10.4
Though, not to grind on this issue, but if the PMDs for real hardware were converted to use VFIO, the kni interface wouldn't really be needed anymore, nor would any of the other kernel code being maintained out of tree here
Neil
A message that is not in the archive (sent off-list or not yet received): 20140429142344.GB14945-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]
2014-04-29 10:23, Neil Horman:
Quoted 6 lines · David Marchand
Quoted 5 lines
Following debian kernel headers upgrade to 3.2.57-3, pci capability accessors have been backported (upstream commit
8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca, ("PCI: Add accessors for PCI Express Capability", v3.7-rc1)).
Quoted 8 lines
Quoted 6 lines
It results in the same compilation error as redhat 6.x. However, there is no clear way to determine we are building on a debian kernel. So, rather than determine if we are building on a distribution kernel, look at
PCI_EXP_LNKSTA2that appeared in this upstream commit.Signed-off-by David Marchand <[email protected]>Acked-by Neil Horman <[email protected]>
Applied for version 1.6.0r2.
Thanks
Signature · 1 line
Thomas