Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23777
b: refs/heads/master
c: 7a343d4
h: refs/heads/master
i:
  23775: 352578e
v: v3
  • Loading branch information
Leonid Arsh authored and Roland Dreier committed Mar 24, 2006
1 parent a7e8693 commit 3be1047
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 192daa18dd7bfcaeb092a2ef928135745f2e6883
refs/heads/master: 7a343d4c46bc59fe617f968e996ce2fd67c5d179
15 changes: 8 additions & 7 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ enum {
IPOIB_MAX_MCAST_QUEUE = 3,

IPOIB_FLAG_OPER_UP = 0,
IPOIB_FLAG_ADMIN_UP = 1,
IPOIB_PKEY_ASSIGNED = 2,
IPOIB_PKEY_STOP = 3,
IPOIB_FLAG_SUBINTERFACE = 4,
IPOIB_MCAST_RUN = 5,
IPOIB_STOP_REAPER = 6,
IPOIB_MCAST_STARTED = 7,
IPOIB_FLAG_INITIALIZED = 1,
IPOIB_FLAG_ADMIN_UP = 2,
IPOIB_PKEY_ASSIGNED = 3,
IPOIB_PKEY_STOP = 4,
IPOIB_FLAG_SUBINTERFACE = 5,
IPOIB_MCAST_RUN = 6,
IPOIB_STOP_REAPER = 7,
IPOIB_MCAST_STARTED = 8,

IPOIB_MAX_BACKOFF_SECONDS = 16,

Expand Down
42 changes: 30 additions & 12 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,33 @@ int ipoib_ib_dev_open(struct net_device *dev)
clear_bit(IPOIB_STOP_REAPER, &priv->flags);
queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ);

set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);

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)
{
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);

return ipoib_mcast_start_thread(dev);
Expand Down Expand Up @@ -483,6 +503,8 @@ int ipoib_ib_dev_stop(struct net_device *dev)
struct ipoib_tx_buf *tx_req;
int i;

clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);

/*
* Move our QP to the error state and then reinitialize in
* when all work requests have completed or have been flushed.
Expand Down Expand Up @@ -587,8 +609,15 @@ void ipoib_ib_dev_flush(void *_dev)
struct net_device *dev = (struct net_device *)_dev;
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;
}

ipoib_dbg(priv, "flushing\n");

Expand Down Expand Up @@ -632,17 +661,6 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)
* 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)
{
struct net_device *dev = dev_ptr;
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,11 @@ static void ipoib_set_mcast_list(struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);

if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags)) {
ipoib_dbg(priv, "IPOIB_FLAG_OPER_UP not set");
return;
}

queue_work(ipoib_workqueue, &priv->restart_task);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void ipoib_event(struct ib_event_handler *handler,
container_of(handler, struct ipoib_dev_priv, event_handler);

if (record->event == IB_EVENT_PORT_ERR ||
record->event == IB_EVENT_PKEY_CHANGE ||
record->event == IB_EVENT_PORT_ACTIVE ||
record->event == IB_EVENT_LID_CHANGE ||
record->event == IB_EVENT_SM_CHANGE) {
Expand Down

0 comments on commit 3be1047

Please sign in to comment.