summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qlogic/qede/qede_main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-10-04 03:22:52 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-10-04 03:22:52 (GMT)
commitb462d22bf3a675dffbfe1cd7ad90eab633d822b7 (patch)
treee5a5e271c1020d6b07c29bdd35475c4d901c39fb /drivers/net/ethernet/qlogic/qede/qede_main.c
parentb9118b7221ebb12156d2b08d4d5647bc6076d6bb (diff)
parentabd49676c70793ee0a251bc3d8fe1604f9303210 (diff)
downloadlinux-b462d22bf3a675dffbfe1cd7ad90eab633d822b7.tar.xz
Merge branch 'qed-qedr-infrastructure'
Yuval Mintz says: ==================== qed*: Add qedr infrastructure support In the last couple of weeks we've been sending RFCs for the qedr driver - the RoCE driver for QLogic FastLinQ 4xxxx line of adapters. Latest RFC can be found at [1]. At Doug's advice [2], we've decided to split the series into two: - first part contains the qed backbone that's necessary for all the configurations relating to the qedr driver, as well as the qede infrastructure that is used for communication between the qedr and qede. - Second part consists of the actual qedr driver and introduces almost no changes to qed/qede. This is the first of said two parts. The second half would be sent later this week. The only 'oddity' in the devision are the Kconfig options - As this series introduces both LL2 and QEDR-based logic in qed/qede, I wanted to add the CONFIG_INFINIBAND_QEDR option here [with default n]. Otherwise, a lot of the code introduced would be dead-code [won't even be compiled] until qedr is accepted. As a result I've placed the config option in an odd place - under qlogic's Kconfig. The second series would then remove that option and add it in its correct place under the infiniband Kconfig. [I'm fine with pushing it there to begin with, but I didn't want to 'contaminate' non-qlogic configuration files with half-baked options]. Dave - I don't think you were E-mailed with Doug's suggestion. I think the notion was to have the two halves accepted side-by-side, but actually the first has no dependency issues, so it's also possible to simply take this first to net-next, and push the qedr into rdma once it's merged. But it's basically up to you and Doug; We'd align with whatever suits you best. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qede/qede_main.c')
-rw-r--r--drivers/net/ethernet/qlogic/qede/qede_main.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 0e198fe..343038c 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -36,7 +36,7 @@
#include <linux/random.h>
#include <net/ip6_checksum.h>
#include <linux/bitops.h>
-
+#include <linux/qed/qede_roce.h>
#include "qede.h"
static char version[] =
@@ -193,8 +193,7 @@ static int qede_netdev_event(struct notifier_block *this, unsigned long event,
struct ethtool_drvinfo drvinfo;
struct qede_dev *edev;
- /* Currently only support name change */
- if (event != NETDEV_CHANGENAME)
+ if (event != NETDEV_CHANGENAME && event != NETDEV_CHANGEADDR)
goto done;
/* Check whether this is a qede device */
@@ -207,11 +206,18 @@ static int qede_netdev_event(struct notifier_block *this, unsigned long event,
goto done;
edev = netdev_priv(ndev);
- /* Notify qed of the name change */
- if (!edev->ops || !edev->ops->common)
- goto done;
- edev->ops->common->set_id(edev->cdev, edev->ndev->name,
- "qede");
+ switch (event) {
+ case NETDEV_CHANGENAME:
+ /* Notify qed of the name change */
+ if (!edev->ops || !edev->ops->common)
+ goto done;
+ edev->ops->common->set_id(edev->cdev, edev->ndev->name, "qede");
+ break;
+ case NETDEV_CHANGEADDR:
+ edev = netdev_priv(ndev);
+ qede_roce_event_changeaddr(edev);
+ break;
+ }
done:
return NOTIFY_DONE;
@@ -2545,10 +2551,14 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
qede_init_ndev(edev);
+ rc = qede_roce_dev_add(edev);
+ if (rc)
+ goto err3;
+
rc = register_netdev(edev->ndev);
if (rc) {
DP_NOTICE(edev, "Cannot register net-device\n");
- goto err3;
+ goto err4;
}
edev->ops->common->set_id(cdev, edev->ndev->name, DRV_MODULE_VERSION);
@@ -2568,6 +2578,8 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
return 0;
+err4:
+ qede_roce_dev_remove(edev);
err3:
free_netdev(edev->ndev);
err2:
@@ -2614,8 +2626,11 @@ static void __qede_remove(struct pci_dev *pdev, enum qede_remove_mode mode)
DP_INFO(edev, "Starting qede_remove\n");
cancel_delayed_work_sync(&edev->sp_task);
+
unregister_netdev(ndev);
+ qede_roce_dev_remove(edev);
+
edev->ops->common->set_power_state(cdev, PCI_D0);
pci_set_drvdata(pdev, NULL);
@@ -3512,6 +3527,7 @@ static void qede_unload(struct qede_dev *edev, enum qede_unload_mode mode)
DP_INFO(edev, "Starting qede unload\n");
+ qede_roce_dev_event_close(edev);
mutex_lock(&edev->qede_lock);
edev->state = QEDE_STATE_CLOSED;
@@ -3612,6 +3628,7 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode)
/* Query whether link is already-up */
memset(&link_output, 0, sizeof(link_output));
edev->ops->common->get_link(edev->cdev, &link_output);
+ qede_roce_dev_event_open(edev);
qede_link_update(edev, &link_output);
DP_INFO(edev, "Ending successfully qede load\n");