@@ -96,11 +96,9 @@ static const char oct_stats_strings[][ETH_GSTRING_LEN] = {
96
96
"tx_packets" ,
97
97
"rx_bytes" ,
98
98
"tx_bytes" ,
99
- "rx_errors" , /*jabber_err+l2_err+frame_err */
100
- "tx_errors" , /*fw_err_pko+fw_err_link+fw_err_drop */
101
- "rx_dropped" , /*st->fromwire.total_rcvd - st->fromwire.fw_total_rcvd +
102
- *st->fromwire.dmac_drop + st->fromwire.fw_err_drop
103
- */
99
+ "rx_errors" ,
100
+ "tx_errors" ,
101
+ "rx_dropped" ,
104
102
"tx_dropped" ,
105
103
106
104
"tx_total_sent" ,
@@ -119,7 +117,7 @@ static const char oct_stats_strings[][ETH_GSTRING_LEN] = {
119
117
"mac_tx_total_bytes" ,
120
118
"mac_tx_mcast_pkts" ,
121
119
"mac_tx_bcast_pkts" ,
122
- "mac_tx_ctl_packets" , /*oct->link_stats.fromhost.ctl_sent */
120
+ "mac_tx_ctl_packets" ,
123
121
"mac_tx_total_collisions" ,
124
122
"mac_tx_one_collision" ,
125
123
"mac_tx_multi_collison" ,
@@ -170,17 +168,17 @@ static const char oct_vf_stats_strings[][ETH_GSTRING_LEN] = {
170
168
"tx_packets" ,
171
169
"rx_bytes" ,
172
170
"tx_bytes" ,
173
- "rx_errors" , /* jabber_err + l2_err+frame_err */
174
- "tx_errors" , /* fw_err_pko + fw_err_link+fw_err_drop */
175
- "rx_dropped" , /* total_rcvd - fw_total_rcvd + dmac_drop + fw_err_drop */
171
+ "rx_errors" ,
172
+ "tx_errors" ,
173
+ "rx_dropped" ,
176
174
"tx_dropped" ,
177
175
"link_state_changes" ,
178
176
};
179
177
180
178
/* statistics of host tx queue */
181
179
static const char oct_iq_stats_strings [][ETH_GSTRING_LEN ] = {
182
- "packets" , /*oct->instr_queue[iq_no]->stats.tx_done*/
183
- "bytes" , /*oct->instr_queue[iq_no]->stats.tx_tot_bytes*/
180
+ "packets" ,
181
+ "bytes" ,
184
182
"dropped" ,
185
183
"iq_busy" ,
186
184
"sgentry_sent" ,
@@ -197,13 +195,9 @@ static const char oct_iq_stats_strings[][ETH_GSTRING_LEN] = {
197
195
198
196
/* statistics of host rx queue */
199
197
static const char oct_droq_stats_strings [][ETH_GSTRING_LEN ] = {
200
- "packets" , /*oct->droq[oq_no]->stats.rx_pkts_received */
201
- "bytes" , /*oct->droq[oq_no]->stats.rx_bytes_received */
202
- "dropped" , /*oct->droq[oq_no]->stats.rx_dropped+
203
- *oct->droq[oq_no]->stats.dropped_nodispatch+
204
- *oct->droq[oq_no]->stats.dropped_toomany+
205
- *oct->droq[oq_no]->stats.dropped_nomem
206
- */
198
+ "packets" ,
199
+ "bytes" ,
200
+ "dropped" ,
207
201
"dropped_nomem" ,
208
202
"dropped_toomany" ,
209
203
"fw_dropped" ,
@@ -1080,16 +1074,33 @@ lio_get_ethtool_stats(struct net_device *netdev,
1080
1074
data [i ++ ] = CVM_CAST64 (netstats -> rx_bytes );
1081
1075
/*sum of oct->instr_queue[iq_no]->stats.tx_tot_bytes */
1082
1076
data [i ++ ] = CVM_CAST64 (netstats -> tx_bytes );
1083
- data [i ++ ] = CVM_CAST64 (netstats -> rx_errors );
1077
+ data [i ++ ] = CVM_CAST64 (netstats -> rx_errors +
1078
+ oct_dev -> link_stats .fromwire .fcs_err +
1079
+ oct_dev -> link_stats .fromwire .jabber_err +
1080
+ oct_dev -> link_stats .fromwire .l2_err +
1081
+ oct_dev -> link_stats .fromwire .frame_err );
1084
1082
data [i ++ ] = CVM_CAST64 (netstats -> tx_errors );
1085
1083
/*sum of oct->droq[oq_no]->stats->rx_dropped +
1086
1084
*oct->droq[oq_no]->stats->dropped_nodispatch +
1087
1085
*oct->droq[oq_no]->stats->dropped_toomany +
1088
1086
*oct->droq[oq_no]->stats->dropped_nomem
1089
1087
*/
1090
- data [i ++ ] = CVM_CAST64 (netstats -> rx_dropped );
1088
+ data [i ++ ] = CVM_CAST64 (netstats -> rx_dropped +
1089
+ oct_dev -> link_stats .fromwire .fifo_err +
1090
+ oct_dev -> link_stats .fromwire .dmac_drop +
1091
+ oct_dev -> link_stats .fromwire .red_drops +
1092
+ oct_dev -> link_stats .fromwire .fw_err_pko +
1093
+ oct_dev -> link_stats .fromwire .fw_err_link +
1094
+ oct_dev -> link_stats .fromwire .fw_err_drop );
1091
1095
/*sum of oct->instr_queue[iq_no]->stats.tx_dropped */
1092
- data [i ++ ] = CVM_CAST64 (netstats -> tx_dropped );
1096
+ data [i ++ ] = CVM_CAST64 (netstats -> tx_dropped +
1097
+ oct_dev -> link_stats .fromhost .max_collision_fail +
1098
+ oct_dev -> link_stats .fromhost .max_deferral_fail +
1099
+ oct_dev -> link_stats .fromhost .total_collisions +
1100
+ oct_dev -> link_stats .fromhost .fw_err_pko +
1101
+ oct_dev -> link_stats .fromhost .fw_err_link +
1102
+ oct_dev -> link_stats .fromhost .fw_err_drop +
1103
+ oct_dev -> link_stats .fromhost .fw_err_pki );
1093
1104
1094
1105
/* firmware tx stats */
1095
1106
/*per_core_stats[cvmx_get_core_num()].link_stats[mdata->from_ifidx].
@@ -1798,6 +1809,7 @@ octnet_nic_stats_callback(struct octeon_device *oct_dev,
1798
1809
rstats -> jabber_err = rsp_rstats -> jabber_err ;
1799
1810
rstats -> l2_err = rsp_rstats -> l2_err ;
1800
1811
rstats -> frame_err = rsp_rstats -> frame_err ;
1812
+ rstats -> red_drops = rsp_rstats -> red_drops ;
1801
1813
1802
1814
/* RX firmware stats */
1803
1815
rstats -> fw_total_rcvd = rsp_rstats -> fw_total_rcvd ;
0 commit comments