diff options
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_nic.c')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_nic.c | 72 |
1 files changed, 55 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index e95e8d09ff38..5cc0a9ae5bb1 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
@@ -1001,6 +1001,7 @@ static int nes_netdev_change_mtu(struct net_device *netdev, int new_mtu) | |||
1001 | return ret; | 1001 | return ret; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | |||
1004 | static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = { | 1005 | static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = { |
1005 | "Link Change Interrupts", | 1006 | "Link Change Interrupts", |
1006 | "Linearized SKBs", | 1007 | "Linearized SKBs", |
@@ -1015,11 +1016,15 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = { | |||
1015 | "Rx Jabber Errors", | 1016 | "Rx Jabber Errors", |
1016 | "Rx Oversized Frames", | 1017 | "Rx Oversized Frames", |
1017 | "Rx Short Frames", | 1018 | "Rx Short Frames", |
1019 | "Rx Length Errors", | ||
1020 | "Rx CRC Errors", | ||
1021 | "Rx Port Discard", | ||
1018 | "Endnode Rx Discards", | 1022 | "Endnode Rx Discards", |
1019 | "Endnode Rx Octets", | 1023 | "Endnode Rx Octets", |
1020 | "Endnode Rx Frames", | 1024 | "Endnode Rx Frames", |
1021 | "Endnode Tx Octets", | 1025 | "Endnode Tx Octets", |
1022 | "Endnode Tx Frames", | 1026 | "Endnode Tx Frames", |
1027 | "Tx Errors", | ||
1023 | "mh detected", | 1028 | "mh detected", |
1024 | "mh pauses", | 1029 | "mh pauses", |
1025 | "Retransmission Count", | 1030 | "Retransmission Count", |
@@ -1048,19 +1053,13 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = { | |||
1048 | "CM Nodes Destroyed", | 1053 | "CM Nodes Destroyed", |
1049 | "CM Accel Drops", | 1054 | "CM Accel Drops", |
1050 | "CM Resets Received", | 1055 | "CM Resets Received", |
1056 | "Free 4Kpbls", | ||
1057 | "Free 256pbls", | ||
1051 | "Timer Inits", | 1058 | "Timer Inits", |
1052 | "CQ Depth 1", | ||
1053 | "CQ Depth 4", | ||
1054 | "CQ Depth 16", | ||
1055 | "CQ Depth 24", | ||
1056 | "CQ Depth 32", | ||
1057 | "CQ Depth 128", | ||
1058 | "CQ Depth 256", | ||
1059 | "LRO aggregated", | 1059 | "LRO aggregated", |
1060 | "LRO flushed", | 1060 | "LRO flushed", |
1061 | "LRO no_desc", | 1061 | "LRO no_desc", |
1062 | }; | 1062 | }; |
1063 | |||
1064 | #define NES_ETHTOOL_STAT_COUNT ARRAY_SIZE(nes_ethtool_stringset) | 1063 | #define NES_ETHTOOL_STAT_COUNT ARRAY_SIZE(nes_ethtool_stringset) |
1065 | 1064 | ||
1066 | /** | 1065 | /** |
@@ -1120,12 +1119,14 @@ static void nes_netdev_get_strings(struct net_device *netdev, u32 stringset, | |||
1120 | /** | 1119 | /** |
1121 | * nes_netdev_get_ethtool_stats | 1120 | * nes_netdev_get_ethtool_stats |
1122 | */ | 1121 | */ |
1122 | |||
1123 | static void nes_netdev_get_ethtool_stats(struct net_device *netdev, | 1123 | static void nes_netdev_get_ethtool_stats(struct net_device *netdev, |
1124 | struct ethtool_stats *target_ethtool_stats, u64 *target_stat_values) | 1124 | struct ethtool_stats *target_ethtool_stats, u64 *target_stat_values) |
1125 | { | 1125 | { |
1126 | u64 u64temp; | 1126 | u64 u64temp; |
1127 | struct nes_vnic *nesvnic = netdev_priv(netdev); | 1127 | struct nes_vnic *nesvnic = netdev_priv(netdev); |
1128 | struct nes_device *nesdev = nesvnic->nesdev; | 1128 | struct nes_device *nesdev = nesvnic->nesdev; |
1129 | struct nes_adapter *nesadapter = nesdev->nesadapter; | ||
1129 | u32 nic_count; | 1130 | u32 nic_count; |
1130 | u32 u32temp; | 1131 | u32 u32temp; |
1131 | u32 index = 0; | 1132 | u32 index = 0; |
@@ -1154,6 +1155,46 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, | |||
1154 | nesvnic->nesdev->port_tx_discards += u32temp; | 1155 | nesvnic->nesdev->port_tx_discards += u32temp; |
1155 | nesvnic->netstats.tx_dropped += u32temp; | 1156 | nesvnic->netstats.tx_dropped += u32temp; |
1156 | 1157 | ||
1158 | u32temp = nes_read_indexed(nesdev, | ||
1159 | NES_IDX_MAC_RX_SHORT_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1160 | nesvnic->netstats.rx_dropped += u32temp; | ||
1161 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1162 | nesvnic->nesdev->mac_rx_short_frames += u32temp; | ||
1163 | |||
1164 | u32temp = nes_read_indexed(nesdev, | ||
1165 | NES_IDX_MAC_RX_OVERSIZED_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1166 | nesvnic->netstats.rx_dropped += u32temp; | ||
1167 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1168 | nesvnic->nesdev->mac_rx_oversized_frames += u32temp; | ||
1169 | |||
1170 | u32temp = nes_read_indexed(nesdev, | ||
1171 | NES_IDX_MAC_RX_JABBER_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1172 | nesvnic->netstats.rx_dropped += u32temp; | ||
1173 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1174 | nesvnic->nesdev->mac_rx_jabber_frames += u32temp; | ||
1175 | |||
1176 | u32temp = nes_read_indexed(nesdev, | ||
1177 | NES_IDX_MAC_RX_SYMBOL_ERR_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1178 | nesvnic->netstats.rx_dropped += u32temp; | ||
1179 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1180 | nesvnic->nesdev->mac_rx_symbol_err_frames += u32temp; | ||
1181 | |||
1182 | u32temp = nes_read_indexed(nesdev, | ||
1183 | NES_IDX_MAC_RX_LENGTH_ERR_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1184 | nesvnic->netstats.rx_length_errors += u32temp; | ||
1185 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1186 | |||
1187 | u32temp = nes_read_indexed(nesdev, | ||
1188 | NES_IDX_MAC_RX_CRC_ERR_FRAMES + (nesvnic->nesdev->mac_index*0x200)); | ||
1189 | nesvnic->nesdev->mac_rx_errors += u32temp; | ||
1190 | nesvnic->nesdev->mac_rx_crc_errors += u32temp; | ||
1191 | nesvnic->netstats.rx_crc_errors += u32temp; | ||
1192 | |||
1193 | u32temp = nes_read_indexed(nesdev, | ||
1194 | NES_IDX_MAC_TX_ERRORS + (nesvnic->nesdev->mac_index*0x200)); | ||
1195 | nesvnic->nesdev->mac_tx_errors += u32temp; | ||
1196 | nesvnic->netstats.tx_errors += u32temp; | ||
1197 | |||
1157 | for (nic_count = 0; nic_count < NES_MAX_PORT_COUNT; nic_count++) { | 1198 | for (nic_count = 0; nic_count < NES_MAX_PORT_COUNT; nic_count++) { |
1158 | if (nesvnic->qp_nic_index[nic_count] == 0xf) | 1199 | if (nesvnic->qp_nic_index[nic_count] == 0xf) |
1159 | break; | 1200 | break; |
@@ -1218,11 +1259,15 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, | |||
1218 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_jabber_frames; | 1259 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_jabber_frames; |
1219 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_oversized_frames; | 1260 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_oversized_frames; |
1220 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_short_frames; | 1261 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_short_frames; |
1262 | target_stat_values[++index] = nesvnic->netstats.rx_length_errors; | ||
1263 | target_stat_values[++index] = nesvnic->nesdev->mac_rx_crc_errors; | ||
1264 | target_stat_values[++index] = nesvnic->nesdev->port_rx_discards; | ||
1221 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_discard; | 1265 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_discard; |
1222 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_octets; | 1266 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_octets; |
1223 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_frames; | 1267 | target_stat_values[++index] = nesvnic->endnode_nstat_rx_frames; |
1224 | target_stat_values[++index] = nesvnic->endnode_nstat_tx_octets; | 1268 | target_stat_values[++index] = nesvnic->endnode_nstat_tx_octets; |
1225 | target_stat_values[++index] = nesvnic->endnode_nstat_tx_frames; | 1269 | target_stat_values[++index] = nesvnic->endnode_nstat_tx_frames; |
1270 | target_stat_values[++index] = nesvnic->nesdev->mac_tx_errors; | ||
1226 | target_stat_values[++index] = mh_detected; | 1271 | target_stat_values[++index] = mh_detected; |
1227 | target_stat_values[++index] = mh_pauses_sent; | 1272 | target_stat_values[++index] = mh_pauses_sent; |
1228 | target_stat_values[++index] = nesvnic->endnode_ipv4_tcp_retransmits; | 1273 | target_stat_values[++index] = nesvnic->endnode_ipv4_tcp_retransmits; |
@@ -1251,21 +1296,14 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, | |||
1251 | target_stat_values[++index] = atomic_read(&cm_nodes_destroyed); | 1296 | target_stat_values[++index] = atomic_read(&cm_nodes_destroyed); |
1252 | target_stat_values[++index] = atomic_read(&cm_accel_dropped_pkts); | 1297 | target_stat_values[++index] = atomic_read(&cm_accel_dropped_pkts); |
1253 | target_stat_values[++index] = atomic_read(&cm_resets_recvd); | 1298 | target_stat_values[++index] = atomic_read(&cm_resets_recvd); |
1299 | target_stat_values[++index] = nesadapter->free_4kpbl; | ||
1300 | target_stat_values[++index] = nesadapter->free_256pbl; | ||
1254 | target_stat_values[++index] = int_mod_timer_init; | 1301 | target_stat_values[++index] = int_mod_timer_init; |
1255 | target_stat_values[++index] = int_mod_cq_depth_1; | ||
1256 | target_stat_values[++index] = int_mod_cq_depth_4; | ||
1257 | target_stat_values[++index] = int_mod_cq_depth_16; | ||
1258 | target_stat_values[++index] = int_mod_cq_depth_24; | ||
1259 | target_stat_values[++index] = int_mod_cq_depth_32; | ||
1260 | target_stat_values[++index] = int_mod_cq_depth_128; | ||
1261 | target_stat_values[++index] = int_mod_cq_depth_256; | ||
1262 | target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated; | 1302 | target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated; |
1263 | target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed; | 1303 | target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed; |
1264 | target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc; | 1304 | target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc; |
1265 | |||
1266 | } | 1305 | } |
1267 | 1306 | ||
1268 | |||
1269 | /** | 1307 | /** |
1270 | * nes_netdev_get_drvinfo | 1308 | * nes_netdev_get_drvinfo |
1271 | */ | 1309 | */ |