Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d420d9e32f4bd741b2f0b7227a91941107f96b47
Commit:     d420d9e32f4bd741b2f0b7227a91941107f96b47
Parent:     80885456e844552044c8c5f1f9bf0f6773b187ea
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 11:46:27 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 11:46:27 2007 -0700

    IB/mlx4: Factor out setting WQE data segment entries
    
    Factor code to set data segment entries out of mlx4_ib_post_send()
    into set_data_seg().  This cleans up the code and lets the compiler do
    a better job -- on x86_64:
    
    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-16 (-16)
    function                                     old     new   delta
    mlx4_ib_post_send                           1598    1582     -16
    
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/qp.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 8d09aa3..a59c7f0 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1183,6 +1183,14 @@ static int mlx4_wq_overflow(struct mlx4_ib_wq *wq, int 
nreq, struct ib_cq *ib_cq
        return cur + nreq >= wq->max_post;
 }
 
+static void set_data_seg(struct mlx4_wqe_data_seg *dseg,
+                        struct ib_sge *sg)
+{
+       dseg->byte_count = cpu_to_be32(sg->length);
+       dseg->lkey       = cpu_to_be32(sg->lkey);
+       dseg->addr       = cpu_to_be64(sg->addr);
+}
+
 int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
                      struct ib_send_wr **bad_wr)
 {
@@ -1313,12 +1321,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct 
ib_send_wr *wr,
                }
 
                for (i = 0; i < wr->num_sge; ++i) {
-                       ((struct mlx4_wqe_data_seg *) wqe)->byte_count =
-                               cpu_to_be32(wr->sg_list[i].length);
-                       ((struct mlx4_wqe_data_seg *) wqe)->lkey =
-                               cpu_to_be32(wr->sg_list[i].lkey);
-                       ((struct mlx4_wqe_data_seg *) wqe)->addr =
-                               cpu_to_be64(wr->sg_list[i].addr);
+                       set_data_seg(wqe, wr->sg_list + i);
 
                        wqe  += sizeof (struct mlx4_wqe_data_seg);
                        size += sizeof (struct mlx4_wqe_data_seg) / 16;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to