diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2013-09-28 02:00:32 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-10-10 01:06:02 -0400 |
commit | b194130627580519e63665660db055bfe82b6949 (patch) | |
tree | e389fe274c937b0ca1e7abf0e3788ca3af6c67a7 /drivers/net/ethernet | |
parent | a5e9c5726424b05a3643450d45c134cea103181e (diff) |
i40e: Drop dead code and flags from Tx hotpath
Drop Tx flag and TXSW which is tested but never set.
As a result of this change we can drop a complicated check that always
resulted in the final result of i40e_tx_csum being equal to the
CHECKSUM_PARTIAL value. As such we can replace the entire function call
with just a check for skb->summed == CHECKSUM_PARTIAL.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 31 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 |
2 files changed, 5 insertions, 27 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index e96de7567856..52dfac206f75 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1300,27 +1300,6 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | |||
1300 | } | 1300 | } |
1301 | 1301 | ||
1302 | /** | 1302 | /** |
1303 | * i40e_tx_csum - is checksum offload requested | ||
1304 | * @tx_ring: ptr to the ring to send | ||
1305 | * @skb: ptr to the skb we're sending | ||
1306 | * @tx_flags: the collected send information | ||
1307 | * @protocol: the send protocol | ||
1308 | * | ||
1309 | * Returns true if checksum offload is requested | ||
1310 | **/ | ||
1311 | static bool i40e_tx_csum(struct i40e_ring *tx_ring, struct sk_buff *skb, | ||
1312 | u32 tx_flags, __be16 protocol) | ||
1313 | { | ||
1314 | if ((skb->ip_summed != CHECKSUM_PARTIAL) && | ||
1315 | !(tx_flags & I40E_TX_FLAGS_TXSW)) { | ||
1316 | if (!(tx_flags & I40E_TX_FLAGS_HW_VLAN)) | ||
1317 | return false; | ||
1318 | } | ||
1319 | |||
1320 | return skb->ip_summed == CHECKSUM_PARTIAL; | ||
1321 | } | ||
1322 | |||
1323 | /** | ||
1324 | * i40e_tso - set up the tso context descriptor | 1303 | * i40e_tso - set up the tso context descriptor |
1325 | * @tx_ring: ptr to the ring to send | 1304 | * @tx_ring: ptr to the ring to send |
1326 | * @skb: ptr to the skb we're sending | 1305 | * @skb: ptr to the skb we're sending |
@@ -1785,16 +1764,16 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb, | |||
1785 | 1764 | ||
1786 | skb_tx_timestamp(skb); | 1765 | skb_tx_timestamp(skb); |
1787 | 1766 | ||
1767 | /* always enable CRC insertion offload */ | ||
1768 | td_cmd |= I40E_TX_DESC_CMD_ICRC; | ||
1769 | |||
1788 | /* Always offload the checksum, since it's in the data descriptor */ | 1770 | /* Always offload the checksum, since it's in the data descriptor */ |
1789 | if (i40e_tx_csum(tx_ring, skb, tx_flags, protocol)) | 1771 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1790 | tx_flags |= I40E_TX_FLAGS_CSUM; | 1772 | tx_flags |= I40E_TX_FLAGS_CSUM; |
1791 | 1773 | ||
1792 | /* always enable offload insertion */ | ||
1793 | td_cmd |= I40E_TX_DESC_CMD_ICRC; | ||
1794 | |||
1795 | if (tx_flags & I40E_TX_FLAGS_CSUM) | ||
1796 | i40e_tx_enable_csum(skb, tx_flags, &td_cmd, &td_offset, | 1774 | i40e_tx_enable_csum(skb, tx_flags, &td_cmd, &td_offset, |
1797 | tx_ring, &cd_tunneling); | 1775 | tx_ring, &cd_tunneling); |
1776 | } | ||
1798 | 1777 | ||
1799 | i40e_create_tx_ctx(tx_ring, cd_type_cmd_tso_mss, | 1778 | i40e_create_tx_ctx(tx_ring, cd_type_cmd_tso_mss, |
1800 | cd_tunneling, cd_l2tag2); | 1779 | cd_tunneling, cd_l2tag2); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h index 2cb1338fb794..e5142476a7f0 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h | |||
@@ -102,7 +102,6 @@ | |||
102 | #define I40E_TX_FLAGS_IPV6 (u32)(1 << 5) | 102 | #define I40E_TX_FLAGS_IPV6 (u32)(1 << 5) |
103 | #define I40E_TX_FLAGS_FCCRC (u32)(1 << 6) | 103 | #define I40E_TX_FLAGS_FCCRC (u32)(1 << 6) |
104 | #define I40E_TX_FLAGS_FSO (u32)(1 << 7) | 104 | #define I40E_TX_FLAGS_FSO (u32)(1 << 7) |
105 | #define I40E_TX_FLAGS_TXSW (u32)(1 << 8) | ||
106 | #define I40E_TX_FLAGS_VLAN_MASK 0xffff0000 | 105 | #define I40E_TX_FLAGS_VLAN_MASK 0xffff0000 |
107 | #define I40E_TX_FLAGS_VLAN_PRIO_MASK 0xe0000000 | 106 | #define I40E_TX_FLAGS_VLAN_PRIO_MASK 0xe0000000 |
108 | #define I40E_TX_FLAGS_VLAN_PRIO_SHIFT 29 | 107 | #define I40E_TX_FLAGS_VLAN_PRIO_SHIFT 29 |