diff options
author | Steve Wise <swise@opengridcomputing.com> | 2008-07-15 02:48:48 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-07-15 02:48:48 -0400 |
commit | 7f624d023b5fb150831e02c1e4c0f2619ade72c2 (patch) | |
tree | 9618a7eaa601855c3ab7763a3c31ee2fc16364ee /include | |
parent | a7d834c4bc6be73e8f83eaa5072fac3c5549f7f2 (diff) |
RDMA/core: Add iWARP protocol statistics attributes in sysfs
This patch adds a sysfs attribute group called "proto_stats" under
/sys/class/infiniband/$device/ and populates this group with protocol
statistics if they exist for a given device. Currently, only iWARP
stats are defined, but the code is designed to allow InfiniBand
protocol stats if they become available. These stats are per-device
and more importantly -not- per port.
Details:
- Add union rdma_protocol_stats in ib_verbs.h. This union allows
defining transport-specific stats. Currently only iwarp stats are
defined.
- Add struct iw_protocol_stats to define the current set of iwarp
protocol stats.
- Add new ib_device method called get_proto_stats() to return protocol
statistics.
- Add logic in core/sysfs.c to create iwarp protocol stats attributes
if the device is an RNIC and has a get_proto_stats() method.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/rdma/ib_verbs.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 74c24b908908..10ebaaae0161 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -226,6 +226,57 @@ static inline int ib_width_enum_to_int(enum ib_port_width width) | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
229 | struct ib_protocol_stats { | ||
230 | /* TBD... */ | ||
231 | }; | ||
232 | |||
233 | struct iw_protocol_stats { | ||
234 | u64 ipInReceives; | ||
235 | u64 ipInHdrErrors; | ||
236 | u64 ipInTooBigErrors; | ||
237 | u64 ipInNoRoutes; | ||
238 | u64 ipInAddrErrors; | ||
239 | u64 ipInUnknownProtos; | ||
240 | u64 ipInTruncatedPkts; | ||
241 | u64 ipInDiscards; | ||
242 | u64 ipInDelivers; | ||
243 | u64 ipOutForwDatagrams; | ||
244 | u64 ipOutRequests; | ||
245 | u64 ipOutDiscards; | ||
246 | u64 ipOutNoRoutes; | ||
247 | u64 ipReasmTimeout; | ||
248 | u64 ipReasmReqds; | ||
249 | u64 ipReasmOKs; | ||
250 | u64 ipReasmFails; | ||
251 | u64 ipFragOKs; | ||
252 | u64 ipFragFails; | ||
253 | u64 ipFragCreates; | ||
254 | u64 ipInMcastPkts; | ||
255 | u64 ipOutMcastPkts; | ||
256 | u64 ipInBcastPkts; | ||
257 | u64 ipOutBcastPkts; | ||
258 | |||
259 | u64 tcpRtoAlgorithm; | ||
260 | u64 tcpRtoMin; | ||
261 | u64 tcpRtoMax; | ||
262 | u64 tcpMaxConn; | ||
263 | u64 tcpActiveOpens; | ||
264 | u64 tcpPassiveOpens; | ||
265 | u64 tcpAttemptFails; | ||
266 | u64 tcpEstabResets; | ||
267 | u64 tcpCurrEstab; | ||
268 | u64 tcpInSegs; | ||
269 | u64 tcpOutSegs; | ||
270 | u64 tcpRetransSegs; | ||
271 | u64 tcpInErrs; | ||
272 | u64 tcpOutRsts; | ||
273 | }; | ||
274 | |||
275 | union rdma_protocol_stats { | ||
276 | struct ib_protocol_stats ib; | ||
277 | struct iw_protocol_stats iw; | ||
278 | }; | ||
279 | |||
229 | struct ib_port_attr { | 280 | struct ib_port_attr { |
230 | enum ib_port_state state; | 281 | enum ib_port_state state; |
231 | enum ib_mtu max_mtu; | 282 | enum ib_mtu max_mtu; |
@@ -943,6 +994,8 @@ struct ib_device { | |||
943 | 994 | ||
944 | struct iw_cm_verbs *iwcm; | 995 | struct iw_cm_verbs *iwcm; |
945 | 996 | ||
997 | int (*get_protocol_stats)(struct ib_device *device, | ||
998 | union rdma_protocol_stats *stats); | ||
946 | int (*query_device)(struct ib_device *device, | 999 | int (*query_device)(struct ib_device *device, |
947 | struct ib_device_attr *device_attr); | 1000 | struct ib_device_attr *device_attr); |
948 | int (*query_port)(struct ib_device *device, | 1001 | int (*query_port)(struct ib_device *device, |