Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57014
b: refs/heads/master
c: 2dfbfc3
h: refs/heads/master
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed May 24, 2007
1 parent 963f093 commit 65e089a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 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: 8fd357a6e3375083f7d321413eb8f6739491f342
refs/heads/master: 2dfbfc37121d307e1f1d24c2979382cb17b19347
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey);

void ipoib_pkey_poll(struct work_struct *work);
int ipoib_pkey_dev_delay_open(struct net_device *dev);
void ipoib_drain_cq(struct net_device *dev);

#ifdef CONFIG_INFINIBAND_IPOIB_CM

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ void ipoib_cm_dev_stop(struct net_device *dev)
}
spin_unlock_irq(&priv->lock);
msleep(1);
ipoib_drain_cq(dev);
spin_lock_irq(&priv->lock);
}

Expand Down
31 changes: 19 additions & 12 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,30 @@ static int recvs_pending(struct net_device *dev)
return pending;
}

void ipoib_drain_cq(struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
int i, n;
do {
n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc);
for (i = 0; i < n; ++i) {
if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ)
ipoib_cm_handle_rx_wc(dev, priv->ibwc + i);
else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV)
ipoib_ib_handle_rx_wc(dev, priv->ibwc + i);
else
ipoib_ib_handle_tx_wc(dev, priv->ibwc + i);
}
} while (n == IPOIB_NUM_WC);
}

int ipoib_ib_dev_stop(struct net_device *dev, int flush)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ib_qp_attr qp_attr;
unsigned long begin;
struct ipoib_tx_buf *tx_req;
int i, n;
int i;

clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
netif_poll_disable(dev);
Expand Down Expand Up @@ -611,17 +628,7 @@ int ipoib_ib_dev_stop(struct net_device *dev, int flush)
goto timeout;
}

do {
n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc);
for (i = 0; i < n; ++i) {
if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ)
ipoib_cm_handle_rx_wc(dev, priv->ibwc + i);
else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV)
ipoib_ib_handle_rx_wc(dev, priv->ibwc + i);
else
ipoib_ib_handle_tx_wc(dev, priv->ibwc + i);
}
} while (n == IPOIB_NUM_WC);
ipoib_drain_cq(dev);

msleep(1);
}
Expand Down

0 comments on commit 65e089a

Please sign in to comment.