Skip to content

Instantly share code, notes, and snippets.

@h0tw1r3
Created January 6, 2015 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h0tw1r3/fc3921434a59869785b5 to your computer and use it in GitHub Desktop.
Save h0tw1r3/fc3921434a59869785b5 to your computer and use it in GitHub Desktop.
Fix building Mellanox ConnectX EN Driver on Linux 3.17+ -- dkms tested on Fedora 3.17
diff -ur a/mlnx-en-2.3/dkms.conf b/mlnx_en-2.3/dkms.conf
--- a/mlnx-en-2.3/dkms.conf 2014-11-19 03:56:27.000000000 -0600
+++ b/mlnx_en-2.3/dkms.conf 2015-01-06 10:52:04.171696932 -0600
@@ -20,7 +20,7 @@
DEST_MODULE_LOCATION[3]=/kernel/drivers/net/ethernet/mellanox/mlx4
STRIP[3]=$STRIP_MODS
PRE_BUILD="./scripts/mlnx_en_patch.sh ${MLNX_EN_PATCH_PARAMS}"
-MAKE="make -j`grep ^processor /proc/cpuinfo | wc -l`"
+MAKE="make -j`grep ^processor /proc/cpuinfo| wc -l` EXTRA_CFLAGS+='-Wno-error=date-time' "
CLEAN="make clean"
PACKAGE_NAME=mlnx-en
PACKAGE_VERSION=${PACKAGE_VERSION:-"2.0"}
diff -ur a/mlnx-en-2.3/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/mlnx_en-2.3/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
--- a/mlnx-en-2.3/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c 2014-11-19 03:56:29.000000000 -0600
+++ b/mlnx_en-2.3/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c 2015-01-06 11:30:54.195812295 -0600
@@ -304,7 +304,7 @@
* error.
*/
-static u8 mlx4_en_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id)
+static int mlx4_en_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id)
{
struct mlx4_en_priv *priv = netdev_priv(netdev);
struct dcb_app app = {
@@ -320,7 +320,7 @@
* mlx4_en_dcbnl_setapp - add CEE dcb application data to app list.
*/
-static u8 mlx4_en_dcbnl_setapp(struct net_device *netdev, u8 idtype,
+static int mlx4_en_dcbnl_setapp(struct net_device *netdev, u8 idtype,
u16 id, u8 up)
{
struct dcb_app app;
diff -ur a/mlnx-en-2.3/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/mlnx_en-2.3/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
--- a/mlnx-en-2.3/drivers/net/ethernet/mellanox/mlx4/en_netdev.c 2014-11-19 03:56:29.000000000 -0600
+++ b/mlnx_en-2.3/drivers/net/ethernet/mellanox/mlx4/en_netdev.c 2015-01-06 11:12:31.920029519 -0600
@@ -3265,13 +3265,13 @@
static int mlx4_en_fdb_dump(struct sk_buff *skb,
struct netlink_callback *cb,
- struct net_device *dev, int idx)
+ struct net_device *dev, struct net_device *fdev, int idx)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_dev *mdev = priv->mdev->dev;
if (mlx4_is_mfunc(mdev))
- idx = ndo_dflt_fdb_dump(skb, cb, dev, idx);
+ idx = ndo_dflt_fdb_dump(skb, cb, dev, NULL, idx);
return idx;
}
diff -ur a/mlnx-en-2.3/include/linux/compat-3.17.h b/mlnx_en-2.3/include/linux/compat-3.17.h
--- a/mlnx-en-2.3/include/linux/compat-3.17.h 2014-11-19 03:56:27.000000000 -0600
+++ b/mlnx_en-2.3/include/linux/compat-3.17.h 2015-01-06 10:46:51.454546589 -0600
@@ -4,7 +4,7 @@
#include <linux/version.h>
#include <linux/dcbnl.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) && !defined(COMPAT_VMWARE))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) && !defined(COMPAT_VMWARE))
#ifndef CONFIG_COMPAT_IS_QCN
@@ -43,6 +43,6 @@
#endif
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,76,0)) */
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)) */
#endif /* LINUX_3_17_COMPAT_H */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment