From: Dan Gora <dg@adax.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Dan Gora <dg@adax.com>
Subject: [dpdk-dev] [PATCH] kni: fix build on Centos 7.4 when Ethtool enabled
Date: Mon, 21 May 2018 21:18:35 -0300 [thread overview]
Message-ID: <20180522001835.9843-1-dg@adax.com> (raw)
Fix compilation errors on Centos 7.4 when CONFIG_RTE_KNI_KMOD_ETHTOOL
is set to 'y'.
Centos 7.4 needs HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL:
igb_main.c: In function ‘igb_ndo_bridge_getlink’:
igb_main.c:2289:2: error: too few arguments to function
‘ndo_dflt_bridge_getlink’
return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags);
^
Centos 7.4 needs HAVE_VF_VLAN_PROTO and needs to redefine
ndo_set_vf_vlan to .extended.ndo_set_vf_vlan:
igb_main.c:2318:2: error: unknown field ‘ndo_set_vf_vlan’ specified
in initializer
.ndo_set_vf_vlan = igb_ndo_set_vf_vlan,
^
Signed-off-by: Dan Gora <dg@adax.com>
---
kernel/linux/kni/ethtool/igb/kcompat.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index fd3175b5d..3effbeeac 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3900,7 +3900,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
#define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS
#endif /* >= 4.1.0 */
-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) )
+#if (( LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) ) \
+ || ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) ))
/* ndo_bridge_getlink adds new filter_mask and vlan_fill parameters */
#define HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL
#endif /* >= 4.2.0 */
@@ -3920,6 +3921,11 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) || \
(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12, 3, 0)))
#define HAVE_VF_VLAN_PROTO
+#elif ( RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4) )
+/* In RHEL/Centos 7.4, the "new" version of ndo_set_vf_vlan
+ * is in the net_device_ops_extended struct */
+#define HAVE_VF_VLAN_PROTO
+#define ndo_set_vf_vlan extended.ndo_set_vf_vlan
#endif /* >= 4.9.0, >= SLES12SP3 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
--
2.13.2.556.g5116f79
next reply other threads:[~2018-05-22 0:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 0:18 Dan Gora [this message]
2018-05-22 10:25 ` Ferruh Yigit
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=20180522001835.9843-1-dg@adax.com \
--to=dg@adax.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/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).