aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2015-06-11 09:35:21 -0400
committerDoug Ledford <dledford@redhat.com>2015-06-12 14:49:10 -0400
commit8e37210b38fb7d6aa06aebde763316ee955d44c0 (patch)
tree2ef8854af886906e1901e7c6f0b93a28ae515c6e /net/rds
parentbcf4c1ea583cd213f0bafdbeb11d80f83c5f10e6 (diff)
IB/core: Change ib_create_cq to use struct ib_cq_init_attr
Currently, ib_create_cq uses cqe and comp_vecotr instead of the extendible ib_cq_init_attr struct. Earlier patches already changed the vendors to work with ib_cq_init_attr. This patch changes the consumers too. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/ib_cm.c7
-rw-r--r--net/rds/iw_cm.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index b8d1bdae8a2a..0da2a45b33bd 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -247,6 +247,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
247 struct rds_ib_connection *ic = conn->c_transport_data; 247 struct rds_ib_connection *ic = conn->c_transport_data;
248 struct ib_device *dev = ic->i_cm_id->device; 248 struct ib_device *dev = ic->i_cm_id->device;
249 struct ib_qp_init_attr attr; 249 struct ib_qp_init_attr attr;
250 struct ib_cq_init_attr cq_attr = {};
250 struct rds_ib_device *rds_ibdev; 251 struct rds_ib_device *rds_ibdev;
251 int ret; 252 int ret;
252 253
@@ -270,9 +271,10 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
270 ic->i_pd = rds_ibdev->pd; 271 ic->i_pd = rds_ibdev->pd;
271 ic->i_mr = rds_ibdev->mr; 272 ic->i_mr = rds_ibdev->mr;
272 273
274 cq_attr.cqe = ic->i_send_ring.w_nr + 1;
273 ic->i_send_cq = ib_create_cq(dev, rds_ib_send_cq_comp_handler, 275 ic->i_send_cq = ib_create_cq(dev, rds_ib_send_cq_comp_handler,
274 rds_ib_cq_event_handler, conn, 276 rds_ib_cq_event_handler, conn,
275 ic->i_send_ring.w_nr + 1, 0); 277 &cq_attr);
276 if (IS_ERR(ic->i_send_cq)) { 278 if (IS_ERR(ic->i_send_cq)) {
277 ret = PTR_ERR(ic->i_send_cq); 279 ret = PTR_ERR(ic->i_send_cq);
278 ic->i_send_cq = NULL; 280 ic->i_send_cq = NULL;
@@ -280,9 +282,10 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
280 goto out; 282 goto out;
281 } 283 }
282 284
285 cq_attr.cqe = ic->i_recv_ring.w_nr;
283 ic->i_recv_cq = ib_create_cq(dev, rds_ib_recv_cq_comp_handler, 286 ic->i_recv_cq = ib_create_cq(dev, rds_ib_recv_cq_comp_handler,
284 rds_ib_cq_event_handler, conn, 287 rds_ib_cq_event_handler, conn,
285 ic->i_recv_ring.w_nr, 0); 288 &cq_attr);
286 if (IS_ERR(ic->i_recv_cq)) { 289 if (IS_ERR(ic->i_recv_cq)) {
287 ret = PTR_ERR(ic->i_recv_cq); 290 ret = PTR_ERR(ic->i_recv_cq);
288 ic->i_recv_cq = NULL; 291 ic->i_recv_cq = NULL;
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
index a6c2bea9f8f9..8f486fa32079 100644
--- a/net/rds/iw_cm.c
+++ b/net/rds/iw_cm.c
@@ -179,6 +179,7 @@ static int rds_iw_init_qp_attrs(struct ib_qp_init_attr *attr,
179 void *context) 179 void *context)
180{ 180{
181 struct ib_device *dev = rds_iwdev->dev; 181 struct ib_device *dev = rds_iwdev->dev;
182 struct ib_cq_init_attr cq_attr = {};
182 unsigned int send_size, recv_size; 183 unsigned int send_size, recv_size;
183 int ret; 184 int ret;
184 185
@@ -198,9 +199,10 @@ static int rds_iw_init_qp_attrs(struct ib_qp_init_attr *attr,
198 attr->sq_sig_type = IB_SIGNAL_REQ_WR; 199 attr->sq_sig_type = IB_SIGNAL_REQ_WR;
199 attr->qp_type = IB_QPT_RC; 200 attr->qp_type = IB_QPT_RC;
200 201
202 cq_attr.cqe = send_size;
201 attr->send_cq = ib_create_cq(dev, send_cq_handler, 203 attr->send_cq = ib_create_cq(dev, send_cq_handler,
202 rds_iw_cq_event_handler, 204 rds_iw_cq_event_handler,
203 context, send_size, 0); 205 context, &cq_attr);
204 if (IS_ERR(attr->send_cq)) { 206 if (IS_ERR(attr->send_cq)) {
205 ret = PTR_ERR(attr->send_cq); 207 ret = PTR_ERR(attr->send_cq);
206 attr->send_cq = NULL; 208 attr->send_cq = NULL;
@@ -208,9 +210,10 @@ static int rds_iw_init_qp_attrs(struct ib_qp_init_attr *attr,
208 goto out; 210 goto out;
209 } 211 }
210 212
213 cq_attr.cqe = recv_size;
211 attr->recv_cq = ib_create_cq(dev, recv_cq_handler, 214 attr->recv_cq = ib_create_cq(dev, recv_cq_handler,
212 rds_iw_cq_event_handler, 215 rds_iw_cq_event_handler,
213 context, recv_size, 0); 216 context, &cq_attr);
214 if (IS_ERR(attr->recv_cq)) { 217 if (IS_ERR(attr->recv_cq)) {
215 ret = PTR_ERR(attr->recv_cq); 218 ret = PTR_ERR(attr->recv_cq);
216 attr->recv_cq = NULL; 219 attr->recv_cq = NULL;