|
@@ -423,13 +423,33 @@ int ipoib_ib_dev_open(struct net_device *dev)
|
|
clear_bit(IPOIB_STOP_REAPER, &priv->flags);
|
|
clear_bit(IPOIB_STOP_REAPER, &priv->flags);
|
|
queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ);
|
|
queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ);
|
|
|
|
|
|
|
|
+ set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void ipoib_pkey_dev_check_presence(struct net_device *dev)
|
|
|
|
+{
|
|
|
|
+ struct ipoib_dev_priv *priv = netdev_priv(dev);
|
|
|
|
+ u16 pkey_index = 0;
|
|
|
|
+
|
|
|
|
+ if (ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &pkey_index))
|
|
|
|
+ clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
|
|
|
|
+ else
|
|
|
|
+ set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
|
|
|
|
+}
|
|
|
|
+
|
|
int ipoib_ib_dev_up(struct net_device *dev)
|
|
int ipoib_ib_dev_up(struct net_device *dev)
|
|
{
|
|
{
|
|
struct ipoib_dev_priv *priv = netdev_priv(dev);
|
|
struct ipoib_dev_priv *priv = netdev_priv(dev);
|
|
|
|
|
|
|
|
+ ipoib_pkey_dev_check_presence(dev);
|
|
|
|
+
|
|
|
|
+ if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) {
|
|
|
|
+ ipoib_dbg(priv, "PKEY is not assigned.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
set_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
|
|
set_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
|
|
|
|
|
|
return ipoib_mcast_start_thread(dev);
|
|
return ipoib_mcast_start_thread(dev);
|
|
@@ -483,6 +503,8 @@ int ipoib_ib_dev_stop(struct net_device *dev)
|
|
struct ipoib_tx_buf *tx_req;
|
|
struct ipoib_tx_buf *tx_req;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Move our QP to the error state and then reinitialize in
|
|
* Move our QP to the error state and then reinitialize in
|
|
* when all work requests have completed or have been flushed.
|
|
* when all work requests have completed or have been flushed.
|
|
@@ -587,8 +609,15 @@ void ipoib_ib_dev_flush(void *_dev)
|
|
struct net_device *dev = (struct net_device *)_dev;
|
|
struct net_device *dev = (struct net_device *)_dev;
|
|
struct ipoib_dev_priv *priv = netdev_priv(dev), *cpriv;
|
|
struct ipoib_dev_priv *priv = netdev_priv(dev), *cpriv;
|
|
|
|
|
|
- if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
|
|
|
|
|
|
+ if (!test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags) ) {
|
|
|
|
+ ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_INITIALIZED not set.\n");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) {
|
|
|
|
+ ipoib_dbg(priv, "Not flushing - IPOIB_FLAG_ADMIN_UP not set.\n");
|
|
return;
|
|
return;
|
|
|
|
+ }
|
|
|
|
|
|
ipoib_dbg(priv, "flushing\n");
|
|
ipoib_dbg(priv, "flushing\n");
|
|
|
|
|
|
@@ -632,17 +661,6 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)
|
|
* change async notification is available.
|
|
* change async notification is available.
|
|
*/
|
|
*/
|
|
|
|
|
|
-static void ipoib_pkey_dev_check_presence(struct net_device *dev)
|
|
|
|
-{
|
|
|
|
- struct ipoib_dev_priv *priv = netdev_priv(dev);
|
|
|
|
- u16 pkey_index = 0;
|
|
|
|
-
|
|
|
|
- if (ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &pkey_index))
|
|
|
|
- clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
|
|
|
|
- else
|
|
|
|
- set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void ipoib_pkey_poll(void *dev_ptr)
|
|
void ipoib_pkey_poll(void *dev_ptr)
|
|
{
|
|
{
|
|
struct net_device *dev = dev_ptr;
|
|
struct net_device *dev = dev_ptr;
|