]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: Faster RX via avoiding FCoE
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Fri, 1 Apr 2016 10:56:06 +0000 (03:56 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 17:41:00 +0000 (10:41 -0700)
Orabug: 23176970

As it turns out, calling into other files from hot path hurts
performance a lot.  In this case the majority of the time we
call "check FCoE" and the packet is *not* FCoE, but this call
was taking 5% of our total cycles spent on receive.

Change-ID: I080552c26e7060bc7b78504dc2763f6f0b3d8c76
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1f15d66712bb64e39fe2c23b1b32f68f9e1d4ee7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_fcoe.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_txrx.h
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.h

index 0baa1e752ccf410f90c2622a880a2ef50d2e5f40..6079f51d562de0b2386095a2cf3b7b22a8f0d0d7 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
  *
  * Intel Ethernet Controller XL710 Family Linux Driver
- * Copyright(c) 2013 - 2015 Intel Corporation.
+ * Copyright(c) 2013 - 2016 Intel Corporation.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
 #include "i40e.h"
 #include "i40e_fcoe.h"
 
-/**
- * i40e_rx_is_fcoe - returns true if the rx packet type is FCoE
- * @ptype: the packet type field from rx descriptor write-back
- **/
-static inline bool i40e_rx_is_fcoe(u16 ptype)
-{
-       return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) &&
-              (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER);
-}
-
 /**
  * i40e_fcoe_sof_is_class2 - returns true if this is a FC Class 2 SOF
  * @sof: the FCoE start of frame delimiter
index 1cd61a00e41d824ecbf8fb8656ef170283864b71..e7ae61752cac2bc44f0703c4cdf8ea5a75fe2ffe 100644 (file)
@@ -1702,7 +1702,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget)
                         ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1)
                         : 0;
 #ifdef I40E_FCOE
-               if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) {
+               if (unlikely(
+                   i40e_rx_is_fcoe(rx_ptype) &&
+                   !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) {
                        dev_kfree_skb_any(skb);
                        continue;
                }
@@ -1835,7 +1837,9 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget)
                         ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1)
                         : 0;
 #ifdef I40E_FCOE
-               if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) {
+               if (unlikely(
+                   i40e_rx_is_fcoe(rx_ptype) &&
+                   !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) {
                        dev_kfree_skb_any(skb);
                        continue;
                }
index 7af89b25c944cb57b3f8f1e6b538b36afe94d9a7..6b2b1913527d84d8ee0b0e843fba12b68004ec83 100644 (file)
@@ -452,4 +452,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count)
        /* we can support up to 8 data buffers for a single send */
        return count != I40E_MAX_BUFFER_TXD;
 }
+
+/**
+ * i40e_rx_is_fcoe - returns true if the Rx packet type is FCoE
+ * @ptype: the packet type field from Rx descriptor write-back
+ **/
+static inline bool i40e_rx_is_fcoe(u16 ptype)
+{
+       return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) &&
+              (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER);
+}
 #endif /* _I40E_TXRX_H_ */
index d055d441ba1f5503ce63cbcf3824e1cdf02b0311..8ce55518ffe2f649faa1528109b297c082867440 100644 (file)
@@ -1159,7 +1159,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget)
                         ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1)
                         : 0;
 #ifdef I40E_FCOE
-               if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) {
+               if (unlikely(
+                   i40e_rx_is_fcoe(rx_ptype) &&
+                   !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) {
                        dev_kfree_skb_any(skb);
                        continue;
                }
index aefaed68282797f69fc6564f2f2761a8cfd9a286..54b52e8f7097bbe5b6c50bffdd761f026e970127 100644 (file)
@@ -434,4 +434,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count)
        /* we can support up to 8 data buffers for a single send */
        return count != I40E_MAX_BUFFER_TXD;
 }
+
+/**
+ * i40e_rx_is_fcoe - returns true if the Rx packet type is FCoE
+ * @ptype: the packet type field from Rx descriptor write-back
+ **/
+static inline bool i40e_rx_is_fcoe(u16 ptype)
+{
+       return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) &&
+              (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER);
+}
 #endif /* _I40E_TXRX_H_ */