diff options
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 10944888cffd..5a70e287f25d 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -558,6 +558,14 @@ void ipoib_drain_cq(struct net_device *dev) | |||
558 | do { | 558 | do { |
559 | n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc); | 559 | n = ib_poll_cq(priv->cq, IPOIB_NUM_WC, priv->ibwc); |
560 | for (i = 0; i < n; ++i) { | 560 | for (i = 0; i < n; ++i) { |
561 | /* | ||
562 | * Convert any successful completions to flush | ||
563 | * errors to avoid passing packets up the | ||
564 | * stack after bringing the device down. | ||
565 | */ | ||
566 | if (priv->ibwc[i].status == IB_WC_SUCCESS) | ||
567 | priv->ibwc[i].status = IB_WC_WR_FLUSH_ERR; | ||
568 | |||
561 | if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ) | 569 | if (priv->ibwc[i].wr_id & IPOIB_CM_OP_SRQ) |
562 | ipoib_cm_handle_rx_wc(dev, priv->ibwc + i); | 570 | ipoib_cm_handle_rx_wc(dev, priv->ibwc + i); |
563 | else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV) | 571 | else if (priv->ibwc[i].wr_id & IPOIB_OP_RECV) |