]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Use SWITCHDEV_SET_OPS().
authorDavid S. Miller <davem@davemloft.net>
Tue, 25 Jul 2017 04:20:16 +0000 (21:20 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 9 Mar 2018 04:47:08 +0000 (20:47 -0800)
Orabug: 2764835527648339

Suggested by Jakub Kicinski.

Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and and get_phys_port_name")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bc88055ab72c0eaa080926c888628b77d2055513)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnxt/bnxt.c

drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h [new file with mode: 0644]

index 3a5ee4f7ada45ede561784a4a6240f33bf286dee..4eb85343bcbbcac2a0a5fa585dfabbaedd76ec24 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/bitmap.h>
 #include <linux/cpu_rmap.h>
 
+#include "bnxt_compat.h"
 #include "bnxt_hsi.h"
 #include "bnxt.h"
 #include "bnxt_ulp.h"
@@ -7847,6 +7848,9 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->netdev_ops = &bnxt_netdev_ops;
        dev->watchdog_timeo = BNXT_TX_TIMEOUT;
        dev->ethtool_ops = &bnxt_ethtool_ops;
+#ifdef CONFIG_VF_REPS
+       SWITCHDEV_SET_OPS(dev, &bnxt_switchdev_ops);
+#endif
        pci_set_drvdata(pdev, dev);
 
        rc = bnxt_alloc_hwrm_resources(bp);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h
new file mode 100644 (file)
index 0000000..4bc0a93
--- /dev/null
@@ -0,0 +1,26 @@
+/* Broadcom NetXtreme-C/E network driver.
+ *
+ * Copyright (c) 2014-2016 Broadcom Corporation
+ * Copyright (c) 2016-2017 Broadcom Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ */
+
+#include <linux/pci.h>
+#include <linux/version.h>
+#include <linux/ethtool.h>
+#include <linux/skbuff.h>
+#include <linux/rtnetlink.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#if !defined(NEW_FLOW_KEYS) && defined(HAVE_FLOW_KEYS)
+#include <net/flow_keys.h>
+#endif
+#include <linux/sched.h>
+
+
+#ifndef SWITCHDEV_SET_OPS
+#define SWITCHDEV_SET_OPS(netdev, ops) ((netdev)->switchdev_ops = (ops))
+#endif