]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:45 +0000 (08:37 -0800)
Orabug: 22342532

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 commit 3bc67973e81d5104908a4ba7c2aab98a4f7bd64e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index 353364bbdabaf73d194445eb117771d21371eb0a..2b0e420f7242dffe7e537eca9499e66a3f9f8127 100644 (file)
@@ -2928,6 +2928,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)
@@ -2938,12 +2944,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 427d5284b5f59dcfabe1c47acf54a6f1841321f9..5314534ad5d80aeb60fefc090b2ea63978bceb19 100644 (file)
@@ -2147,17 +2147,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);