aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHal Rosenstock <hal@dev.mellanox.co.il>2016-10-18 13:20:29 -0400
committerDoug Ledford <dledford@redhat.com>2016-12-14 11:01:58 -0500
commit9fa240bbfc4200b080c8fad12579659c2c2f36b5 (patch)
tree89d126754347af310fce5d1cef8eeabdf4123fea
parente37a79e5d4cac3831fac3d4afbf2461f56b4b7bd (diff)
IB/mad: Eliminate redundant SM class version defines for OPA
and rename class version define to indicate SM rather than SMP or SMI Signed-off-by: Hal Rosenstock <hal@mellanox.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/mad.c4
-rw-r--r--drivers/infiniband/hw/hfi1/mad.c12
-rw-r--r--include/rdma/ib_mad.h2
-rw-r--r--include/rdma/opa_smi.h2
4 files changed, 9 insertions, 11 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 40cbd6bdb73b..bc2a9c2caa3c 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -769,7 +769,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
769 * If we are at the start of the LID routed part, don't update the 769 * If we are at the start of the LID routed part, don't update the
770 * hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec. 770 * hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec.
771 */ 771 */
772 if (opa && smp->class_version == OPA_SMP_CLASS_VERSION) { 772 if (opa && smp->class_version == OPA_SM_CLASS_VERSION) {
773 u32 opa_drslid; 773 u32 opa_drslid;
774 774
775 if ((opa_get_smp_direction(opa_smp) 775 if ((opa_get_smp_direction(opa_smp)
@@ -2167,7 +2167,7 @@ handle_smi(struct ib_mad_port_private *port_priv,
2167 struct ib_mad_hdr *mad_hdr = (struct ib_mad_hdr *)recv->mad; 2167 struct ib_mad_hdr *mad_hdr = (struct ib_mad_hdr *)recv->mad;
2168 2168
2169 if (opa && mad_hdr->base_version == OPA_MGMT_BASE_VERSION && 2169 if (opa && mad_hdr->base_version == OPA_MGMT_BASE_VERSION &&
2170 mad_hdr->class_version == OPA_SMI_CLASS_VERSION) 2170 mad_hdr->class_version == OPA_SM_CLASS_VERSION)
2171 return handle_opa_smi(port_priv, qp_info, wc, port_num, recv, 2171 return handle_opa_smi(port_priv, qp_info, wc, port_num, recv,
2172 response); 2172 response);
2173 2173
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index 9487c9bb8920..320e4daa5fc6 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -128,7 +128,7 @@ static void send_trap(struct hfi1_ibport *ibp, void *data, unsigned len)
128 smp = send_buf->mad; 128 smp = send_buf->mad;
129 smp->base_version = OPA_MGMT_BASE_VERSION; 129 smp->base_version = OPA_MGMT_BASE_VERSION;
130 smp->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED; 130 smp->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
131 smp->class_version = OPA_SMI_CLASS_VERSION; 131 smp->class_version = OPA_SM_CLASS_VERSION;
132 smp->method = IB_MGMT_METHOD_TRAP; 132 smp->method = IB_MGMT_METHOD_TRAP;
133 ibp->rvp.tid++; 133 ibp->rvp.tid++;
134 smp->tid = cpu_to_be64(ibp->rvp.tid); 134 smp->tid = cpu_to_be64(ibp->rvp.tid);
@@ -343,7 +343,7 @@ static int __subn_get_opa_nodeinfo(struct opa_smp *smp, u32 am, u8 *data,
343 343
344 ni->port_guid = cpu_to_be64(dd->pport[pidx].guid); 344 ni->port_guid = cpu_to_be64(dd->pport[pidx].guid);
345 ni->base_version = OPA_MGMT_BASE_VERSION; 345 ni->base_version = OPA_MGMT_BASE_VERSION;
346 ni->class_version = OPA_SMI_CLASS_VERSION; 346 ni->class_version = OPA_SM_CLASS_VERSION;
347 ni->node_type = 1; /* channel adapter */ 347 ni->node_type = 1; /* channel adapter */
348 ni->num_ports = ibdev->phys_port_cnt; 348 ni->num_ports = ibdev->phys_port_cnt;
349 /* This is already in network order */ 349 /* This is already in network order */
@@ -379,7 +379,7 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev,
379 nip->port_guid = cpu_to_be64(dd->pport[pidx].guid); 379 nip->port_guid = cpu_to_be64(dd->pport[pidx].guid);
380 380
381 nip->base_version = OPA_MGMT_BASE_VERSION; 381 nip->base_version = OPA_MGMT_BASE_VERSION;
382 nip->class_version = OPA_SMI_CLASS_VERSION; 382 nip->class_version = OPA_SM_CLASS_VERSION;
383 nip->node_type = 1; /* channel adapter */ 383 nip->node_type = 1; /* channel adapter */
384 nip->num_ports = ibdev->phys_port_cnt; 384 nip->num_ports = ibdev->phys_port_cnt;
385 /* This is already in network order */ 385 /* This is already in network order */
@@ -2302,7 +2302,7 @@ static int pma_get_opa_classportinfo(struct opa_pma_mad *pmp,
2302 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD; 2302 pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
2303 2303
2304 p->base_version = OPA_MGMT_BASE_VERSION; 2304 p->base_version = OPA_MGMT_BASE_VERSION;
2305 p->class_version = OPA_SMI_CLASS_VERSION; 2305 p->class_version = OPA_SM_CLASS_VERSION;
2306 /* 2306 /*
2307 * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec. 2307 * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec.
2308 */ 2308 */
@@ -4022,7 +4022,7 @@ static int process_subn_opa(struct ib_device *ibdev, int mad_flags,
4022 4022
4023 am = be32_to_cpu(smp->attr_mod); 4023 am = be32_to_cpu(smp->attr_mod);
4024 attr_id = smp->attr_id; 4024 attr_id = smp->attr_id;
4025 if (smp->class_version != OPA_SMI_CLASS_VERSION) { 4025 if (smp->class_version != OPA_SM_CLASS_VERSION) {
4026 smp->status |= IB_SMP_UNSUP_VERSION; 4026 smp->status |= IB_SMP_UNSUP_VERSION;
4027 ret = reply((struct ib_mad_hdr *)smp); 4027 ret = reply((struct ib_mad_hdr *)smp);
4028 return ret; 4028 return ret;
@@ -4232,7 +4232,7 @@ static int process_perf_opa(struct ib_device *ibdev, u8 port,
4232 4232
4233 *out_mad = *in_mad; 4233 *out_mad = *in_mad;
4234 4234
4235 if (pmp->mad_hdr.class_version != OPA_SMI_CLASS_VERSION) { 4235 if (pmp->mad_hdr.class_version != OPA_SM_CLASS_VERSION) {
4236 pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION; 4236 pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION;
4237 return reply((struct ib_mad_hdr *)pmp); 4237 return reply((struct ib_mad_hdr *)pmp);
4238 } 4238 }
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index c8a773ffe23b..981214b3790c 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -46,7 +46,7 @@
46#define IB_MGMT_BASE_VERSION 1 46#define IB_MGMT_BASE_VERSION 1
47#define OPA_MGMT_BASE_VERSION 0x80 47#define OPA_MGMT_BASE_VERSION 0x80
48 48
49#define OPA_SMP_CLASS_VERSION 0x80 49#define OPA_SM_CLASS_VERSION 0x80
50 50
51/* Management classes */ 51/* Management classes */
52#define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x01 52#define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x01
diff --git a/include/rdma/opa_smi.h b/include/rdma/opa_smi.h
index 4a529ef47995..f7896117936e 100644
--- a/include/rdma/opa_smi.h
+++ b/include/rdma/opa_smi.h
@@ -44,8 +44,6 @@
44#define OPA_MAX_SLS 32 44#define OPA_MAX_SLS 32
45#define OPA_MAX_SCS 32 45#define OPA_MAX_SCS 32
46 46
47#define OPA_SMI_CLASS_VERSION 0x80
48
49#define OPA_LID_PERMISSIVE cpu_to_be32(0xFFFFFFFF) 47#define OPA_LID_PERMISSIVE cpu_to_be32(0xFFFFFFFF)
50 48
51struct opa_smp { 49struct opa_smp {