Thread (1 message) 1 message, 1 author, 2016-05-16

Re: [PATCH 1/3] ib core: Make device counter infrastructure dynamic

From: Doug Ledford <hidden>
Date: 2016-05-16 18:01:04

On 05/16/2016 01:49 PM, Christoph Lameter wrote:
Ok patch with the changes requested. Check in core/sysfs.c removed.



Subject: ib core: Make device counter infrastructure dynamic V3

V1->V2:
 - Use enums for counters for cxgb3/cxgb4
 - Use BUILD_BUG_ON instead of BUG_ON

V2->v3
 - Change the way to check for MAX_NR_PROTOCOL_STATS
 - Fix typo

The current approach in ib_verbs.h is to define a struct with
statistics fields. ib_verbs is an abstraction layer for
device drivers and the protocol_stats should be abstract. However,
in practice these are actually device specific counters (also used
in such a way in Mellanox OFED). The device stats are a union
and in practice evolve to a union of device specific stats.

ARGH!!!

This should not be defined in a concrete way in ib_verbs.h since the
API definition needs to be device neutral.

What we need is an API that can return an arbitrary number
of counters that may be general or device specific.

Here we simply define an array of strings that describe the
counters and an array of 64 bit counters that are
displayed through sysfs. This makes ib_verbs API appropriately
abstract and device drivers do not need to update ib_verbs.h
(and thus break the API) to add more counters,.

This patch is groundwork to later define the protocol stats for
Mellanox devices.

The strings being used in the device drives should only be present
if the driver actually supports those counters. If there is
a standardized name then devices should use the same name
as in other infiniband device drivers.

Note on cxgb3/4 portions:
- I was unable to test because of the lack of hardware
- The counters that are never incremented were omitted. There may be the
  impression that less counter are supported. But the other counters
  have never been supported.

Signed-off-by: Christoph Lameter <redacted>
Signed-off-by: Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks, this looks good now.  When the other two patches come through
I'll apply the group.


-- 
Doug Ledford [off-list ref]
              GPG KeyID: 0E572FDD

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help