]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
bnx2x: Optimized the branching in the bnx2x_rx_int()
authorVladislav Zolotarov <vladz@broadcom.com>
Sun, 17 Oct 2010 23:02:20 +0000 (23:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2010 13:51:57 +0000 (06:51 -0700)
Optimized the branching in the bnx2x_rx_int() based on the fact
that FP CQE will always have at least one of START or STOP flags set,
so if not both bits are set and START bit is not set,
then it's a STOP bit that is set.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x/bnx2x_cmn.c

index 97ef674dcc3471252ce105899afe5f50b170e829..cb2a3d625ad113de4673ad58dbed3d2325a949f3 100644 (file)
@@ -507,8 +507,11 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
                        len = le16_to_cpu(cqe->fast_path_cqe.pkt_len);
                        pad = cqe->fast_path_cqe.placement_offset;
 
-                       /* If CQE is marked both TPA_START and TPA_END
-                          it is a non-TPA CQE */
+                       /* - If CQE is marked both TPA_START and TPA_END it is
+                        *   a non-TPA CQE.
+                        * - FP CQE will always have either TPA_START or/and
+                        *   TPA_STOP flags set.
+                        */
                        if ((!fp->disable_tpa) &&
                            (TPA_TYPE(cqe_fp_flags) !=
                                        (TPA_TYPE_START | TPA_TYPE_END))) {
@@ -526,9 +529,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
                                        bnx2x_set_skb_rxhash(bp, cqe, skb);
 
                                        goto next_rx;
-                               }
-
-                               if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_END) {
+                               } else { /* TPA_STOP */
                                        DP(NETIF_MSG_RX_STATUS,
                                           "calling tpa_stop on queue %d\n",
                                           queue);