diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2016-04-01 06:56:06 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-04-06 21:26:23 -0400 |
commit | 1f15d66712bb64e39fe2c23b1b32f68f9e1d4ee7 (patch) | |
tree | 78c5fda55e9acd9e39164c60d3624a50c8eb3664 /drivers/net | |
parent | 84b079928a10559ebc6679e1e973a3ee5b20ba83 (diff) |
i40e/i40evf: Faster RX via avoiding FCoE
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 |
5 files changed, 30 insertions, 14 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c index 92d2208d13c7..58e6c1570335 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c +++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | * | 2 | * |
3 | * Intel Ethernet Controller XL710 Family Linux Driver | 3 | * Intel Ethernet Controller XL710 Family Linux Driver |
4 | * Copyright(c) 2013 - 2015 Intel Corporation. | 4 | * Copyright(c) 2013 - 2016 Intel Corporation. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -38,16 +38,6 @@ | |||
38 | #include "i40e_fcoe.h" | 38 | #include "i40e_fcoe.h" |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * i40e_rx_is_fcoe - returns true if the rx packet type is FCoE | ||
42 | * @ptype: the packet type field from rx descriptor write-back | ||
43 | **/ | ||
44 | static inline bool i40e_rx_is_fcoe(u16 ptype) | ||
45 | { | ||
46 | return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) && | ||
47 | (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * i40e_fcoe_sof_is_class2 - returns true if this is a FC Class 2 SOF | 41 | * i40e_fcoe_sof_is_class2 - returns true if this is a FC Class 2 SOF |
52 | * @sof: the FCoE start of frame delimiter | 42 | * @sof: the FCoE start of frame delimiter |
53 | **/ | 43 | **/ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index f4e4d3d098dc..29ffed27e5a9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1703,7 +1703,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget) | |||
1703 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) | 1703 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) |
1704 | : 0; | 1704 | : 0; |
1705 | #ifdef I40E_FCOE | 1705 | #ifdef I40E_FCOE |
1706 | if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) { | 1706 | if (unlikely( |
1707 | i40e_rx_is_fcoe(rx_ptype) && | ||
1708 | !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) { | ||
1707 | dev_kfree_skb_any(skb); | 1709 | dev_kfree_skb_any(skb); |
1708 | continue; | 1710 | continue; |
1709 | } | 1711 | } |
@@ -1834,7 +1836,9 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget) | |||
1834 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) | 1836 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) |
1835 | : 0; | 1837 | : 0; |
1836 | #ifdef I40E_FCOE | 1838 | #ifdef I40E_FCOE |
1837 | if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) { | 1839 | if (unlikely( |
1840 | i40e_rx_is_fcoe(rx_ptype) && | ||
1841 | !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) { | ||
1838 | dev_kfree_skb_any(skb); | 1842 | dev_kfree_skb_any(skb); |
1839 | continue; | 1843 | continue; |
1840 | } | 1844 | } |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h index 9e654e611642..77ccdde56c0c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h | |||
@@ -448,4 +448,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) | |||
448 | 448 | ||
449 | return __i40e_chk_linearize(skb); | 449 | return __i40e_chk_linearize(skb); |
450 | } | 450 | } |
451 | |||
452 | /** | ||
453 | * i40e_rx_is_fcoe - returns true if the Rx packet type is FCoE | ||
454 | * @ptype: the packet type field from Rx descriptor write-back | ||
455 | **/ | ||
456 | static inline bool i40e_rx_is_fcoe(u16 ptype) | ||
457 | { | ||
458 | return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) && | ||
459 | (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER); | ||
460 | } | ||
451 | #endif /* _I40E_TXRX_H_ */ | 461 | #endif /* _I40E_TXRX_H_ */ |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index ec1f4479d72e..0c912a4999db 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -1160,7 +1160,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget) | |||
1160 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) | 1160 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) |
1161 | : 0; | 1161 | : 0; |
1162 | #ifdef I40E_FCOE | 1162 | #ifdef I40E_FCOE |
1163 | if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) { | 1163 | if (unlikely( |
1164 | i40e_rx_is_fcoe(rx_ptype) && | ||
1165 | !i40e_fcoe_handle_offload(rx_ring, rx_desc, skb))) { | ||
1164 | dev_kfree_skb_any(skb); | 1166 | dev_kfree_skb_any(skb); |
1165 | continue; | 1167 | continue; |
1166 | } | 1168 | } |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h index 3ec0ea5ea3db..84c28aa64fdf 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h | |||
@@ -430,4 +430,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) | |||
430 | 430 | ||
431 | return __i40evf_chk_linearize(skb); | 431 | return __i40evf_chk_linearize(skb); |
432 | } | 432 | } |
433 | |||
434 | /** | ||
435 | * i40e_rx_is_fcoe - returns true if the Rx packet type is FCoE | ||
436 | * @ptype: the packet type field from Rx descriptor write-back | ||
437 | **/ | ||
438 | static inline bool i40e_rx_is_fcoe(u16 ptype) | ||
439 | { | ||
440 | return (ptype >= I40E_RX_PTYPE_L2_FCOE_PAY3) && | ||
441 | (ptype <= I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER); | ||
442 | } | ||
433 | #endif /* _I40E_TXRX_H_ */ | 443 | #endif /* _I40E_TXRX_H_ */ |