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

IB/core: Move SM class defines from ib_mad.h to ib_smi.h

When the hfi1 driver was added these definitions were moved from the qib driver
to ib_mad.h to be used by both qib and hfi1. They should have been moved to
ib_smi.h instead.

Fixes: d4ab347005fb ("IB/core: Add core header changes needed for OPA")
Reviewed-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Ira Weiny and committed by
Doug Ledford
0629cb06 ce755c9b

+48 -45
+1
drivers/infiniband/hw/qib/qib_ruc.c
··· 32 32 */ 33 33 34 34 #include <linux/spinlock.h> 35 + #include <rdma/ib_smi.h> 35 36 36 37 #include "qib.h" 37 38 #include "qib_mad.h"
-45
include/rdma/ib_mad.h
··· 144 144 #define IB_NOTICE_PROD_ROUTER cpu_to_be16(3) 145 145 #define IB_NOTICE_PROD_CLASS_MGR cpu_to_be16(4) 146 146 147 - /* 148 - * Generic trap/notice numbers 149 - */ 150 - #define IB_NOTICE_TRAP_LLI_THRESH cpu_to_be16(129) 151 - #define IB_NOTICE_TRAP_EBO_THRESH cpu_to_be16(130) 152 - #define IB_NOTICE_TRAP_FLOW_UPDATE cpu_to_be16(131) 153 - #define IB_NOTICE_TRAP_CAP_MASK_CHG cpu_to_be16(144) 154 - #define IB_NOTICE_TRAP_SYS_GUID_CHG cpu_to_be16(145) 155 - #define IB_NOTICE_TRAP_BAD_MKEY cpu_to_be16(256) 156 - #define IB_NOTICE_TRAP_BAD_PKEY cpu_to_be16(257) 157 - #define IB_NOTICE_TRAP_BAD_QKEY cpu_to_be16(258) 158 - 159 - /* 160 - * Generic trap/notice other local changes flags (trap 144). 161 - */ 162 - #define IB_NOTICE_TRAP_LSE_CHG 0x04 /* Link Speed Enable changed */ 163 - #define IB_NOTICE_TRAP_LWE_CHG 0x02 /* Link Width Enable changed */ 164 - #define IB_NOTICE_TRAP_NODE_DESC_CHG 0x01 165 - 166 - /* 167 - * Generic trap/notice M_Key volation flags in dr_trunc_hop (trap 256). 168 - */ 169 - #define IB_NOTICE_TRAP_DR_NOTICE 0x80 170 - #define IB_NOTICE_TRAP_DR_TRUNC 0x40 171 - 172 147 enum { 173 148 IB_MGMT_MAD_HDR = 24, 174 149 IB_MGMT_MAD_DATA = 232, ··· 257 282 __be32 trap_qkey; 258 283 }; 259 284 260 - struct ib_node_info { 261 - u8 base_version; 262 - u8 class_version; 263 - u8 node_type; 264 - u8 num_ports; 265 - __be64 sys_guid; 266 - __be64 node_guid; 267 - __be64 port_guid; 268 - __be16 partition_cap; 269 - __be16 device_id; 270 - __be32 revision; 271 - u8 local_port_num; 272 - u8 vendor_id[3]; 273 - } __packed; 274 - 275 285 struct ib_mad_notice_attr { 276 286 u8 generic_type; 277 287 u8 prod_type_msb; ··· 319 359 } __packed ntc_257_258; 320 360 321 361 } details; 322 - }; 323 - 324 - struct ib_vl_weight_elem { 325 - u8 vl; /* VL is low 5 bits, upper 3 bits reserved */ 326 - u8 weight; 327 362 }; 328 363 329 364 /**
+47
include/rdma/ib_smi.h
··· 119 119 u8 link_roundtrip_latency[3]; 120 120 }; 121 121 122 + struct ib_node_info { 123 + u8 base_version; 124 + u8 class_version; 125 + u8 node_type; 126 + u8 num_ports; 127 + __be64 sys_guid; 128 + __be64 node_guid; 129 + __be64 port_guid; 130 + __be16 partition_cap; 131 + __be16 device_id; 132 + __be32 revision; 133 + u8 local_port_num; 134 + u8 vendor_id[3]; 135 + } __packed; 136 + 137 + struct ib_vl_weight_elem { 138 + u8 vl; /* IB: VL is low 4 bits, upper 4 bits reserved */ 139 + /* OPA: VL is low 5 bits, upper 3 bits reserved */ 140 + u8 weight; 141 + }; 142 + 122 143 static inline u8 123 144 ib_get_smp_direction(struct ib_smp *smp) 124 145 { 125 146 return ((smp->status & IB_SMP_DIRECTION) == IB_SMP_DIRECTION); 126 147 } 148 + 149 + /* 150 + * SM Trap/Notice numbers 151 + */ 152 + #define IB_NOTICE_TRAP_LLI_THRESH cpu_to_be16(129) 153 + #define IB_NOTICE_TRAP_EBO_THRESH cpu_to_be16(130) 154 + #define IB_NOTICE_TRAP_FLOW_UPDATE cpu_to_be16(131) 155 + #define IB_NOTICE_TRAP_CAP_MASK_CHG cpu_to_be16(144) 156 + #define IB_NOTICE_TRAP_SYS_GUID_CHG cpu_to_be16(145) 157 + #define IB_NOTICE_TRAP_BAD_MKEY cpu_to_be16(256) 158 + #define IB_NOTICE_TRAP_BAD_PKEY cpu_to_be16(257) 159 + #define IB_NOTICE_TRAP_BAD_QKEY cpu_to_be16(258) 160 + 161 + /* 162 + * Other local changes flags (trap 144). 163 + */ 164 + #define IB_NOTICE_TRAP_LSE_CHG 0x04 /* Link Speed Enable changed */ 165 + #define IB_NOTICE_TRAP_LWE_CHG 0x02 /* Link Width Enable changed */ 166 + #define IB_NOTICE_TRAP_NODE_DESC_CHG 0x01 167 + 168 + /* 169 + * M_Key volation flags in dr_trunc_hop (trap 256). 170 + */ 171 + #define IB_NOTICE_TRAP_DR_NOTICE 0x80 172 + #define IB_NOTICE_TRAP_DR_TRUNC 0x40 173 + 127 174 128 175 #endif /* IB_SMI_H */