aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/qp.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-10-09 22:59:05 -0400
committerRoland Dreier <rolandd@cisco.com>2007-10-09 22:59:05 -0400
commit2242fa4f04d670f02efb43ec537d677edc220880 (patch)
treea3fc501a86dbbb752201b97cf963703bd01d0aa4 /drivers/infiniband/hw/mlx4/qp.c
parenteaf559bf566f76887533c077d425adce847f06c8 (diff)
IB/mlx4: Use __set_data_seg() in mlx4_ib_post_recv()
Use a __set_data_seg() helper in mlx4_ib_post_recv() too; in addition to making the code easier to read, this also allows gcc to generate better code -- on x86_64: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8) function old new delta mlx4_ib_post_recv 359 351 -8 Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 85c51bdc36f1..31a480e5b0d0 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1249,6 +1249,13 @@ static void set_data_seg(struct mlx4_wqe_data_seg *dseg, struct ib_sge *sg)
1249 dseg->byte_count = cpu_to_be32(sg->length); 1249 dseg->byte_count = cpu_to_be32(sg->length);
1250} 1250}
1251 1251
1252static void __set_data_seg(struct mlx4_wqe_data_seg *dseg, struct ib_sge *sg)
1253{
1254 dseg->byte_count = cpu_to_be32(sg->length);
1255 dseg->lkey = cpu_to_be32(sg->lkey);
1256 dseg->addr = cpu_to_be64(sg->addr);
1257}
1258
1252int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, 1259int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1253 struct ib_send_wr **bad_wr) 1260 struct ib_send_wr **bad_wr)
1254{ 1261{
@@ -1464,11 +1471,8 @@ int mlx4_ib_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
1464 1471
1465 scat = get_recv_wqe(qp, ind); 1472 scat = get_recv_wqe(qp, ind);
1466 1473
1467 for (i = 0; i < wr->num_sge; ++i) { 1474 for (i = 0; i < wr->num_sge; ++i)
1468 scat[i].byte_count = cpu_to_be32(wr->sg_list[i].length); 1475 __set_data_seg(scat + i, wr->sg_list + i);
1469 scat[i].lkey = cpu_to_be32(wr->sg_list[i].lkey);
1470 scat[i].addr = cpu_to_be64(wr->sg_list[i].addr);
1471 }
1472 1476
1473 if (i < qp->rq.max_gs) { 1477 if (i < qp->rq.max_gs) {
1474 scat[i].byte_count = 0; 1478 scat[i].byte_count = 0;