Skip to content

Commit 6059c90

Browse files
Eugene Crosserdavem330
authored andcommitted
qeth: introduce linearization fail count to stats
When skb data touches too many pages, skb_linearize() is called opportunistically in the hope that less pages will be required for a big linear buffer than for multiple fragments. This patch intoduces a separate counter in ethtool statistics structure representing _failed_ linearization attempts. Signed-off-by: Eugene Crosser <[email protected]> Signed-off-by: Ursula Braun <[email protected]> Reviewed-by: Lakhvich Dmitriy <[email protected]> Reviewed-by: Thomas Richter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2601e4e commit 6059c90

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ struct qeth_perf_stats {
145145
unsigned int sg_alloc_page_rx;
146146
unsigned int tx_csum;
147147
unsigned int tx_lin;
148+
unsigned int tx_linfail;
148149
};
149150

150151
/* Routing stuff */

drivers/s390/net/qeth_core_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5801,6 +5801,7 @@ static struct {
58015801
{"tx do_QDIO count"},
58025802
{"tx csum"},
58035803
{"tx lin"},
5804+
{"tx linfail"},
58045805
{"cq handler count"},
58055806
{"cq handler time"}
58065807
};
@@ -5861,8 +5862,9 @@ void qeth_core_get_ethtool_stats(struct net_device *dev,
58615862
data[32] = card->perf_stats.outbound_do_qdio_cnt;
58625863
data[33] = card->perf_stats.tx_csum;
58635864
data[34] = card->perf_stats.tx_lin;
5864-
data[35] = card->perf_stats.cq_cnt;
5865-
data[36] = card->perf_stats.cq_time;
5865+
data[35] = card->perf_stats.tx_linfail;
5866+
data[36] = card->perf_stats.cq_cnt;
5867+
data[37] = card->perf_stats.cq_time;
58665868
}
58675869
EXPORT_SYMBOL_GPL(qeth_core_get_ethtool_stats);
58685870

drivers/s390/net/qeth_l2_main.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,10 +898,16 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
898898
*/
899899
if ((card->info.type != QETH_CARD_TYPE_IQD) &&
900900
!qeth_get_elements_no(card, new_skb, 0)) {
901-
if (skb_linearize(new_skb))
901+
int lin_rc = skb_linearize(new_skb);
902+
903+
if (card->options.performance_stats) {
904+
if (lin_rc)
905+
card->perf_stats.tx_linfail++;
906+
else
907+
card->perf_stats.tx_lin++;
908+
}
909+
if (lin_rc)
902910
goto tx_drop;
903-
if (card->options.performance_stats)
904-
card->perf_stats.tx_lin++;
905911
}
906912

907913
if (card->info.type == QETH_CARD_TYPE_OSN)

drivers/s390/net/qeth_l3_main.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,10 +2918,16 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
29182918
if ((card->info.type != QETH_CARD_TYPE_IQD) &&
29192919
((use_tso && !qeth_l3_get_elements_no_tso(card, new_skb, 1)) ||
29202920
(!use_tso && !qeth_get_elements_no(card, new_skb, 0)))) {
2921-
if (skb_linearize(new_skb))
2921+
int lin_rc = skb_linearize(new_skb);
2922+
2923+
if (card->options.performance_stats) {
2924+
if (lin_rc)
2925+
card->perf_stats.tx_linfail++;
2926+
else
2927+
card->perf_stats.tx_lin++;
2928+
}
2929+
if (lin_rc)
29222930
goto tx_drop;
2923-
if (card->options.performance_stats)
2924-
card->perf_stats.tx_lin++;
29252931
}
29262932

29272933
if (use_tso) {

0 commit comments

Comments
 (0)