aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-02-08 02:50:45 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-03-17 04:06:53 -0400
commit93f5b3c1f148f2cca247a2c5afdd3ba7a123a6f1 (patch)
treee611dafd4a29f99596630b771069ce39509cc5db /drivers
parenta50c29dd09ed14f8489677813a4b1c8b62dcf19d (diff)
ixgbe: Modify setup of descriptor flags to avoid conditional jumps
This change makes it more likely that the descriptor flags setup will use cmov instructions instead of conditional jumps when setting up the flags. The advantage to this is that the code should just flow a bit more smoothly. To do this it is necessary to set the TX_FLAGS_CSUM bit in tx_flags when doing TSO so that we also do the checksum in addition to the segmentation offload. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bf6d122e6f99..efce423586d4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6689,7 +6689,7 @@ static __le32 ixgbe_tx_cmd_type(u32 tx_flags)
6689 6689
6690 /* set segmentation enable bits for TSO/FSO */ 6690 /* set segmentation enable bits for TSO/FSO */
6691#ifdef IXGBE_FCOE 6691#ifdef IXGBE_FCOE
6692 if ((tx_flags & IXGBE_TX_FLAGS_TSO) || (tx_flags & IXGBE_TX_FLAGS_FSO)) 6692 if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FSO))
6693#else 6693#else
6694 if (tx_flags & IXGBE_TX_FLAGS_TSO) 6694 if (tx_flags & IXGBE_TX_FLAGS_TSO)
6695#endif 6695#endif
@@ -6700,33 +6700,33 @@ static __le32 ixgbe_tx_cmd_type(u32 tx_flags)
6700 6700
6701static __le32 ixgbe_tx_olinfo_status(u32 tx_flags, unsigned int paylen) 6701static __le32 ixgbe_tx_olinfo_status(u32 tx_flags, unsigned int paylen)
6702{ 6702{
6703 __le32 olinfo_status = 6703 __le32 olinfo_status = cpu_to_le32(paylen << IXGBE_ADVTXD_PAYLEN_SHIFT);
6704 cpu_to_le32(paylen << IXGBE_ADVTXD_PAYLEN_SHIFT);
6705
6706 if (tx_flags & IXGBE_TX_FLAGS_TSO) {
6707 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM |
6708 (1 << IXGBE_ADVTXD_IDX_SHIFT));
6709 /* enble IPv4 checksum for TSO */
6710 if (tx_flags & IXGBE_TX_FLAGS_IPV4)
6711 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM);
6712 }
6713 6704
6714 /* enable L4 checksum for TSO and TX checksum offload */ 6705 /* enable L4 checksum for TSO and TX checksum offload */
6715 if (tx_flags & IXGBE_TX_FLAGS_CSUM) 6706 if (tx_flags & IXGBE_TX_FLAGS_CSUM)
6716 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM); 6707 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM);
6717 6708
6718#ifdef IXGBE_FCOE 6709 /* enble IPv4 checksum for TSO */
6719 /* use index 1 context for FCOE/FSO */ 6710 if (tx_flags & IXGBE_TX_FLAGS_IPV4)
6720 if (tx_flags & IXGBE_TX_FLAGS_FCOE) 6711 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM);
6721 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC |
6722 (1 << IXGBE_ADVTXD_IDX_SHIFT));
6723 6712
6713 /* use index 1 context for TSO/FSO/FCOE */
6714#ifdef IXGBE_FCOE
6715 if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FCOE))
6716#else
6717 if (tx_flags & IXGBE_TX_FLAGS_TSO)
6724#endif 6718#endif
6719 olinfo_status |= cpu_to_le32(1 << IXGBE_ADVTXD_IDX_SHIFT);
6720
6725 /* 6721 /*
6726 * Check Context must be set if Tx switch is enabled, which it 6722 * Check Context must be set if Tx switch is enabled, which it
6727 * always is for case where virtual functions are running 6723 * always is for case where virtual functions are running
6728 */ 6724 */
6725#ifdef IXGBE_FCOE
6726 if (tx_flags & (IXGBE_TX_FLAGS_TXSW | IXGBE_TX_FLAGS_FCOE))
6727#else
6729 if (tx_flags & IXGBE_TX_FLAGS_TXSW) 6728 if (tx_flags & IXGBE_TX_FLAGS_TXSW)
6729#endif
6730 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC); 6730 olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC);
6731 6731
6732 return olinfo_status; 6732 return olinfo_status;
@@ -7140,7 +7140,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
7140 if (tso < 0) 7140 if (tso < 0)
7141 goto out_drop; 7141 goto out_drop;
7142 else if (tso) 7142 else if (tso)
7143 tx_flags |= IXGBE_TX_FLAGS_TSO; 7143 tx_flags |= IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_CSUM;
7144 else if (ixgbe_tx_csum(tx_ring, skb, tx_flags, protocol)) 7144 else if (ixgbe_tx_csum(tx_ring, skb, tx_flags, protocol))
7145 tx_flags |= IXGBE_TX_FLAGS_CSUM; 7145 tx_flags |= IXGBE_TX_FLAGS_CSUM;
7146 7146