Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3226184af6c13c9d5d38f13f0ef8e03f718bbf7
Commit:     b3226184af6c13c9d5d38f13f0ef8e03f718bbf7
Parent:     e57895d38991036f9ccf193b70fc5ebd5f6e6dc9
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 14:15:34 2008 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 14:15:34 2008 -0800

    IB/mlx4: Micro-optimize mlx4_ib_poll_one()
    
    Rather than byte-swapping cqe->g_mlpath_rqpn each time we extract a
    field from it, byte-swap it once into a temporary variable.  This
    results in smaller, better code -- eg, on 32-bit x86:
    
    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
    function                                     old     new   delta
    mlx4_ib_poll_cq                             1188    1183      -5
    
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/cq.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 9d32c49..7950aa6 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -313,6 +313,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
        struct mlx4_ib_srq *srq;
        int is_send;
        int is_error;
+       u32 g_mlpath_rqpn;
        u16 wqe_ctr;
 
        cqe = next_cqe_sw(cq);
@@ -426,10 +427,10 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
 
                wc->slid           = be16_to_cpu(cqe->rlid);
                wc->sl             = cqe->sl >> 4;
-               wc->src_qp         = be32_to_cpu(cqe->g_mlpath_rqpn) & 0xffffff;
-               wc->dlid_path_bits = (be32_to_cpu(cqe->g_mlpath_rqpn) >> 24) & 
0x7f;
-               wc->wc_flags      |= be32_to_cpu(cqe->g_mlpath_rqpn) & 
0x80000000 ?
-                       IB_WC_GRH : 0;
+               g_mlpath_rqpn      = be32_to_cpu(cqe->g_mlpath_rqpn);
+               wc->src_qp         = g_mlpath_rqpn & 0xffffff;
+               wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
+               wc->wc_flags      |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0;
                wc->pkey_index     = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f;
        }
 
-
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