diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2018-07-19 13:43:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-21 20:12:30 +0300 |
commit | d2a274b25be7218f8400037868a756640e8a4b0d (patch) | |
tree | 6d2519820159b070d8b7efa4e6dcacc372123c11 /drivers/s390/net/qeth_l2_main.c | |
parent | 72f219da79d22384bbc809fc67ed305dbe824e39 (diff) | |
download | linux-d2a274b25be7218f8400037868a756640e8a4b0d.tar.xz |
s390/qeth: add statistics for consumed buffer elements
Nowadays an skb fragment typically spans over multiple pages. So replace
the obsolete, SG-only 'fragments' counter with one that tracks the
consumed buffer elements. This is what actually matters for performance.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l2_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 668f80680575..a785c5ff73cd 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -672,10 +672,11 @@ static int qeth_l2_xmit_osa(struct qeth_card *card, struct sk_buff *skb, int ipv) { int push_len = sizeof(struct qeth_hdr); - unsigned int elements, nr_frags; unsigned int hdr_elements = 0; struct qeth_hdr *hdr = NULL; unsigned int hd_len = 0; + unsigned int elements; + bool is_sg; int rc; /* fix hardware limitation: as long as we do not have sbal @@ -693,7 +694,6 @@ static int qeth_l2_xmit_osa(struct qeth_card *card, struct sk_buff *skb, if (rc) return rc; } - nr_frags = skb_shinfo(skb)->nr_frags; rc = skb_cow_head(skb, push_len); if (rc) @@ -720,15 +720,16 @@ static int qeth_l2_xmit_osa(struct qeth_card *card, struct sk_buff *skb, } elements += hdr_elements; + is_sg = skb_is_nonlinear(skb); /* TODO: remove the skb_orphan() once TX completion is fast enough */ skb_orphan(skb); rc = qeth_do_send_packet(card, queue, skb, hdr, 0, hd_len, elements); out: if (!rc) { - if (card->options.performance_stats && nr_frags) { - card->perf_stats.sg_skbs_sent++; - /* nr_frags + skb->data */ - card->perf_stats.sg_frags_sent += nr_frags + 1; + if (card->options.performance_stats) { + card->perf_stats.buf_elements_sent += elements; + if (is_sg) + card->perf_stats.sg_skbs_sent++; } } else { if (hd_len) |