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

IB: Move struct port_info from ipath to <rdma/ib_smi.h>

Move ipath's struct port_info into <rdma/ib_smi.h>, so that it can be
used by mthca to implement client reregister support.

Remove the __attribute__((packed)) because all the members of the struct
are naturally aligned anyway.

Signed-off-by: Leonid Arsh <leonida@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Leonid Arsh and committed by
Roland Dreier
da2ab62a 508e4341

+38 -38
+2 -38
drivers/infiniband/hw/ipath/ipath_mad.c
··· 137 137 return reply(smp); 138 138 } 139 139 140 - struct port_info { 141 - __be64 mkey; 142 - __be64 gid_prefix; 143 - __be16 lid; 144 - __be16 sm_lid; 145 - __be32 cap_mask; 146 - __be16 diag_code; 147 - __be16 mkey_lease_period; 148 - u8 local_port_num; 149 - u8 link_width_enabled; 150 - u8 link_width_supported; 151 - u8 link_width_active; 152 - u8 linkspeed_portstate; /* 4 bits, 4 bits */ 153 - u8 portphysstate_linkdown; /* 4 bits, 4 bits */ 154 - u8 mkeyprot_resv_lmc; /* 2 bits, 3, 3 */ 155 - u8 linkspeedactive_enabled; /* 4 bits, 4 bits */ 156 - u8 neighbormtu_mastersmsl; /* 4 bits, 4 bits */ 157 - u8 vlcap_inittype; /* 4 bits, 4 bits */ 158 - u8 vl_high_limit; 159 - u8 vl_arb_high_cap; 160 - u8 vl_arb_low_cap; 161 - u8 inittypereply_mtucap; /* 4 bits, 4 bits */ 162 - u8 vlstallcnt_hoqlife; /* 3 bits, 5 bits */ 163 - u8 operationalvl_pei_peo_fpi_fpo; /* 4 bits, 1, 1, 1, 1 */ 164 - __be16 mkey_violations; 165 - __be16 pkey_violations; 166 - __be16 qkey_violations; 167 - u8 guid_cap; 168 - u8 clientrereg_resv_subnetto; /* 1 bit, 2 bits, 5 */ 169 - u8 resv_resptimevalue; /* 3 bits, 5 bits */ 170 - u8 localphyerrors_overrunerrors; /* 4 bits, 4 bits */ 171 - __be16 max_credit_hint; 172 - u8 resv; 173 - u8 link_roundtrip_latency[3]; 174 - } __attribute__ ((packed)); 175 - 176 140 static int recv_subn_get_portinfo(struct ib_smp *smp, 177 141 struct ib_device *ibdev, u8 port) 178 142 { 179 143 struct ipath_ibdev *dev; 180 - struct port_info *pip = (struct port_info *)smp->data; 144 + struct ib_port_info *pip = (struct ib_port_info *)smp->data; 181 145 u16 lid; 182 146 u8 ibcstat; 183 147 u8 mtu; ··· 276 312 static int recv_subn_set_portinfo(struct ib_smp *smp, 277 313 struct ib_device *ibdev, u8 port) 278 314 { 279 - struct port_info *pip = (struct port_info *)smp->data; 315 + struct ib_port_info *pip = (struct ib_port_info *)smp->data; 280 316 struct ib_event event; 281 317 struct ipath_ibdev *dev; 282 318 u32 flags;
+36
include/rdma/ib_smi.h
··· 85 85 #define IB_SMP_ATTR_LED_INFO __constant_htons(0x0031) 86 86 #define IB_SMP_ATTR_VENDOR_MASK __constant_htons(0xFF00) 87 87 88 + struct ib_port_info { 89 + __be64 mkey; 90 + __be64 gid_prefix; 91 + __be16 lid; 92 + __be16 sm_lid; 93 + __be32 cap_mask; 94 + __be16 diag_code; 95 + __be16 mkey_lease_period; 96 + u8 local_port_num; 97 + u8 link_width_enabled; 98 + u8 link_width_supported; 99 + u8 link_width_active; 100 + u8 linkspeed_portstate; /* 4 bits, 4 bits */ 101 + u8 portphysstate_linkdown; /* 4 bits, 4 bits */ 102 + u8 mkeyprot_resv_lmc; /* 2 bits, 3, 3 */ 103 + u8 linkspeedactive_enabled; /* 4 bits, 4 bits */ 104 + u8 neighbormtu_mastersmsl; /* 4 bits, 4 bits */ 105 + u8 vlcap_inittype; /* 4 bits, 4 bits */ 106 + u8 vl_high_limit; 107 + u8 vl_arb_high_cap; 108 + u8 vl_arb_low_cap; 109 + u8 inittypereply_mtucap; /* 4 bits, 4 bits */ 110 + u8 vlstallcnt_hoqlife; /* 3 bits, 5 bits */ 111 + u8 operationalvl_pei_peo_fpi_fpo; /* 4 bits, 1, 1, 1, 1 */ 112 + __be16 mkey_violations; 113 + __be16 pkey_violations; 114 + __be16 qkey_violations; 115 + u8 guid_cap; 116 + u8 clientrereg_resv_subnetto; /* 1 bit, 2 bits, 5 */ 117 + u8 resv_resptimevalue; /* 3 bits, 5 bits */ 118 + u8 localphyerrors_overrunerrors; /* 4 bits, 4 bits */ 119 + __be16 max_credit_hint; 120 + u8 resv; 121 + u8 link_roundtrip_latency[3]; 122 + }; 123 + 88 124 static inline u8 89 125 ib_get_smp_direction(struct ib_smp *smp) 90 126 {