From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 08/12] ixgbe: Modify setup of descriptor flags to avoid conditional jumps
Date: Sat, 17 Mar 2012 01:50:56 -0700 [thread overview]
Message-ID: <1331974260-6383-9-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1331974260-6383-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
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>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 34 ++++++++++++------------
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 bf6d122..efce423 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)
/* set segmentation enable bits for TSO/FSO */
#ifdef IXGBE_FCOE
- if ((tx_flags & IXGBE_TX_FLAGS_TSO) || (tx_flags & IXGBE_TX_FLAGS_FSO))
+ if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FSO))
#else
if (tx_flags & IXGBE_TX_FLAGS_TSO)
#endif
@@ -6700,33 +6700,33 @@ static __le32 ixgbe_tx_cmd_type(u32 tx_flags)
static __le32 ixgbe_tx_olinfo_status(u32 tx_flags, unsigned int paylen)
{
- __le32 olinfo_status =
- cpu_to_le32(paylen << IXGBE_ADVTXD_PAYLEN_SHIFT);
-
- if (tx_flags & IXGBE_TX_FLAGS_TSO) {
- olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM |
- (1 << IXGBE_ADVTXD_IDX_SHIFT));
- /* enble IPv4 checksum for TSO */
- if (tx_flags & IXGBE_TX_FLAGS_IPV4)
- olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM);
- }
+ __le32 olinfo_status = cpu_to_le32(paylen << IXGBE_ADVTXD_PAYLEN_SHIFT);
/* enable L4 checksum for TSO and TX checksum offload */
if (tx_flags & IXGBE_TX_FLAGS_CSUM)
olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_TXSM);
-#ifdef IXGBE_FCOE
- /* use index 1 context for FCOE/FSO */
- if (tx_flags & IXGBE_TX_FLAGS_FCOE)
- olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC |
- (1 << IXGBE_ADVTXD_IDX_SHIFT));
+ /* enble IPv4 checksum for TSO */
+ if (tx_flags & IXGBE_TX_FLAGS_IPV4)
+ olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_POPTS_IXSM);
+ /* use index 1 context for TSO/FSO/FCOE */
+#ifdef IXGBE_FCOE
+ if (tx_flags & (IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_FCOE))
+#else
+ if (tx_flags & IXGBE_TX_FLAGS_TSO)
#endif
+ olinfo_status |= cpu_to_le32(1 << IXGBE_ADVTXD_IDX_SHIFT);
+
/*
* Check Context must be set if Tx switch is enabled, which it
* always is for case where virtual functions are running
*/
+#ifdef IXGBE_FCOE
+ if (tx_flags & (IXGBE_TX_FLAGS_TXSW | IXGBE_TX_FLAGS_FCOE))
+#else
if (tx_flags & IXGBE_TX_FLAGS_TXSW)
+#endif
olinfo_status |= cpu_to_le32(IXGBE_ADVTXD_CC);
return olinfo_status;
@@ -7140,7 +7140,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
if (tso < 0)
goto out_drop;
else if (tso)
- tx_flags |= IXGBE_TX_FLAGS_TSO;
+ tx_flags |= IXGBE_TX_FLAGS_TSO | IXGBE_TX_FLAGS_CSUM;
else if (ixgbe_tx_csum(tx_ring, skb, tx_flags, protocol))
tx_flags |= IXGBE_TX_FLAGS_CSUM;
--
1.7.7.6
next prev parent reply other threads:[~2012-03-17 8:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-17 8:50 [net-next 00/12][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-03-17 8:50 ` [net-next 01/12] igb: Support sending custom Ethernet FCS Jeff Kirsher
2012-03-17 8:50 ` [net-next 02/12] igb: Support RX-ALL feature flag Jeff Kirsher
2012-03-17 8:50 ` [net-next 03/12] ixgbe: Support sending custom Ethernet FCS Jeff Kirsher
2012-03-17 8:50 ` [net-next 04/12] ixgbe: Support RX-ALL feature flag Jeff Kirsher
2012-03-17 8:50 ` [net-next 05/12] ixgbe: Replace standard receive path with a page based receive Jeff Kirsher
2012-03-17 8:50 ` [net-next 06/12] ixgbe: cleanup logic in ixgbe_change_mtu Jeff Kirsher
2012-03-17 8:50 ` [net-next 07/12] ixgbe: Make certain that all frames fit minimum size requirements Jeff Kirsher
2012-03-17 8:50 ` Jeff Kirsher [this message]
2012-03-17 8:50 ` [net-next 09/12] ixgbe: Use packets to track Tx completions instead of a seperate value Jeff Kirsher
2012-03-17 8:50 ` [net-next 10/12] ixgbe: Place skb on first buffer_info structure to avoid using stack space Jeff Kirsher
2012-03-17 8:50 ` [net-next 11/12] ixgbe: Write gso_segs and bytcount to the ring sooner Jeff Kirsher
2012-03-17 8:51 ` [net-next 12/12] ixgbe: always write DMA for single_mapped value with skb Jeff Kirsher
2012-03-17 9:06 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331974260-6383-9-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).