]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
i40e/i40evf: Move Tx checksum closer to TSO
authorAlexander Duyck <aduyck@mirantis.com>
Wed, 17 Feb 2016 19:02:56 +0000 (11:02 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:20:53 +0000 (10:20 +0100)
BugLink: http://bugs.launchpad.net/bugs/1547674
On all of the other Intel drivers we place checksum close to TSO as they
have a significant amount in common and it can help to reduce the decision
tree for how to handle the frame as the first check in TSO is to see if
checksumming is offloaded, and if it is not we can skip _BOTH_ TSO and Tx
checksum offload based on a single check.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from net-next commit 3bc67973e81d5104908a4ba7c2aab98a4f7bd64e)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index a88e6d16093c943387b0d8be99b5a714af63970a..9a9bda489c7ef69171bd484c499fc505ef5efcec 100644 (file)
@@ -2930,6 +2930,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
        else if (tso)
                tx_flags |= I40E_TX_FLAGS_TSO;
 
+       /* Always offload the checksum, since it's in the data descriptor */
+       tso = i40e_tx_enable_csum(skb, &tx_flags, &td_cmd, &td_offset,
+                                 tx_ring, &cd_tunneling);
+       if (tso < 0)
+               goto out_drop;
+
        tsyn = i40e_tsyn(tx_ring, skb, tx_flags, &cd_type_cmd_tso_mss);
 
        if (tsyn)
@@ -2940,12 +2946,6 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
        /* always enable CRC insertion offload */
        td_cmd |= I40E_TX_DESC_CMD_ICRC;
 
-       /* Always offload the checksum, since it's in the data descriptor */
-       tso = i40e_tx_enable_csum(skb, &tx_flags, &td_cmd, &td_offset,
-                                 tx_ring, &cd_tunneling);
-       if (tso < 0)
-               goto out_drop;
-
        i40e_create_tx_ctx(tx_ring, cd_type_cmd_tso_mss,
                           cd_tunneling, cd_l2tag2);
 
index 46948866052d4f12f40475570d15dba70793191e..75ce1bb42e944d70774f9d1388d87082debd7c46 100644 (file)
@@ -2149,17 +2149,17 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
        else if (tso)
                tx_flags |= I40E_TX_FLAGS_TSO;
 
-       skb_tx_timestamp(skb);
-
-       /* always enable CRC insertion offload */
-       td_cmd |= I40E_TX_DESC_CMD_ICRC;
-
        /* Always offload the checksum, since it's in the data descriptor */
        tso = i40e_tx_enable_csum(skb, &tx_flags, &td_cmd, &td_offset,
                                  tx_ring, &cd_tunneling);
        if (tso < 0)
                goto out_drop;
 
+       skb_tx_timestamp(skb);
+
+       /* always enable CRC insertion offload */
+       td_cmd |= I40E_TX_DESC_CMD_ICRC;
+
        i40e_create_tx_ctx(tx_ring, cd_type_cmd_tso_mss,
                           cd_tunneling, cd_l2tag2);