]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: fix build with old kernels
authorMoti Haimovsky <motih@mellanox.com>
Sun, 15 Jul 2018 17:31:39 +0000 (20:31 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Jul 2018 12:05:52 +0000 (14:05 +0200)
This commit fixes compilation errors due to missing definitions
found when compiling mlx5 PMD from DPDK 17.11-LTS on Ubuntu 12.4
with kernel 3.15.

Fixes: 75ef62a94301 ("net/mlx5: fix link speed capability information")
Fixes: 5bfc9fc112dd ("net/mlx5: use static assert for compile-time sanity checks")
Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/Makefile
drivers/net/mlx5/mlx5_defs.h
drivers/net/mlx5/mlx5_ethdev.c

index 81e35282b63adae514cc9deac6e707e22d5a264b..75bee4640bc37d12b2fbbd6a4fd2fb99b3c5209a 100644 (file)
@@ -339,6 +339,51 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
                linux/tc_act/tc_vlan.h \
                enum TCA_VLAN_PUSH_VLAN_PRIORITY \
                $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_40000baseKR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_40000baseKR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_40000baseCR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_40000baseCR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_40000baseSR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_40000baseSR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_40000baseLR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_40000baseLR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_56000baseKR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_56000baseKR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_56000baseCR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_56000baseCR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_56000baseSR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_56000baseSR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_SUPPORTED_56000baseLR4_Full \
+               /usr/include/linux/ethtool.h \
+               define SUPPORTED_56000baseLR4_Full \
+               $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_STATIC_ASSERT \
+               /usr/include/assert.h \
+               define static_assert \
+               $(AUTOCONF_OUTPUT)
 
 # Create mlx5_autoconf.h or update it in case it differs from the new one.
 
index f6ec4151ffd41d4a9668e4d43e5892481a31e0c1..439cc159f6c74825c3c6b899b8789e8616bc38f8 100644 (file)
 /* Cache size of mempool for Multi-Packet RQ. */
 #define MLX5_MPRQ_MP_CACHE_SZ 32
 
+/* Definition of static_assert found in /usr/include/assert.h */
+#ifndef HAVE_STATIC_ASSERT
+#define static_assert _Static_assert
+#endif
+
 #endif /* RTE_PMD_MLX5_DEFS_H_ */
index b8f9136fad9b5b236d6a4cc66044c3bd52fb274b..9cf2dc5f107c57316a7a608c3501f716cea8cc42 100644 (file)
 #include "mlx5_rxtx.h"
 #include "mlx5_utils.h"
 
+/* Supported speed values found in /usr/include/linux/ethtool.h */
+#ifndef HAVE_SUPPORTED_40000baseKR4_Full
+#define SUPPORTED_40000baseKR4_Full (1 << 23)
+#endif
+#ifndef HAVE_SUPPORTED_40000baseCR4_Full
+#define SUPPORTED_40000baseCR4_Full (1 << 24)
+#endif
+#ifndef HAVE_SUPPORTED_40000baseSR4_Full
+#define SUPPORTED_40000baseSR4_Full (1 << 25)
+#endif
+#ifndef HAVE_SUPPORTED_40000baseLR4_Full
+#define SUPPORTED_40000baseLR4_Full (1 << 26)
+#endif
+#ifndef HAVE_SUPPORTED_56000baseKR4_Full
+#define SUPPORTED_56000baseKR4_Full (1 << 27)
+#endif
+#ifndef HAVE_SUPPORTED_56000baseCR4_Full
+#define SUPPORTED_56000baseCR4_Full (1 << 28)
+#endif
+#ifndef HAVE_SUPPORTED_56000baseSR4_Full
+#define SUPPORTED_56000baseSR4_Full (1 << 29)
+#endif
+#ifndef HAVE_SUPPORTED_56000baseLR4_Full
+#define SUPPORTED_56000baseLR4_Full (1 << 30)
+#endif
+
 /* Add defines in case the running kernel is not the same as user headers. */
 #ifndef ETHTOOL_GLINKSETTINGS
 struct ethtool_link_settings {