Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/core: Specify attribute_id in port_table_attribute

Add the attr_id on port_table_attribute since we will have to add
a different port_table_attribute for the extended attribute soon.

Reviewed-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Christoph Lameter and committed by
Doug Ledford
b2788ce5 35c4cbb1

+5 -2
+5 -2
drivers/infiniband/core/sysfs.c
··· 40 40 #include <linux/netdevice.h> 41 41 42 42 #include <rdma/ib_mad.h> 43 + #include <rdma/ib_pma.h> 43 44 44 45 struct ib_port; 45 46 ··· 76 75 struct port_attribute attr; 77 76 char name[8]; 78 77 int index; 78 + int attr_id; 79 79 }; 80 80 81 81 static ssize_t port_attr_show(struct kobject *kobj, ··· 397 395 #define PORT_PMA_ATTR(_name, _counter, _width, _offset) \ 398 396 struct port_table_attribute port_pma_attr_##_name = { \ 399 397 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \ 400 - .index = (_offset) | ((_width) << 16) | ((_counter) << 24) \ 398 + .index = (_offset) | ((_width) << 16) | ((_counter) << 24), \ 399 + .attr_id = IB_PMA_PORT_COUNTERS , \ 401 400 } 402 401 403 402 /* ··· 460 457 ssize_t ret; 461 458 u8 data[8]; 462 459 463 - ret = get_perf_mad(p->ibdev, p->port_num, cpu_to_be16(0x12), &data, 460 + ret = get_perf_mad(p->ibdev, p->port_num, tab_attr->attr_id, &data, 464 461 40 + offset / 8, sizeof(data)); 465 462 if (ret < 0) 466 463 return sprintf(buf, "N/A (no PMA)\n");