aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@voltaire.com>2010-03-04 08:17:37 -0500
committerRoland Dreier <rolandd@cisco.com>2010-03-11 16:43:11 -0500
commita48f509b26cec53338f4b0abd52ecea35e3974b8 (patch)
treee08d069cb636346f64a3fb193f7565ad739b7d58 /drivers/infiniband
parentf0dc117abdfa9a0e96c3d013d836460ef3cd08c7 (diff)
IPoIB: Include return code in trace message for ib_post_send() failures
Print the return code of ib_post_send() if it fails to make these debugging messages more useful. Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c8
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c9
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 6e3cc865e369..bc658373ad55 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -708,6 +708,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
708 struct ipoib_dev_priv *priv = netdev_priv(dev); 708 struct ipoib_dev_priv *priv = netdev_priv(dev);
709 struct ipoib_cm_tx_buf *tx_req; 709 struct ipoib_cm_tx_buf *tx_req;
710 u64 addr; 710 u64 addr;
711 int rc;
711 712
712 if (unlikely(skb->len > tx->mtu)) { 713 if (unlikely(skb->len > tx->mtu)) {
713 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", 714 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_
739 740
740 tx_req->mapping = addr; 741 tx_req->mapping = addr;
741 742
742 if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), 743 rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
743 addr, skb->len))) { 744 addr, skb->len);
744 ipoib_warn(priv, "post_send failed\n"); 745 if (unlikely(rc)) {
746 ipoib_warn(priv, "post_send failed, error %d\n", rc);
745 ++dev->stats.tx_errors; 747 ++dev->stats.tx_errors;
746 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE); 748 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
747 dev_kfree_skb_any(skb); 749 dev_kfree_skb_any(skb);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 8c91d9f37ada..5df40b128f81 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -529,7 +529,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
529{ 529{
530 struct ipoib_dev_priv *priv = netdev_priv(dev); 530 struct ipoib_dev_priv *priv = netdev_priv(dev);
531 struct ipoib_tx_buf *tx_req; 531 struct ipoib_tx_buf *tx_req;
532 int hlen; 532 int hlen, rc;
533 void *phead; 533 void *phead;
534 534
535 if (skb_is_gso(skb)) { 535 if (skb_is_gso(skb)) {
@@ -585,9 +585,10 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
585 netif_stop_queue(dev); 585 netif_stop_queue(dev);
586 } 586 }
587 587
588 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), 588 rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
589 address->ah, qpn, tx_req, phead, hlen))) { 589 address->ah, qpn, tx_req, phead, hlen);
590 ipoib_warn(priv, "post_send failed\n"); 590 if (unlikely(rc)) {
591 ipoib_warn(priv, "post_send failed, error %d\n", rc);
591 ++dev->stats.tx_errors; 592 ++dev->stats.tx_errors;
592 --priv->tx_outstanding; 593 --priv->tx_outstanding;
593 ipoib_dma_unmap_tx(priv->ca, tx_req); 594 ipoib_dma_unmap_tx(priv->ca, tx_req);