aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/cma.c')
-rw-r--r--drivers/infiniband/core/cma.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 34507daaf9b6..d81c156a22b4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -168,15 +168,15 @@ struct cma_work {
168union cma_ip_addr { 168union cma_ip_addr {
169 struct in6_addr ip6; 169 struct in6_addr ip6;
170 struct { 170 struct {
171 __u32 pad[3]; 171 __be32 pad[3];
172 __u32 addr; 172 __be32 addr;
173 } ip4; 173 } ip4;
174}; 174};
175 175
176struct cma_hdr { 176struct cma_hdr {
177 u8 cma_version; 177 u8 cma_version;
178 u8 ip_version; /* IP version: 7:4 */ 178 u8 ip_version; /* IP version: 7:4 */
179 __u16 port; 179 __be16 port;
180 union cma_ip_addr src_addr; 180 union cma_ip_addr src_addr;
181 union cma_ip_addr dst_addr; 181 union cma_ip_addr dst_addr;
182}; 182};
@@ -186,8 +186,8 @@ struct sdp_hh {
186 u8 sdp_version; /* Major version: 7:4 */ 186 u8 sdp_version; /* Major version: 7:4 */
187 u8 ip_version; /* IP version: 7:4 */ 187 u8 ip_version; /* IP version: 7:4 */
188 u8 sdp_specific1[10]; 188 u8 sdp_specific1[10];
189 __u16 port; 189 __be16 port;
190 __u16 sdp_specific2; 190 __be16 sdp_specific2;
191 union cma_ip_addr src_addr; 191 union cma_ip_addr src_addr;
192 union cma_ip_addr dst_addr; 192 union cma_ip_addr dst_addr;
193}; 193};
@@ -663,7 +663,7 @@ static inline int cma_any_port(struct sockaddr *addr)
663} 663}
664 664
665static int cma_get_net_info(void *hdr, enum rdma_port_space ps, 665static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
666 u8 *ip_ver, __u16 *port, 666 u8 *ip_ver, __be16 *port,
667 union cma_ip_addr **src, union cma_ip_addr **dst) 667 union cma_ip_addr **src, union cma_ip_addr **dst)
668{ 668{
669 switch (ps) { 669 switch (ps) {
@@ -695,7 +695,7 @@ static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
695 695
696static void cma_save_net_info(struct rdma_addr *addr, 696static void cma_save_net_info(struct rdma_addr *addr,
697 struct rdma_addr *listen_addr, 697 struct rdma_addr *listen_addr,
698 u8 ip_ver, __u16 port, 698 u8 ip_ver, __be16 port,
699 union cma_ip_addr *src, union cma_ip_addr *dst) 699 union cma_ip_addr *src, union cma_ip_addr *dst)
700{ 700{
701 struct sockaddr_in *listen4, *ip4; 701 struct sockaddr_in *listen4, *ip4;
@@ -996,7 +996,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
996 struct rdma_cm_id *id; 996 struct rdma_cm_id *id;
997 struct rdma_route *rt; 997 struct rdma_route *rt;
998 union cma_ip_addr *src, *dst; 998 union cma_ip_addr *src, *dst;
999 __u16 port; 999 __be16 port;
1000 u8 ip_ver; 1000 u8 ip_ver;
1001 1001
1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps, 1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps,
@@ -1043,7 +1043,7 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id,
1043 struct rdma_id_private *id_priv; 1043 struct rdma_id_private *id_priv;
1044 struct rdma_cm_id *id; 1044 struct rdma_cm_id *id;
1045 union cma_ip_addr *src, *dst; 1045 union cma_ip_addr *src, *dst;
1046 __u16 port; 1046 __be16 port;
1047 u8 ip_ver; 1047 u8 ip_ver;
1048 int ret; 1048 int ret;
1049 1049
@@ -1165,7 +1165,7 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1165{ 1165{
1166 struct cma_hdr *cma_data, *cma_mask; 1166 struct cma_hdr *cma_data, *cma_mask;
1167 struct sdp_hh *sdp_data, *sdp_mask; 1167 struct sdp_hh *sdp_data, *sdp_mask;
1168 __u32 ip4_addr; 1168 __be32 ip4_addr;
1169 struct in6_addr ip6_addr; 1169 struct in6_addr ip6_addr;
1170 1170
1171 memset(compare, 0, sizeof *compare); 1171 memset(compare, 0, sizeof *compare);
@@ -1181,12 +1181,12 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1181 sdp_set_ip_ver(sdp_data, 4); 1181 sdp_set_ip_ver(sdp_data, 4);
1182 sdp_set_ip_ver(sdp_mask, 0xF); 1182 sdp_set_ip_ver(sdp_mask, 0xF);
1183 sdp_data->dst_addr.ip4.addr = ip4_addr; 1183 sdp_data->dst_addr.ip4.addr = ip4_addr;
1184 sdp_mask->dst_addr.ip4.addr = ~0; 1184 sdp_mask->dst_addr.ip4.addr = htonl(~0);
1185 } else { 1185 } else {
1186 cma_set_ip_ver(cma_data, 4); 1186 cma_set_ip_ver(cma_data, 4);
1187 cma_set_ip_ver(cma_mask, 0xF); 1187 cma_set_ip_ver(cma_mask, 0xF);
1188 cma_data->dst_addr.ip4.addr = ip4_addr; 1188 cma_data->dst_addr.ip4.addr = ip4_addr;
1189 cma_mask->dst_addr.ip4.addr = ~0; 1189 cma_mask->dst_addr.ip4.addr = htonl(~0);
1190 } 1190 }
1191 break; 1191 break;
1192 case AF_INET6: 1192 case AF_INET6: