+void
+lnet_counters_get(lnet_counters_t *counters)
+{
+ lnet_counters_t *ctr;
+
+ memset(counters, 0, sizeof(*counters));
+
+ LNET_LOCK();
+ ctr = the_lnet.ln_counters;
+ do { /* iterate over counters of all CPTs in upcoming patches */
+ counters->msgs_max += ctr->msgs_max;
+ counters->msgs_alloc += ctr->msgs_alloc;
+ counters->errors += ctr->errors;
+ counters->send_count += ctr->send_count;
+ counters->recv_count += ctr->recv_count;
+ counters->route_count += ctr->route_count;
+ counters->drop_length += ctr->drop_length;
+ counters->send_length += ctr->send_length;
+ counters->recv_length += ctr->recv_length;
+ counters->route_length += ctr->route_length;
+ counters->drop_length += ctr->drop_length;
+ } while (0);
+
+ LNET_UNLOCK();
+}
+EXPORT_SYMBOL(lnet_counters_get);
+
+void
+lnet_counters_reset(void)
+{
+ lnet_counters_t *counters;
+
+ LNET_LOCK();
+ counters = the_lnet.ln_counters;
+ do { /* iterate over counters of all CPTs in upcoming patches */
+ memset(counters, 0, sizeof(lnet_counters_t));
+ } while (0);
+ LNET_UNLOCK();
+}
+EXPORT_SYMBOL(lnet_counters_reset);
+