On Wed, 16 Mar 2016, Dennis Dalessandro wrote: > > + return sprintf(buf, "%llu\n", stats.value[index]); > > +} > > This works fine when there are few counters, but if there are lots? What about > changing things to include the index in the get_protocol_stats() call so that > we just grab the single item we are looking for? Right now there is a limiting in the source to a max of 128 counters. In practice all users use less than 30 counters at this point. So we have some space to go until we may need a better solution. We could also save the stats we have retrieved so it can be used for multiple counters. But I think this something for the future. > > + for (counters = 0; stats.name[counters]; counters++) > > + ; > > + > > + BUG_ON(counters > MAX_NR_PROTOCOL_STATS); > > Should we really be bringing the machine crashing down here? The counter tables are defined at compile time. The BUG_ON ensures that the driver will bug immediately when testing if we hit that limit. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html