From: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
To: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Subject: [PATCH 2/3] IB core counters: Specify attribute_id in port_table_attribute
Date: Thu, 17 Dec 2015 13:52:57 -0600 [thread overview]
Message-ID: <20151217195312.228660904@linux.com> (raw)
In-Reply-To: 20151217195255.334854705@linux.com
[-- Attachment #1: ib_64bit_specify_attribute_id --]
[-- Type: text/plain, Size: 1714 bytes --]
Add the attr_id on port_table_attribute since we will have to add
a different port_table_attribute for the extended attribute soon.
Signed-off-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Index: linux/drivers/infiniband/core/sysfs.c
===================================================================
--- linux.orig/drivers/infiniband/core/sysfs.c
+++ linux/drivers/infiniband/core/sysfs.c
@@ -39,6 +39,7 @@
#include <linux/string.h>
#include <rdma/ib_mad.h>
+#include <rdma/ib_pma.h>
struct ib_port {
struct kobject kobj;
@@ -65,6 +66,7 @@ struct port_table_attribute {
struct port_attribute attr;
char name[8];
int index;
+ int attr_id;
};
static ssize_t port_attr_show(struct kobject *kobj,
@@ -314,7 +316,8 @@ static ssize_t show_port_pkey(struct ib_
#define PORT_PMA_ATTR(_name, _counter, _width, _offset) \
struct port_table_attribute port_pma_attr_##_name = { \
.attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
- .index = (_offset) | ((_width) << 16) | ((_counter) << 24) \
+ .index = (_offset) | ((_width) << 16) | ((_counter) << 24), \
+ .attr_id = IB_PMA_PORT_COUNTERS , \
}
/*
@@ -376,7 +379,7 @@ static ssize_t show_pma_counter(struct i
ssize_t ret;
u8 data[8];
- ret = get_perf_mad(p->ibdev, p->port_num, cpu_to_be16(0x12), &data,
+ ret = get_perf_mad(p->ibdev, p->port_num, tab_attr->attr_id, &data,
40 + offset / 8, sizeof(data));
if (ret < 0)
return sprintf(buf, "N/A (no PMA)\n");
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-12-17 19:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 19:52 [PATCH 0/3] IB 64 bit counter support V2 Christoph Lameter
2015-12-17 19:52 ` [PATCH 1/3] IB Core: Create get_perf_mad function in sysfs.c Christoph Lameter
[not found] ` <20151217195312.126391272-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2015-12-17 20:12 ` Hal Rosenstock
[not found] ` <5684E027.4040006@sandisk.com>
[not found] ` <5684E027.4040006-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-01-04 3:47 ` ira.weiny
2015-12-17 19:52 ` Christoph Lameter [this message]
[not found] ` <20151217195312.228660904-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2015-12-17 20:12 ` [PATCH 2/3] IB core counters: Specify attribute_id in port_table_attribute Hal Rosenstock
2015-12-17 19:52 ` [PATCH 3/3] bject: IB Core: Display extended counter set if available Christoph Lameter
[not found] ` <20151217195312.334770847-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2015-12-17 20:11 ` Hal Rosenstock
[not found] ` <567316F7.9030707-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-17 21:28 ` Christoph Lameter
[not found] ` <alpine.DEB.2.20.1512171527060.22782-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-12-17 21:48 ` Hal Rosenstock
[not found] ` <56732D97.2080303-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-17 22:50 ` Christoph Lameter
[not found] ` <alpine.DEB.2.20.1512171649070.22782-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-12-17 23:19 ` Hal Rosenstock
[not found] ` <567342F5.5090000-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-18 13:39 ` Christoph Lameter
[not found] ` <alpine.DEB.2.20.1512180737150.32514-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-12-18 13:52 ` Hal Rosenstock
[not found] ` <56740F8C.4060703-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-18 15:46 ` Christoph Lameter
[not found] ` <alpine.DEB.2.20.1512180944540.1506-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-12-18 16:26 ` Hal Rosenstock
2015-12-17 20:40 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151217195312.228660904@linux.com \
--to=cl-vytec60ixjuavxtiumwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.