/*******************************************************************************
  *
  * 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
 
                         ? 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;
                }
                         ? 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;
                }
 
 
        return __i40e_chk_linearize(skb);
 }
+
+/**
+ * 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_ */
 
                         ? 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;
                }
 
 
        return __i40evf_chk_linearize(skb);
 }
+
+/**
+ * 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_ */