diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-09-28 18:33:51 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:41 -0400 |
commit | de90351219a1f1fd3cb45cf6fcc4e9d6407fd2c9 (patch) | |
tree | 5fd6193eb233e900452f719fd56d7065b2fb939e /drivers/infiniband/ulp/ipoib/ipoib_main.c | |
parent | 587117414909e9c52f50e3c9d1f85b3dc1815d75 (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_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 2bd76ef57154..6b1b4b2ec5ba 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -517,7 +517,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) | |||
517 | 517 | ||
518 | neigh = ipoib_neigh_alloc(skb->dst->neighbour); | 518 | neigh = ipoib_neigh_alloc(skb->dst->neighbour); |
519 | if (!neigh) { | 519 | if (!neigh) { |
520 | ++priv->stats.tx_dropped; | 520 | ++dev->stats.tx_dropped; |
521 | dev_kfree_skb_any(skb); | 521 | dev_kfree_skb_any(skb); |
522 | return; | 522 | return; |
523 | } | 523 | } |
@@ -582,7 +582,7 @@ err_list: | |||
582 | err_path: | 582 | err_path: |
583 | ipoib_neigh_free(dev, neigh); | 583 | ipoib_neigh_free(dev, neigh); |
584 | err_drop: | 584 | err_drop: |
585 | ++priv->stats.tx_dropped; | 585 | ++dev->stats.tx_dropped; |
586 | dev_kfree_skb_any(skb); | 586 | dev_kfree_skb_any(skb); |
587 | 587 | ||
588 | spin_unlock(&priv->lock); | 588 | spin_unlock(&priv->lock); |
@@ -631,7 +631,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
631 | } else | 631 | } else |
632 | __path_add(dev, path); | 632 | __path_add(dev, path); |
633 | } else { | 633 | } else { |
634 | ++priv->stats.tx_dropped; | 634 | ++dev->stats.tx_dropped; |
635 | dev_kfree_skb_any(skb); | 635 | dev_kfree_skb_any(skb); |
636 | } | 636 | } |
637 | 637 | ||
@@ -650,7 +650,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
650 | skb_push(skb, sizeof *phdr); | 650 | skb_push(skb, sizeof *phdr); |
651 | __skb_queue_tail(&path->queue, skb); | 651 | __skb_queue_tail(&path->queue, skb); |
652 | } else { | 652 | } else { |
653 | ++priv->stats.tx_dropped; | 653 | ++dev->stats.tx_dropped; |
654 | dev_kfree_skb_any(skb); | 654 | dev_kfree_skb_any(skb); |
655 | } | 655 | } |
656 | 656 | ||
@@ -718,7 +718,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
718 | __skb_queue_tail(&neigh->queue, skb); | 718 | __skb_queue_tail(&neigh->queue, skb); |
719 | spin_unlock(&priv->lock); | 719 | spin_unlock(&priv->lock); |
720 | } else { | 720 | } else { |
721 | ++priv->stats.tx_dropped; | 721 | ++dev->stats.tx_dropped; |
722 | dev_kfree_skb_any(skb); | 722 | dev_kfree_skb_any(skb); |
723 | } | 723 | } |
724 | } else { | 724 | } else { |
@@ -744,7 +744,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
744 | IPOIB_QPN(phdr->hwaddr), | 744 | IPOIB_QPN(phdr->hwaddr), |
745 | IPOIB_GID_RAW_ARG(phdr->hwaddr + 4)); | 745 | IPOIB_GID_RAW_ARG(phdr->hwaddr + 4)); |
746 | dev_kfree_skb_any(skb); | 746 | dev_kfree_skb_any(skb); |
747 | ++priv->stats.tx_dropped; | 747 | ++dev->stats.tx_dropped; |
748 | goto out; | 748 | goto out; |
749 | } | 749 | } |
750 | 750 | ||
@@ -758,13 +758,6 @@ out: | |||
758 | return NETDEV_TX_OK; | 758 | return NETDEV_TX_OK; |
759 | } | 759 | } |
760 | 760 | ||
761 | static struct net_device_stats *ipoib_get_stats(struct net_device *dev) | ||
762 | { | ||
763 | struct ipoib_dev_priv *priv = netdev_priv(dev); | ||
764 | |||
765 | return &priv->stats; | ||
766 | } | ||
767 | |||
768 | static void ipoib_timeout(struct net_device *dev) | 761 | static void ipoib_timeout(struct net_device *dev) |
769 | { | 762 | { |
770 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 763 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
@@ -865,7 +858,7 @@ void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh) | |||
865 | struct sk_buff *skb; | 858 | struct sk_buff *skb; |
866 | *to_ipoib_neigh(neigh->neighbour) = NULL; | 859 | *to_ipoib_neigh(neigh->neighbour) = NULL; |
867 | while ((skb = __skb_dequeue(&neigh->queue))) { | 860 | while ((skb = __skb_dequeue(&neigh->queue))) { |
868 | ++priv->stats.tx_dropped; | 861 | ++dev->stats.tx_dropped; |
869 | dev_kfree_skb_any(skb); | 862 | dev_kfree_skb_any(skb); |
870 | } | 863 | } |
871 | if (ipoib_cm_get(neigh)) | 864 | if (ipoib_cm_get(neigh)) |
@@ -952,7 +945,6 @@ static void ipoib_setup(struct net_device *dev) | |||
952 | dev->stop = ipoib_stop; | 945 | dev->stop = ipoib_stop; |
953 | dev->change_mtu = ipoib_change_mtu; | 946 | dev->change_mtu = ipoib_change_mtu; |
954 | dev->hard_start_xmit = ipoib_start_xmit; | 947 | dev->hard_start_xmit = ipoib_start_xmit; |
955 | dev->get_stats = ipoib_get_stats; | ||
956 | dev->tx_timeout = ipoib_timeout; | 948 | dev->tx_timeout = ipoib_timeout; |
957 | dev->header_ops = &ipoib_header_ops; | 949 | dev->header_ops = &ipoib_header_ops; |
958 | dev->set_multicast_list = ipoib_set_mcast_list; | 950 | dev->set_multicast_list = ipoib_set_mcast_list; |