patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Luca Boccassi <bluca@debian.org>, dpdk stable <stable@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Christian Ehrhardt <christian.ehrhardt@canonical.com>
Subject: [dpdk-stable] [PATCH 1/3] kni: fix kernel 5.4 build - merged pci_aspm.h
Date: Mon, 21 Oct 2019 13:16:32 +0200	[thread overview]
Message-ID: <20191021111634.15500-2-christian.ehrhardt@canonical.com> (raw)
In-Reply-To: <20191021111634.15500-1-christian.ehrhardt@canonical.com>

Due to kernel change [1] pci-aspm.h no more exists and we need to
include just pci.h instead in kernels >=5.4

The failure due to that is just a not-found include:
/usr/src/dpdk-rte-kni-18.11.2/ethtool/ixgbe/kcompat.h:2225:10:
fatal error: linux/pci-aspm.h: No such file or directory
 2225 | #include <linux/pci-aspm.h>

Fix it by including just pci.h depending on kernel version we build
against.

Not applying to master branch due to kni ethtool being removed in [2]

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ce2e76a
[2]: https://git.dpdk.org/dpdk/commit/?id=ea6b39b5

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 kernel/linux/kni/ethtool/igb/kcompat.h   | 8 ++++++--
 kernel/linux/kni/ethtool/ixgbe/kcompat.h | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index f041a3ebe..74390aa5f 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -2413,13 +2413,17 @@ static inline int _kc_skb_is_gso_v6(const struct sk_buff *skb)
 
 extern void _kc_pci_disable_link_state(struct pci_dev *dev, int state);
 #define pci_disable_link_state(p, s) _kc_pci_disable_link_state(p, s)
-#else /* < 2.6.26 */
+#else /* < 2.6.26 or > 5.4 */
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) )
+#include <linux/pci.h>
+#else
 #include <linux/pci-aspm.h>
+#endif
 #define HAVE_NETDEV_VLAN_FEATURES
 #ifndef PCI_EXP_LNKCAP_ASPMS
 #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
 #endif /* PCI_EXP_LNKCAP_ASPMS */
-#endif /* < 2.6.26 */
+#endif /* < 2.6.26 or > 5.4 */
 /*****************************************************************************/
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) )
 static inline void _kc_ethtool_cmd_speed_set(struct ethtool_cmd *ep,
diff --git a/kernel/linux/kni/ethtool/ixgbe/kcompat.h b/kernel/linux/kni/ethtool/ixgbe/kcompat.h
index 419fd1f13..64d39a7ae 100644
--- a/kernel/linux/kni/ethtool/ixgbe/kcompat.h
+++ b/kernel/linux/kni/ethtool/ixgbe/kcompat.h
@@ -2221,10 +2221,14 @@ static inline int _kc_skb_is_gso_v6(const struct sk_buff *skb)
 
 extern void _kc_pci_disable_link_state(struct pci_dev *dev, int state);
 #define pci_disable_link_state(p, s) _kc_pci_disable_link_state(p, s)
-#else /* < 2.6.26 */
+#else /* < 2.6.26 or > 5.4 */
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) )
+#include <linux/pci.h>
+#else
 #include <linux/pci-aspm.h>
+#endif
 #define HAVE_NETDEV_VLAN_FEATURES
-#endif /* < 2.6.26 */
+#endif /* < 2.6.26 or > 5.4 */
 /*****************************************************************************/
 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) )
 static inline void _kc_ethtool_cmd_speed_set(struct ethtool_cmd *ep,
-- 
2.23.0


  reply	other threads:[~2019-10-21 11:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 11:16 [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Christian Ehrhardt
2019-10-21 11:16 ` Christian Ehrhardt [this message]
2019-10-21 11:16 ` [dpdk-stable] [PATCH 2/3] kni: fix kernel 5.4 build - num_online_cpus Christian Ehrhardt
2019-10-21 11:16 ` [dpdk-stable] [PATCH 3/3] kni: fix kernel 5.4 build - skb_frag_t to bio_vec Christian Ehrhardt
2019-10-21 17:30 ` [dpdk-stable] [PATCH 0/3] kni: fix kernel 5.4 builds Luca Boccassi
2019-10-24 15:58   ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021111634.15500-2-christian.ehrhardt@canonical.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=bluca@debian.org \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).