diff options
author | Gal Pressman <galp@mellanox.com> | 2016-06-27 05:08:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-29 04:28:47 -0400 |
commit | bfe6d8d1d433cbd5513a93132695e6dbdd79e6f2 (patch) | |
tree | d5131f75174dc4e69b7f5256fcfa0a356bd03a5b | |
parent | ed80ec4c179d1f44cc1b36c7a102353ae6103793 (diff) |
net/mlx5e: Reorganize ethtool statistics
Categorize and reorganize ethtool statistics counters by renaming to
"rx_*" and "tx_*" and removing redundant and duplicated counters, this
way they are easier to grasp and more user friendly.
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 30 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 27 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 228 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 4 |
5 files changed, 130 insertions, 163 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index c709d41c4b70..e667a870e0c2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | |||
@@ -213,42 +213,41 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data) | |||
213 | 213 | ||
214 | /* SW counters */ | 214 | /* SW counters */ |
215 | for (i = 0; i < NUM_SW_COUNTERS; i++) | 215 | for (i = 0; i < NUM_SW_COUNTERS; i++) |
216 | strcpy(data + (idx++) * ETH_GSTRING_LEN, sw_stats_desc[i].name); | 216 | strcpy(data + (idx++) * ETH_GSTRING_LEN, sw_stats_desc[i].format); |
217 | 217 | ||
218 | /* Q counters */ | 218 | /* Q counters */ |
219 | for (i = 0; i < MLX5E_NUM_Q_CNTRS(priv); i++) | 219 | for (i = 0; i < MLX5E_NUM_Q_CNTRS(priv); i++) |
220 | strcpy(data + (idx++) * ETH_GSTRING_LEN, q_stats_desc[i].name); | 220 | strcpy(data + (idx++) * ETH_GSTRING_LEN, q_stats_desc[i].format); |
221 | 221 | ||
222 | /* VPORT counters */ | 222 | /* VPORT counters */ |
223 | for (i = 0; i < NUM_VPORT_COUNTERS; i++) | 223 | for (i = 0; i < NUM_VPORT_COUNTERS; i++) |
224 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | 224 | strcpy(data + (idx++) * ETH_GSTRING_LEN, |
225 | vport_stats_desc[i].name); | 225 | vport_stats_desc[i].format); |
226 | 226 | ||
227 | /* PPORT counters */ | 227 | /* PPORT counters */ |
228 | for (i = 0; i < NUM_PPORT_802_3_COUNTERS; i++) | 228 | for (i = 0; i < NUM_PPORT_802_3_COUNTERS; i++) |
229 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | 229 | strcpy(data + (idx++) * ETH_GSTRING_LEN, |
230 | pport_802_3_stats_desc[i].name); | 230 | pport_802_3_stats_desc[i].format); |
231 | 231 | ||
232 | for (i = 0; i < NUM_PPORT_2863_COUNTERS; i++) | 232 | for (i = 0; i < NUM_PPORT_2863_COUNTERS; i++) |
233 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | 233 | strcpy(data + (idx++) * ETH_GSTRING_LEN, |
234 | pport_2863_stats_desc[i].name); | 234 | pport_2863_stats_desc[i].format); |
235 | 235 | ||
236 | for (i = 0; i < NUM_PPORT_2819_COUNTERS; i++) | 236 | for (i = 0; i < NUM_PPORT_2819_COUNTERS; i++) |
237 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | 237 | strcpy(data + (idx++) * ETH_GSTRING_LEN, |
238 | pport_2819_stats_desc[i].name); | 238 | pport_2819_stats_desc[i].format); |
239 | 239 | ||
240 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { | 240 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { |
241 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) | 241 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) |
242 | sprintf(data + (idx++) * ETH_GSTRING_LEN, "prio%d_%s", | 242 | sprintf(data + (idx++) * ETH_GSTRING_LEN, |
243 | prio, | 243 | pport_per_prio_traffic_stats_desc[i].format, prio); |
244 | pport_per_prio_traffic_stats_desc[i].name); | ||
245 | } | 244 | } |
246 | 245 | ||
247 | pfc_combined = mlx5e_query_pfc_combined(priv); | 246 | pfc_combined = mlx5e_query_pfc_combined(priv); |
248 | for_each_set_bit(prio, &pfc_combined, NUM_PPORT_PRIO) { | 247 | for_each_set_bit(prio, &pfc_combined, NUM_PPORT_PRIO) { |
249 | for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) { | 248 | for (i = 0; i < NUM_PPORT_PER_PRIO_PFC_COUNTERS; i++) { |
250 | sprintf(data + (idx++) * ETH_GSTRING_LEN, "prio%d_%s", | 249 | sprintf(data + (idx++) * ETH_GSTRING_LEN, |
251 | prio, pport_per_prio_pfc_stats_desc[i].name); | 250 | pport_per_prio_pfc_stats_desc[i].format, prio); |
252 | } | 251 | } |
253 | } | 252 | } |
254 | 253 | ||
@@ -258,16 +257,15 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data) | |||
258 | /* per channel counters */ | 257 | /* per channel counters */ |
259 | for (i = 0; i < priv->params.num_channels; i++) | 258 | for (i = 0; i < priv->params.num_channels; i++) |
260 | for (j = 0; j < NUM_RQ_STATS; j++) | 259 | for (j = 0; j < NUM_RQ_STATS; j++) |
261 | sprintf(data + (idx++) * ETH_GSTRING_LEN, "rx%d_%s", i, | 260 | sprintf(data + (idx++) * ETH_GSTRING_LEN, |
262 | rq_stats_desc[j].name); | 261 | rq_stats_desc[j].format, i); |
263 | 262 | ||
264 | for (tc = 0; tc < priv->params.num_tc; tc++) | 263 | for (tc = 0; tc < priv->params.num_tc; tc++) |
265 | for (i = 0; i < priv->params.num_channels; i++) | 264 | for (i = 0; i < priv->params.num_channels; i++) |
266 | for (j = 0; j < NUM_SQ_STATS; j++) | 265 | for (j = 0; j < NUM_SQ_STATS; j++) |
267 | sprintf(data + (idx++) * ETH_GSTRING_LEN, | 266 | sprintf(data + (idx++) * ETH_GSTRING_LEN, |
268 | "tx%d_%s", | 267 | sq_stats_desc[j].format, |
269 | priv->channeltc_to_txq_map[i][tc], | 268 | priv->channeltc_to_txq_map[i][tc]); |
270 | sq_stats_desc[j].name); | ||
271 | } | 269 | } |
272 | 270 | ||
273 | static void mlx5e_get_strings(struct net_device *dev, | 271 | static void mlx5e_get_strings(struct net_device *dev, |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 793d7a1f92b5..cb6defd71fc1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -105,11 +105,11 @@ static void mlx5e_update_sw_counters(struct mlx5e_priv *priv) | |||
105 | 105 | ||
106 | s->rx_packets += rq_stats->packets; | 106 | s->rx_packets += rq_stats->packets; |
107 | s->rx_bytes += rq_stats->bytes; | 107 | s->rx_bytes += rq_stats->bytes; |
108 | s->lro_packets += rq_stats->lro_packets; | 108 | s->rx_lro_packets += rq_stats->lro_packets; |
109 | s->lro_bytes += rq_stats->lro_bytes; | 109 | s->rx_lro_bytes += rq_stats->lro_bytes; |
110 | s->rx_csum_none += rq_stats->csum_none; | 110 | s->rx_csum_none += rq_stats->csum_none; |
111 | s->rx_csum_sw += rq_stats->csum_sw; | 111 | s->rx_csum_complete += rq_stats->csum_complete; |
112 | s->rx_csum_inner += rq_stats->csum_inner; | 112 | s->rx_csum_unnecessary_inner += rq_stats->csum_unnecessary_inner; |
113 | s->rx_wqe_err += rq_stats->wqe_err; | 113 | s->rx_wqe_err += rq_stats->wqe_err; |
114 | s->rx_mpwqe_filler += rq_stats->mpwqe_filler; | 114 | s->rx_mpwqe_filler += rq_stats->mpwqe_filler; |
115 | s->rx_mpwqe_frag += rq_stats->mpwqe_frag; | 115 | s->rx_mpwqe_frag += rq_stats->mpwqe_frag; |
@@ -122,24 +122,23 @@ static void mlx5e_update_sw_counters(struct mlx5e_priv *priv) | |||
122 | 122 | ||
123 | s->tx_packets += sq_stats->packets; | 123 | s->tx_packets += sq_stats->packets; |
124 | s->tx_bytes += sq_stats->bytes; | 124 | s->tx_bytes += sq_stats->bytes; |
125 | s->tso_packets += sq_stats->tso_packets; | 125 | s->tx_tso_packets += sq_stats->tso_packets; |
126 | s->tso_bytes += sq_stats->tso_bytes; | 126 | s->tx_tso_bytes += sq_stats->tso_bytes; |
127 | s->tso_inner_packets += sq_stats->tso_inner_packets; | 127 | s->tx_tso_inner_packets += sq_stats->tso_inner_packets; |
128 | s->tso_inner_bytes += sq_stats->tso_inner_bytes; | 128 | s->tx_tso_inner_bytes += sq_stats->tso_inner_bytes; |
129 | s->tx_queue_stopped += sq_stats->stopped; | 129 | s->tx_queue_stopped += sq_stats->stopped; |
130 | s->tx_queue_wake += sq_stats->wake; | 130 | s->tx_queue_wake += sq_stats->wake; |
131 | s->tx_queue_dropped += sq_stats->dropped; | 131 | s->tx_queue_dropped += sq_stats->dropped; |
132 | s->tx_csum_inner += sq_stats->csum_offload_inner; | 132 | s->tx_csum_partial_inner += sq_stats->csum_partial_inner; |
133 | tx_offload_none += sq_stats->csum_offload_none; | 133 | tx_offload_none += sq_stats->csum_none; |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | /* Update calculated offload counters */ | 137 | /* Update calculated offload counters */ |
138 | s->tx_csum_offload = s->tx_packets - tx_offload_none - s->tx_csum_inner; | 138 | s->tx_csum_partial = s->tx_packets - tx_offload_none - s->tx_csum_partial_inner; |
139 | s->rx_csum_good = s->rx_packets - s->rx_csum_none - | 139 | s->rx_csum_unnecessary = s->rx_packets - s->rx_csum_none - s->rx_csum_complete; |
140 | s->rx_csum_sw; | ||
141 | 140 | ||
142 | s->link_down_events = MLX5_GET(ppcnt_reg, | 141 | s->link_down_events_phy = MLX5_GET(ppcnt_reg, |
143 | priv->stats.pport.phy_counters, | 142 | priv->stats.pport.phy_counters, |
144 | counter_set.phys_layer_cntrs.link_down_events); | 143 | counter_set.phys_layer_cntrs.link_down_events); |
145 | } | 144 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index bd947704b59c..022acc2e8922 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | |||
@@ -689,7 +689,7 @@ static inline void mlx5e_handle_csum(struct net_device *netdev, | |||
689 | if (is_first_ethertype_ip(skb)) { | 689 | if (is_first_ethertype_ip(skb)) { |
690 | skb->ip_summed = CHECKSUM_COMPLETE; | 690 | skb->ip_summed = CHECKSUM_COMPLETE; |
691 | skb->csum = csum_unfold((__force __sum16)cqe->check_sum); | 691 | skb->csum = csum_unfold((__force __sum16)cqe->check_sum); |
692 | rq->stats.csum_sw++; | 692 | rq->stats.csum_complete++; |
693 | return; | 693 | return; |
694 | } | 694 | } |
695 | 695 | ||
@@ -699,7 +699,7 @@ static inline void mlx5e_handle_csum(struct net_device *netdev, | |||
699 | if (cqe_is_tunneled(cqe)) { | 699 | if (cqe_is_tunneled(cqe)) { |
700 | skb->csum_level = 1; | 700 | skb->csum_level = 1; |
701 | skb->encapsulation = 1; | 701 | skb->encapsulation = 1; |
702 | rq->stats.csum_inner++; | 702 | rq->stats.csum_unnecessary_inner++; |
703 | } | 703 | } |
704 | return; | 704 | return; |
705 | } | 705 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 83bc32b25849..fcd490cc5610 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | |||
@@ -42,9 +42,11 @@ | |||
42 | be64_to_cpu(*(__be32 *)((char *)ptr + dsc[i].offset)) | 42 | be64_to_cpu(*(__be32 *)((char *)ptr + dsc[i].offset)) |
43 | 43 | ||
44 | #define MLX5E_DECLARE_STAT(type, fld) #fld, offsetof(type, fld) | 44 | #define MLX5E_DECLARE_STAT(type, fld) #fld, offsetof(type, fld) |
45 | #define MLX5E_DECLARE_RX_STAT(type, fld) "rx%d_"#fld, offsetof(type, fld) | ||
46 | #define MLX5E_DECLARE_TX_STAT(type, fld) "tx%d_"#fld, offsetof(type, fld) | ||
45 | 47 | ||
46 | struct counter_desc { | 48 | struct counter_desc { |
47 | char name[ETH_GSTRING_LEN]; | 49 | char format[ETH_GSTRING_LEN]; |
48 | int offset; /* Byte offset */ | 50 | int offset; /* Byte offset */ |
49 | }; | 51 | }; |
50 | 52 | ||
@@ -53,18 +55,18 @@ struct mlx5e_sw_stats { | |||
53 | u64 rx_bytes; | 55 | u64 rx_bytes; |
54 | u64 tx_packets; | 56 | u64 tx_packets; |
55 | u64 tx_bytes; | 57 | u64 tx_bytes; |
56 | u64 tso_packets; | 58 | u64 tx_tso_packets; |
57 | u64 tso_bytes; | 59 | u64 tx_tso_bytes; |
58 | u64 tso_inner_packets; | 60 | u64 tx_tso_inner_packets; |
59 | u64 tso_inner_bytes; | 61 | u64 tx_tso_inner_bytes; |
60 | u64 lro_packets; | 62 | u64 rx_lro_packets; |
61 | u64 lro_bytes; | 63 | u64 rx_lro_bytes; |
62 | u64 rx_csum_good; | 64 | u64 rx_csum_unnecessary; |
63 | u64 rx_csum_none; | 65 | u64 rx_csum_none; |
64 | u64 rx_csum_sw; | 66 | u64 rx_csum_complete; |
65 | u64 rx_csum_inner; | 67 | u64 rx_csum_unnecessary_inner; |
66 | u64 tx_csum_offload; | 68 | u64 tx_csum_partial; |
67 | u64 tx_csum_inner; | 69 | u64 tx_csum_partial_inner; |
68 | u64 tx_queue_stopped; | 70 | u64 tx_queue_stopped; |
69 | u64 tx_queue_wake; | 71 | u64 tx_queue_wake; |
70 | u64 tx_queue_dropped; | 72 | u64 tx_queue_dropped; |
@@ -76,7 +78,7 @@ struct mlx5e_sw_stats { | |||
76 | u64 rx_cqe_compress_pkts; | 78 | u64 rx_cqe_compress_pkts; |
77 | 79 | ||
78 | /* Special handling counters */ | 80 | /* Special handling counters */ |
79 | u64 link_down_events; | 81 | u64 link_down_events_phy; |
80 | }; | 82 | }; |
81 | 83 | ||
82 | static const struct counter_desc sw_stats_desc[] = { | 84 | static const struct counter_desc sw_stats_desc[] = { |
@@ -84,18 +86,18 @@ static const struct counter_desc sw_stats_desc[] = { | |||
84 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_bytes) }, | 86 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_bytes) }, |
85 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_packets) }, | 87 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_packets) }, |
86 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_bytes) }, | 88 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_bytes) }, |
87 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tso_packets) }, | 89 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_tso_packets) }, |
88 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tso_bytes) }, | 90 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_tso_bytes) }, |
89 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tso_inner_packets) }, | 91 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_tso_inner_packets) }, |
90 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tso_inner_bytes) }, | 92 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_tso_inner_bytes) }, |
91 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, lro_packets) }, | 93 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_lro_packets) }, |
92 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, lro_bytes) }, | 94 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_lro_bytes) }, |
93 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_good) }, | 95 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary) }, |
94 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_none) }, | 96 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_none) }, |
95 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_sw) }, | 97 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_complete) }, |
96 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_inner) }, | 98 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary_inner) }, |
97 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_offload) }, | 99 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_partial) }, |
98 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_inner) }, | 100 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_csum_partial_inner) }, |
99 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_stopped) }, | 101 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_stopped) }, |
100 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_wake) }, | 102 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_wake) }, |
101 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_dropped) }, | 103 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, tx_queue_dropped) }, |
@@ -105,7 +107,7 @@ static const struct counter_desc sw_stats_desc[] = { | |||
105 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_buff_alloc_err) }, | 107 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_buff_alloc_err) }, |
106 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_cqe_compress_blks) }, | 108 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_cqe_compress_blks) }, |
107 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_cqe_compress_pkts) }, | 109 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_cqe_compress_pkts) }, |
108 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, link_down_events) }, | 110 | { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, link_down_events_phy) }, |
109 | }; | 111 | }; |
110 | 112 | ||
111 | struct mlx5e_qcounter_stats { | 113 | struct mlx5e_qcounter_stats { |
@@ -125,12 +127,6 @@ struct mlx5e_vport_stats { | |||
125 | }; | 127 | }; |
126 | 128 | ||
127 | static const struct counter_desc vport_stats_desc[] = { | 129 | static const struct counter_desc vport_stats_desc[] = { |
128 | { "rx_vport_error_packets", | ||
129 | VPORT_COUNTER_OFF(received_errors.packets) }, | ||
130 | { "rx_vport_error_bytes", VPORT_COUNTER_OFF(received_errors.octets) }, | ||
131 | { "tx_vport_error_packets", | ||
132 | VPORT_COUNTER_OFF(transmit_errors.packets) }, | ||
133 | { "tx_vport_error_bytes", VPORT_COUNTER_OFF(transmit_errors.octets) }, | ||
134 | { "rx_vport_unicast_packets", | 130 | { "rx_vport_unicast_packets", |
135 | VPORT_COUNTER_OFF(received_eth_unicast.packets) }, | 131 | VPORT_COUNTER_OFF(received_eth_unicast.packets) }, |
136 | { "rx_vport_unicast_bytes", | 132 | { "rx_vport_unicast_bytes", |
@@ -192,94 +188,68 @@ struct mlx5e_pport_stats { | |||
192 | }; | 188 | }; |
193 | 189 | ||
194 | static const struct counter_desc pport_802_3_stats_desc[] = { | 190 | static const struct counter_desc pport_802_3_stats_desc[] = { |
195 | { "frames_tx", PPORT_802_3_OFF(a_frames_transmitted_ok) }, | 191 | { "tx_packets_phy", PPORT_802_3_OFF(a_frames_transmitted_ok) }, |
196 | { "frames_rx", PPORT_802_3_OFF(a_frames_received_ok) }, | 192 | { "rx_packets_phy", PPORT_802_3_OFF(a_frames_received_ok) }, |
197 | { "check_seq_err", PPORT_802_3_OFF(a_frame_check_sequence_errors) }, | 193 | { "rx_crc_errors_phy", PPORT_802_3_OFF(a_frame_check_sequence_errors) }, |
198 | { "alignment_err", PPORT_802_3_OFF(a_alignment_errors) }, | 194 | { "tx_bytes_phy", PPORT_802_3_OFF(a_octets_transmitted_ok) }, |
199 | { "octets_tx", PPORT_802_3_OFF(a_octets_transmitted_ok) }, | 195 | { "rx_bytes_phy", PPORT_802_3_OFF(a_octets_received_ok) }, |
200 | { "octets_received", PPORT_802_3_OFF(a_octets_received_ok) }, | 196 | { "tx_multicast_phy", PPORT_802_3_OFF(a_multicast_frames_xmitted_ok) }, |
201 | { "multicast_xmitted", PPORT_802_3_OFF(a_multicast_frames_xmitted_ok) }, | 197 | { "tx_broadcast_phy", PPORT_802_3_OFF(a_broadcast_frames_xmitted_ok) }, |
202 | { "broadcast_xmitted", PPORT_802_3_OFF(a_broadcast_frames_xmitted_ok) }, | 198 | { "rx_multicast_phy", PPORT_802_3_OFF(a_multicast_frames_received_ok) }, |
203 | { "multicast_rx", PPORT_802_3_OFF(a_multicast_frames_received_ok) }, | 199 | { "rx_broadcast_phy", PPORT_802_3_OFF(a_broadcast_frames_received_ok) }, |
204 | { "broadcast_rx", PPORT_802_3_OFF(a_broadcast_frames_received_ok) }, | 200 | { "rx_in_range_len_errors_phy", PPORT_802_3_OFF(a_in_range_length_errors) }, |
205 | { "in_range_len_errors", PPORT_802_3_OFF(a_in_range_length_errors) }, | 201 | { "rx_out_of_range_len_phy", PPORT_802_3_OFF(a_out_of_range_length_field) }, |
206 | { "out_of_range_len", PPORT_802_3_OFF(a_out_of_range_length_field) }, | 202 | { "rx_oversize_pkts_phy", PPORT_802_3_OFF(a_frame_too_long_errors) }, |
207 | { "too_long_errors", PPORT_802_3_OFF(a_frame_too_long_errors) }, | 203 | { "rx_symbol_err_phy", PPORT_802_3_OFF(a_symbol_error_during_carrier) }, |
208 | { "symbol_err", PPORT_802_3_OFF(a_symbol_error_during_carrier) }, | 204 | { "tx_mac_control_phy", PPORT_802_3_OFF(a_mac_control_frames_transmitted) }, |
209 | { "mac_control_tx", PPORT_802_3_OFF(a_mac_control_frames_transmitted) }, | 205 | { "rx_mac_control_phy", PPORT_802_3_OFF(a_mac_control_frames_received) }, |
210 | { "mac_control_rx", PPORT_802_3_OFF(a_mac_control_frames_received) }, | 206 | { "rx_unsupported_op_phy", PPORT_802_3_OFF(a_unsupported_opcodes_received) }, |
211 | { "unsupported_op_rx", | 207 | { "rx_pause_ctrl_phy", PPORT_802_3_OFF(a_pause_mac_ctrl_frames_received) }, |
212 | PPORT_802_3_OFF(a_unsupported_opcodes_received) }, | 208 | { "tx_pause_ctrl_phy", PPORT_802_3_OFF(a_pause_mac_ctrl_frames_transmitted) }, |
213 | { "pause_ctrl_rx", PPORT_802_3_OFF(a_pause_mac_ctrl_frames_received) }, | ||
214 | { "pause_ctrl_tx", | ||
215 | PPORT_802_3_OFF(a_pause_mac_ctrl_frames_transmitted) }, | ||
216 | }; | 209 | }; |
217 | 210 | ||
218 | static const struct counter_desc pport_2863_stats_desc[] = { | 211 | static const struct counter_desc pport_2863_stats_desc[] = { |
219 | { "in_octets", PPORT_2863_OFF(if_in_octets) }, | 212 | { "rx_discards_phy", PPORT_2863_OFF(if_in_discards) }, |
220 | { "in_ucast_pkts", PPORT_2863_OFF(if_in_ucast_pkts) }, | 213 | { "tx_discards_phy", PPORT_2863_OFF(if_out_discards) }, |
221 | { "in_discards", PPORT_2863_OFF(if_in_discards) }, | 214 | { "tx_errors_phy", PPORT_2863_OFF(if_out_errors) }, |
222 | { "in_errors", PPORT_2863_OFF(if_in_errors) }, | ||
223 | { "in_unknown_protos", PPORT_2863_OFF(if_in_unknown_protos) }, | ||
224 | { "out_octets", PPORT_2863_OFF(if_out_octets) }, | ||
225 | { "out_ucast_pkts", PPORT_2863_OFF(if_out_ucast_pkts) }, | ||
226 | { "out_discards", PPORT_2863_OFF(if_out_discards) }, | ||
227 | { "out_errors", PPORT_2863_OFF(if_out_errors) }, | ||
228 | { "in_multicast_pkts", PPORT_2863_OFF(if_in_multicast_pkts) }, | ||
229 | { "in_broadcast_pkts", PPORT_2863_OFF(if_in_broadcast_pkts) }, | ||
230 | { "out_multicast_pkts", PPORT_2863_OFF(if_out_multicast_pkts) }, | ||
231 | { "out_broadcast_pkts", PPORT_2863_OFF(if_out_broadcast_pkts) }, | ||
232 | }; | 215 | }; |
233 | 216 | ||
234 | static const struct counter_desc pport_2819_stats_desc[] = { | 217 | static const struct counter_desc pport_2819_stats_desc[] = { |
235 | { "drop_events", PPORT_2819_OFF(ether_stats_drop_events) }, | 218 | { "rx_undersize_pkts_phy", PPORT_2819_OFF(ether_stats_undersize_pkts) }, |
236 | { "octets", PPORT_2819_OFF(ether_stats_octets) }, | 219 | { "rx_fragments_phy", PPORT_2819_OFF(ether_stats_fragments) }, |
237 | { "pkts", PPORT_2819_OFF(ether_stats_pkts) }, | 220 | { "rx_jabbers_phy", PPORT_2819_OFF(ether_stats_jabbers) }, |
238 | { "broadcast_pkts", PPORT_2819_OFF(ether_stats_broadcast_pkts) }, | 221 | { "rx_64_bytes_phy", PPORT_2819_OFF(ether_stats_pkts64octets) }, |
239 | { "multicast_pkts", PPORT_2819_OFF(ether_stats_multicast_pkts) }, | 222 | { "rx_65_to_127_bytes_phy", PPORT_2819_OFF(ether_stats_pkts65to127octets) }, |
240 | { "crc_align_errors", PPORT_2819_OFF(ether_stats_crc_align_errors) }, | 223 | { "rx_128_to_255_bytes_phy", PPORT_2819_OFF(ether_stats_pkts128to255octets) }, |
241 | { "undersize_pkts", PPORT_2819_OFF(ether_stats_undersize_pkts) }, | 224 | { "rx_256_to_511_bytes_phy", PPORT_2819_OFF(ether_stats_pkts256to511octets) }, |
242 | { "oversize_pkts", PPORT_2819_OFF(ether_stats_oversize_pkts) }, | 225 | { "rx_512_to_1023_bytes_phy", PPORT_2819_OFF(ether_stats_pkts512to1023octets) }, |
243 | { "fragments", PPORT_2819_OFF(ether_stats_fragments) }, | 226 | { "rx_1024_to_1518_bytes_phy", PPORT_2819_OFF(ether_stats_pkts1024to1518octets) }, |
244 | { "jabbers", PPORT_2819_OFF(ether_stats_jabbers) }, | 227 | { "rx_1519_to_2047_bytes_phy", PPORT_2819_OFF(ether_stats_pkts1519to2047octets) }, |
245 | { "collisions", PPORT_2819_OFF(ether_stats_collisions) }, | 228 | { "rx_2048_to_4095_bytes_phy", PPORT_2819_OFF(ether_stats_pkts2048to4095octets) }, |
246 | { "p64octets", PPORT_2819_OFF(ether_stats_pkts64octets) }, | 229 | { "rx_4096_to_8191_bytes_phy", PPORT_2819_OFF(ether_stats_pkts4096to8191octets) }, |
247 | { "p65to127octets", PPORT_2819_OFF(ether_stats_pkts65to127octets) }, | 230 | { "rx_8192_to_10239_bytes_phy", PPORT_2819_OFF(ether_stats_pkts8192to10239octets) }, |
248 | { "p128to255octets", PPORT_2819_OFF(ether_stats_pkts128to255octets) }, | ||
249 | { "p256to511octets", PPORT_2819_OFF(ether_stats_pkts256to511octets) }, | ||
250 | { "p512to1023octets", PPORT_2819_OFF(ether_stats_pkts512to1023octets) }, | ||
251 | { "p1024to1518octets", | ||
252 | PPORT_2819_OFF(ether_stats_pkts1024to1518octets) }, | ||
253 | { "p1519to2047octets", | ||
254 | PPORT_2819_OFF(ether_stats_pkts1519to2047octets) }, | ||
255 | { "p2048to4095octets", | ||
256 | PPORT_2819_OFF(ether_stats_pkts2048to4095octets) }, | ||
257 | { "p4096to8191octets", | ||
258 | PPORT_2819_OFF(ether_stats_pkts4096to8191octets) }, | ||
259 | { "p8192to10239octets", | ||
260 | PPORT_2819_OFF(ether_stats_pkts8192to10239octets) }, | ||
261 | }; | 231 | }; |
262 | 232 | ||
263 | static const struct counter_desc pport_per_prio_traffic_stats_desc[] = { | 233 | static const struct counter_desc pport_per_prio_traffic_stats_desc[] = { |
264 | { "rx_octets", PPORT_PER_PRIO_OFF(rx_octets) }, | 234 | { "rx_prio%d_bytes", PPORT_PER_PRIO_OFF(rx_octets) }, |
265 | { "rx_frames", PPORT_PER_PRIO_OFF(rx_frames) }, | 235 | { "rx_prio%d_packets", PPORT_PER_PRIO_OFF(rx_frames) }, |
266 | { "tx_octets", PPORT_PER_PRIO_OFF(tx_octets) }, | 236 | { "tx_prio%d_bytes", PPORT_PER_PRIO_OFF(tx_octets) }, |
267 | { "tx_frames", PPORT_PER_PRIO_OFF(tx_frames) }, | 237 | { "tx_prio%d_packets", PPORT_PER_PRIO_OFF(tx_frames) }, |
268 | }; | 238 | }; |
269 | 239 | ||
270 | static const struct counter_desc pport_per_prio_pfc_stats_desc[] = { | 240 | static const struct counter_desc pport_per_prio_pfc_stats_desc[] = { |
271 | { "rx_pause", PPORT_PER_PRIO_OFF(rx_pause) }, | 241 | { "rx_prio%d_pause", PPORT_PER_PRIO_OFF(rx_pause) }, |
272 | { "rx_pause_duration", PPORT_PER_PRIO_OFF(rx_pause_duration) }, | 242 | { "rx_prio%d_pause_duration", PPORT_PER_PRIO_OFF(rx_pause_duration) }, |
273 | { "tx_pause", PPORT_PER_PRIO_OFF(tx_pause) }, | 243 | { "tx_prio%d_pause", PPORT_PER_PRIO_OFF(tx_pause) }, |
274 | { "tx_pause_duration", PPORT_PER_PRIO_OFF(tx_pause_duration) }, | 244 | { "tx_prio%d_pause_duration", PPORT_PER_PRIO_OFF(tx_pause_duration) }, |
275 | { "rx_pause_transition", PPORT_PER_PRIO_OFF(rx_pause_transition) }, | 245 | { "rx_prio%d_pause_transition", PPORT_PER_PRIO_OFF(rx_pause_transition) }, |
276 | }; | 246 | }; |
277 | 247 | ||
278 | struct mlx5e_rq_stats { | 248 | struct mlx5e_rq_stats { |
279 | u64 packets; | 249 | u64 packets; |
280 | u64 bytes; | 250 | u64 bytes; |
281 | u64 csum_sw; | 251 | u64 csum_complete; |
282 | u64 csum_inner; | 252 | u64 csum_unnecessary_inner; |
283 | u64 csum_none; | 253 | u64 csum_none; |
284 | u64 lro_packets; | 254 | u64 lro_packets; |
285 | u64 lro_bytes; | 255 | u64 lro_bytes; |
@@ -292,19 +262,19 @@ struct mlx5e_rq_stats { | |||
292 | }; | 262 | }; |
293 | 263 | ||
294 | static const struct counter_desc rq_stats_desc[] = { | 264 | static const struct counter_desc rq_stats_desc[] = { |
295 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, packets) }, | 265 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, packets) }, |
296 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, bytes) }, | 266 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, bytes) }, |
297 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, csum_sw) }, | 267 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_complete) }, |
298 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, csum_inner) }, | 268 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_unnecessary_inner) }, |
299 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, csum_none) }, | 269 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_none) }, |
300 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, lro_packets) }, | 270 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, lro_packets) }, |
301 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, lro_bytes) }, | 271 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, lro_bytes) }, |
302 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, wqe_err) }, | 272 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, wqe_err) }, |
303 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, mpwqe_filler) }, | 273 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, mpwqe_filler) }, |
304 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, mpwqe_frag) }, | 274 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, mpwqe_frag) }, |
305 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, buff_alloc_err) }, | 275 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, buff_alloc_err) }, |
306 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, cqe_compress_blks) }, | 276 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, cqe_compress_blks) }, |
307 | { MLX5E_DECLARE_STAT(struct mlx5e_rq_stats, cqe_compress_pkts) }, | 277 | { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, cqe_compress_pkts) }, |
308 | }; | 278 | }; |
309 | 279 | ||
310 | struct mlx5e_sq_stats { | 280 | struct mlx5e_sq_stats { |
@@ -315,28 +285,28 @@ struct mlx5e_sq_stats { | |||
315 | u64 tso_bytes; | 285 | u64 tso_bytes; |
316 | u64 tso_inner_packets; | 286 | u64 tso_inner_packets; |
317 | u64 tso_inner_bytes; | 287 | u64 tso_inner_bytes; |
318 | u64 csum_offload_inner; | 288 | u64 csum_partial_inner; |
319 | u64 nop; | 289 | u64 nop; |
320 | /* less likely accessed in data path */ | 290 | /* less likely accessed in data path */ |
321 | u64 csum_offload_none; | 291 | u64 csum_none; |
322 | u64 stopped; | 292 | u64 stopped; |
323 | u64 wake; | 293 | u64 wake; |
324 | u64 dropped; | 294 | u64 dropped; |
325 | }; | 295 | }; |
326 | 296 | ||
327 | static const struct counter_desc sq_stats_desc[] = { | 297 | static const struct counter_desc sq_stats_desc[] = { |
328 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, packets) }, | 298 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, packets) }, |
329 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, bytes) }, | 299 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, bytes) }, |
330 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, tso_packets) }, | 300 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, tso_packets) }, |
331 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, tso_bytes) }, | 301 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, tso_bytes) }, |
332 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, tso_inner_packets) }, | 302 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, tso_inner_packets) }, |
333 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, tso_inner_bytes) }, | 303 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, tso_inner_bytes) }, |
334 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, csum_offload_inner) }, | 304 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, csum_partial_inner) }, |
335 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, nop) }, | 305 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, nop) }, |
336 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, csum_offload_none) }, | 306 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, csum_none) }, |
337 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, stopped) }, | 307 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, stopped) }, |
338 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, wake) }, | 308 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, wake) }, |
339 | { MLX5E_DECLARE_STAT(struct mlx5e_sq_stats, dropped) }, | 309 | { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, dropped) }, |
340 | }; | 310 | }; |
341 | 311 | ||
342 | #define NUM_SW_COUNTERS ARRAY_SIZE(sw_stats_desc) | 312 | #define NUM_SW_COUNTERS ARRAY_SIZE(sw_stats_desc) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index b000ddc29553..5a750b9cd006 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | |||
@@ -192,12 +192,12 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) | |||
192 | if (skb->encapsulation) { | 192 | if (skb->encapsulation) { |
193 | eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM | | 193 | eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM | |
194 | MLX5_ETH_WQE_L4_INNER_CSUM; | 194 | MLX5_ETH_WQE_L4_INNER_CSUM; |
195 | sq->stats.csum_offload_inner++; | 195 | sq->stats.csum_partial_inner++; |
196 | } else { | 196 | } else { |
197 | eseg->cs_flags |= MLX5_ETH_WQE_L4_CSUM; | 197 | eseg->cs_flags |= MLX5_ETH_WQE_L4_CSUM; |
198 | } | 198 | } |
199 | } else | 199 | } else |
200 | sq->stats.csum_offload_none++; | 200 | sq->stats.csum_none++; |
201 | 201 | ||
202 | if (sq->cc != sq->prev_cc) { | 202 | if (sq->cc != sq->prev_cc) { |
203 | sq->prev_cc = sq->cc; | 203 | sq->prev_cc = sq->cc; |