qeth: add statistics for tx csum
authorFrank Blaschka <frank.blaschka@de.ibm.com>
Tue, 24 Mar 2009 20:57:15 +0000 (20:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Mar 2009 07:06:19 +0000 (00:06 -0700)
Add statistics counter for software tx checksumming.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index e0c45574b0c8f0208594ebfe8087971c43b0c172..fd34f63dc23281819723899e98f6b2ae2956b17f 100644 (file)
@@ -134,6 +134,7 @@ struct qeth_perf_stats {
        unsigned int sg_skbs_rx;
        unsigned int sg_frags_rx;
        unsigned int sg_alloc_page_rx;
+       unsigned int tx_csum;
 };
 
 /* Routing stuff */
index d1b5bebea7fbb3a36ad29b5eff6f231ce2a3f4d5..1a361b3bf62a292154753878bf05fa8ecab7272d 100644 (file)
@@ -4327,6 +4327,7 @@ static struct {
 /* 30 */{"tx count"},
        {"tx do_QDIO time"},
        {"tx do_QDIO count"},
+       {"tx csum"},
 };
 
 int qeth_core_get_stats_count(struct net_device *dev)
@@ -4378,6 +4379,7 @@ void qeth_core_get_ethtool_stats(struct net_device *dev,
        data[30] = card->perf_stats.outbound_cnt;
        data[31] = card->perf_stats.outbound_do_qdio_time;
        data[32] = card->perf_stats.outbound_do_qdio_cnt;
+       data[33] = card->perf_stats.tx_csum;
 }
 EXPORT_SYMBOL_GPL(qeth_core_get_ethtool_stats);
 
index 07ab8a5c1c46c5c5df51fc5d0d74d8a0ea3626ec..7632d12088449edc32f9463941a6232a730747a9 100644 (file)
@@ -707,8 +707,11 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        if ((large_send == QETH_LARGE_SEND_NO) &&
-           (skb->ip_summed == CHECKSUM_PARTIAL))
+           (skb->ip_summed == CHECKSUM_PARTIAL)) {
                qeth_tx_csum(new_skb);
+               if (card->options.performance_stats)
+                       card->perf_stats.tx_csum++;
+       }
 
        if (card->info.type != QETH_CARD_TYPE_IQD)
                rc = qeth_do_send_packet(card, queue, new_skb, hdr,
index 0dcc036d34aa01c1297cbe8bda71f5d43824f8df..fea50bdc8f4183944cddfee8971cc3c5717d30e2 100644 (file)
@@ -2711,8 +2711,11 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        if ((large_send == QETH_LARGE_SEND_NO) &&
-           (new_skb->ip_summed == CHECKSUM_PARTIAL))
+           (new_skb->ip_summed == CHECKSUM_PARTIAL)) {
                qeth_tx_csum(new_skb);
+               if (card->options.performance_stats)
+                       card->perf_stats.tx_csum++;
+       }
 
        if (card->info.type != QETH_CARD_TYPE_IQD)
                rc = qeth_do_send_packet(card, queue, new_skb, hdr,