]> Pileus Git - ~andy/linux/blobdiff - drivers/infiniband/ulp/ipoib/ipoib_cm.c
IPoIB: Include return code in trace message for ib_post_send() failures
[~andy/linux] / drivers / infiniband / ulp / ipoib / ipoib_cm.c
index 30bdf427ee6d099b907f13ffe0d05dfa9d53c39a..bc658373ad557a05d428df81697b9938e85b6d5e 100644 (file)
@@ -708,6 +708,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        struct ipoib_cm_tx_buf *tx_req;
        u64 addr;
+       int rc;
 
        if (unlikely(skb->len > tx->mtu)) {
                ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
@@ -739,9 +740,10 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
 
        tx_req->mapping = addr;
 
-       if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
-                              addr, skb->len))) {
-               ipoib_warn(priv, "post_send failed\n");
+       rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
+                      addr, skb->len);
+       if (unlikely(rc)) {
+               ipoib_warn(priv, "post_send failed, error %d\n", rc);
                ++dev->stats.tx_errors;
                ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
                dev_kfree_skb_any(skb);
@@ -752,6 +754,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
                if (++priv->tx_outstanding == ipoib_sendq_size) {
                        ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
                                  tx->qp->qp_num);
+                       if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
+                               ipoib_warn(priv, "request notify on send CQ failed\n");
                        netif_stop_queue(dev);
                }
        }
@@ -1374,7 +1378,7 @@ static void ipoib_cm_skb_reap(struct work_struct *work)
                        icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
                else if (skb->protocol == htons(ETH_P_IPV6))
-                       icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, priv->dev);
+                       icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
 #endif
                dev_kfree_skb_any(skb);