aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/amso1100
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2013-07-04 06:40:44 -0400
committerRoland Dreier <roland@purestorage.com>2013-08-12 15:32:31 -0400
commit24d44a391f1b5d56e9c7a4fc1edd085687864ff9 (patch)
tree3076b01a1b85d6b21d08f615a44a4b7c2f5b5acb /drivers/infiniband/hw/amso1100
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
RDMA/cma: Add IPv6 support for iWARP
Modify the type of local_addr and remote_addr fields in struct iw_cm_id from struct sockaddr_in to struct sockaddr_storage to hold IPv6 and IPv4 addresses uniformly. Change the references of local_addr and remote_addr in cxgb4, cxgb3, nes and amso drivers to match this. However to be able to actully run traffic over IPv6, low-level drivers have to add code to support this. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Sean Hefty <sean.hefty@intel.com> [ Fix unused variable warnings when INFINIBAND_NES_DEBUG not set. - Roland ] Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/amso1100')
-rw-r--r--drivers/infiniband/hw/amso1100/c2_ae.c18
-rw-r--r--drivers/infiniband/hw/amso1100/c2_cm.c16
2 files changed, 22 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c
index 706cf97cbe8f..d5d1929753e4 100644
--- a/drivers/infiniband/hw/amso1100/c2_ae.c
+++ b/drivers/infiniband/hw/amso1100/c2_ae.c
@@ -155,6 +155,8 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
155 enum c2_event_id event_id; 155 enum c2_event_id event_id;
156 unsigned long flags; 156 unsigned long flags;
157 int status; 157 int status;
158 struct sockaddr_in *laddr = (struct sockaddr_in *)&cm_event.local_addr;
159 struct sockaddr_in *raddr = (struct sockaddr_in *)&cm_event.remote_addr;
158 160
159 /* 161 /*
160 * retrieve the message 162 * retrieve the message
@@ -206,10 +208,10 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
206 case CCAE_ACTIVE_CONNECT_RESULTS: 208 case CCAE_ACTIVE_CONNECT_RESULTS:
207 res = &wr->ae.ae_active_connect_results; 209 res = &wr->ae.ae_active_connect_results;
208 cm_event.event = IW_CM_EVENT_CONNECT_REPLY; 210 cm_event.event = IW_CM_EVENT_CONNECT_REPLY;
209 cm_event.local_addr.sin_addr.s_addr = res->laddr; 211 laddr->sin_addr.s_addr = res->laddr;
210 cm_event.remote_addr.sin_addr.s_addr = res->raddr; 212 raddr->sin_addr.s_addr = res->raddr;
211 cm_event.local_addr.sin_port = res->lport; 213 laddr->sin_port = res->lport;
212 cm_event.remote_addr.sin_port = res->rport; 214 raddr->sin_port = res->rport;
213 if (status == 0) { 215 if (status == 0) {
214 cm_event.private_data_len = 216 cm_event.private_data_len =
215 be32_to_cpu(res->private_data_length); 217 be32_to_cpu(res->private_data_length);
@@ -281,10 +283,10 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
281 } 283 }
282 cm_event.event = IW_CM_EVENT_CONNECT_REQUEST; 284 cm_event.event = IW_CM_EVENT_CONNECT_REQUEST;
283 cm_event.provider_data = (void*)(unsigned long)req->cr_handle; 285 cm_event.provider_data = (void*)(unsigned long)req->cr_handle;
284 cm_event.local_addr.sin_addr.s_addr = req->laddr; 286 laddr->sin_addr.s_addr = req->laddr;
285 cm_event.remote_addr.sin_addr.s_addr = req->raddr; 287 raddr->sin_addr.s_addr = req->raddr;
286 cm_event.local_addr.sin_port = req->lport; 288 laddr->sin_port = req->lport;
287 cm_event.remote_addr.sin_port = req->rport; 289 raddr->sin_port = req->rport;
288 cm_event.private_data_len = 290 cm_event.private_data_len =
289 be32_to_cpu(req->private_data_length); 291 be32_to_cpu(req->private_data_length);
290 cm_event.private_data = req->private_data; 292 cm_event.private_data = req->private_data;
diff --git a/drivers/infiniband/hw/amso1100/c2_cm.c b/drivers/infiniband/hw/amso1100/c2_cm.c
index 95f58ab1e0b8..23bfa94fbd4e 100644
--- a/drivers/infiniband/hw/amso1100/c2_cm.c
+++ b/drivers/infiniband/hw/amso1100/c2_cm.c
@@ -46,6 +46,10 @@ int c2_llp_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *iw_param)
46 struct c2wr_qp_connect_req *wr; /* variable size needs a malloc. */ 46 struct c2wr_qp_connect_req *wr; /* variable size needs a malloc. */
47 struct c2_vq_req *vq_req; 47 struct c2_vq_req *vq_req;
48 int err; 48 int err;
49 struct sockaddr_in *raddr = (struct sockaddr_in *)&cm_id->remote_addr;
50
51 if (cm_id->remote_addr.ss_family != AF_INET)
52 return -ENOSYS;
49 53
50 ibqp = c2_get_qp(cm_id->device, iw_param->qpn); 54 ibqp = c2_get_qp(cm_id->device, iw_param->qpn);
51 if (!ibqp) 55 if (!ibqp)
@@ -91,8 +95,8 @@ int c2_llp_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *iw_param)
91 wr->rnic_handle = c2dev->adapter_handle; 95 wr->rnic_handle = c2dev->adapter_handle;
92 wr->qp_handle = qp->adapter_handle; 96 wr->qp_handle = qp->adapter_handle;
93 97
94 wr->remote_addr = cm_id->remote_addr.sin_addr.s_addr; 98 wr->remote_addr = raddr->sin_addr.s_addr;
95 wr->remote_port = cm_id->remote_addr.sin_port; 99 wr->remote_port = raddr->sin_port;
96 100
97 /* 101 /*
98 * Move any private data from the callers's buf into 102 * Move any private data from the callers's buf into
@@ -135,6 +139,10 @@ int c2_llp_service_create(struct iw_cm_id *cm_id, int backlog)
135 struct c2wr_ep_listen_create_rep *reply; 139 struct c2wr_ep_listen_create_rep *reply;
136 struct c2_vq_req *vq_req; 140 struct c2_vq_req *vq_req;
137 int err; 141 int err;
142 struct sockaddr_in *laddr = (struct sockaddr_in *)&cm_id->local_addr;
143
144 if (cm_id->local_addr.ss_family != AF_INET)
145 return -ENOSYS;
138 146
139 c2dev = to_c2dev(cm_id->device); 147 c2dev = to_c2dev(cm_id->device);
140 if (c2dev == NULL) 148 if (c2dev == NULL)
@@ -153,8 +161,8 @@ int c2_llp_service_create(struct iw_cm_id *cm_id, int backlog)
153 c2_wr_set_id(&wr, CCWR_EP_LISTEN_CREATE); 161 c2_wr_set_id(&wr, CCWR_EP_LISTEN_CREATE);
154 wr.hdr.context = (u64) (unsigned long) vq_req; 162 wr.hdr.context = (u64) (unsigned long) vq_req;
155 wr.rnic_handle = c2dev->adapter_handle; 163 wr.rnic_handle = c2dev->adapter_handle;
156 wr.local_addr = cm_id->local_addr.sin_addr.s_addr; 164 wr.local_addr = laddr->sin_addr.s_addr;
157 wr.local_port = cm_id->local_addr.sin_port; 165 wr.local_port = laddr->sin_port;
158 wr.backlog = cpu_to_be32(backlog); 166 wr.backlog = cpu_to_be32(backlog);
159 wr.user_context = (u64) (unsigned long) cm_id; 167 wr.user_context = (u64) (unsigned long) cm_id;
160 168