aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_cm.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-09-28 18:33:51 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:41 -0400
commitde90351219a1f1fd3cb45cf6fcc4e9d6407fd2c9 (patch)
tree5fd6193eb233e900452f719fd56d7065b2fb939e /drivers/infiniband/ulp/ipoib/ipoib_cm.c
parent587117414909e9c52f50e3c9d1f85b3dc1815d75 (diff)
[IPoIB]: Convert to netdevice internal stats
Use the stats member of struct netdevice in IPoIB, so we can save memory by deleting the stats member of struct ipoib_dev_priv, and save code by deleting ipoib_get_stats(). Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_cm.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 08b4676a3820..1afd93cdd6bb 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -430,7 +430,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
430 ipoib_dbg(priv, "cm recv error " 430 ipoib_dbg(priv, "cm recv error "
431 "(status=%d, wrid=%d vend_err %x)\n", 431 "(status=%d, wrid=%d vend_err %x)\n",
432 wc->status, wr_id, wc->vendor_err); 432 wc->status, wr_id, wc->vendor_err);
433 ++priv->stats.rx_dropped; 433 ++dev->stats.rx_dropped;
434 goto repost; 434 goto repost;
435 } 435 }
436 436
@@ -457,7 +457,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
457 * this packet and reuse the old buffer. 457 * this packet and reuse the old buffer.
458 */ 458 */
459 ipoib_dbg(priv, "failed to allocate receive buffer %d\n", wr_id); 459 ipoib_dbg(priv, "failed to allocate receive buffer %d\n", wr_id);
460 ++priv->stats.rx_dropped; 460 ++dev->stats.rx_dropped;
461 goto repost; 461 goto repost;
462 } 462 }
463 463
@@ -474,8 +474,8 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
474 skb_pull(skb, IPOIB_ENCAP_LEN); 474 skb_pull(skb, IPOIB_ENCAP_LEN);
475 475
476 dev->last_rx = jiffies; 476 dev->last_rx = jiffies;
477 ++priv->stats.rx_packets; 477 ++dev->stats.rx_packets;
478 priv->stats.rx_bytes += skb->len; 478 dev->stats.rx_bytes += skb->len;
479 479
480 skb->dev = dev; 480 skb->dev = dev;
481 /* XXX get correct PACKET_ type here */ 481 /* XXX get correct PACKET_ type here */
@@ -512,8 +512,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
512 if (unlikely(skb->len > tx->mtu)) { 512 if (unlikely(skb->len > tx->mtu)) {
513 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", 513 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
514 skb->len, tx->mtu); 514 skb->len, tx->mtu);
515 ++priv->stats.tx_dropped; 515 ++dev->stats.tx_dropped;
516 ++priv->stats.tx_errors; 516 ++dev->stats.tx_errors;
517 ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN); 517 ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN);
518 return; 518 return;
519 } 519 }
@@ -532,7 +532,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
532 tx_req->skb = skb; 532 tx_req->skb = skb;
533 addr = ib_dma_map_single(priv->ca, skb->data, skb->len, DMA_TO_DEVICE); 533 addr = ib_dma_map_single(priv->ca, skb->data, skb->len, DMA_TO_DEVICE);
534 if (unlikely(ib_dma_mapping_error(priv->ca, addr))) { 534 if (unlikely(ib_dma_mapping_error(priv->ca, addr))) {
535 ++priv->stats.tx_errors; 535 ++dev->stats.tx_errors;
536 dev_kfree_skb_any(skb); 536 dev_kfree_skb_any(skb);
537 return; 537 return;
538 } 538 }
@@ -542,7 +542,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
542 if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), 542 if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
543 addr, skb->len))) { 543 addr, skb->len))) {
544 ipoib_warn(priv, "post_send failed\n"); 544 ipoib_warn(priv, "post_send failed\n");
545 ++priv->stats.tx_errors; 545 ++dev->stats.tx_errors;
546 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE); 546 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
547 dev_kfree_skb_any(skb); 547 dev_kfree_skb_any(skb);
548 } else { 548 } else {
@@ -580,8 +580,8 @@ static void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ipoib_cm_tx *tx
580 ib_dma_unmap_single(priv->ca, tx_req->mapping, tx_req->skb->len, DMA_TO_DEVICE); 580 ib_dma_unmap_single(priv->ca, tx_req->mapping, tx_req->skb->len, DMA_TO_DEVICE);
581 581
582 /* FIXME: is this right? Shouldn't we only increment on success? */ 582 /* FIXME: is this right? Shouldn't we only increment on success? */
583 ++priv->stats.tx_packets; 583 ++dev->stats.tx_packets;
584 priv->stats.tx_bytes += tx_req->skb->len; 584 dev->stats.tx_bytes += tx_req->skb->len;
585 585
586 dev_kfree_skb_any(tx_req->skb); 586 dev_kfree_skb_any(tx_req->skb);
587 587