aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorErez Shitrit <erezsh@mellanox.com>2016-05-25 15:02:04 -0400
committerDoug Ledford <dledford@redhat.com>2016-05-25 15:39:02 -0400
commit507f6afa3ab6c9473d81c8091be0d1b859509a6d (patch)
treee9a29d25037416c8947cef0c197ea81f8d31ac21 /drivers/infiniband
parentc16d2750a08c8ccaf98d65f287a8aec91bb9610d (diff)
IB/core: Introduce capabilitymask2 field in ClassPortInfo mad
Change struct ib_class_port_info to conform to IB Spec 1.3 That in order to get specific capability mask from ClassPortInfo mad. >From the IB Spec, ClassPortInfo section: "CapabilityMask2 Bits 0-26: Additional class-specific capabilities... RespTimeValue the rest 5 bits" The new struct now has one field for capabilitymask2 (previously was the reserved field) and the resp_time field. And it fixes up qib and srpt, use of the field repurposed to be used as capabilitymask2: IB/qib: Change pma_get_classportinfo IB/srpt: Adjust the use of ib_class_port_info Signed-off-by: Erez Shitrit <erezsh@mellanox.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Hal Rosenstock <hal@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/qib/qib_mad.c6
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
index 0bd18375d7df..d2ac29861af5 100644
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -1172,11 +1172,13 @@ static int pma_get_classportinfo(struct ib_pma_mad *pmp,
1172 * Set the most significant bit of CM2 to indicate support for 1172 * Set the most significant bit of CM2 to indicate support for
1173 * congestion statistics 1173 * congestion statistics
1174 */ 1174 */
1175 p->reserved[0] = dd->psxmitwait_supported << 7; 1175 ib_set_cpi_capmask2(p,
1176 dd->psxmitwait_supported <<
1177 (31 - IB_CLASS_PORT_INFO_RESP_TIME_FIELD_SIZE));
1176 /* 1178 /*
1177 * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec. 1179 * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec.
1178 */ 1180 */
1179 p->resp_time_value = 18; 1181 ib_set_cpi_resp_time(p, 18);
1180 1182
1181 return reply((struct ib_smp *) pmp); 1183 return reply((struct ib_smp *) pmp);
1182} 1184}
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 2843f1ae75bd..887ebadd4774 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -254,8 +254,8 @@ static void srpt_get_class_port_info(struct ib_dm_mad *mad)
254 memset(cif, 0, sizeof(*cif)); 254 memset(cif, 0, sizeof(*cif));
255 cif->base_version = 1; 255 cif->base_version = 1;
256 cif->class_version = 1; 256 cif->class_version = 1;
257 cif->resp_time_value = 20;
258 257
258 ib_set_cpi_resp_time(cif, 20);
259 mad->mad_hdr.status = 0; 259 mad->mad_hdr.status = 0;
260} 260}
261 261