mlx4: trust shinfo->gso_segs
authorEric Dumazet <edumazet@google.com>
Wed, 5 Apr 2017 15:49:02 +0000 (08:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 20:27:49 +0000 (13:27 -0700)
mlx4 is the only driver in the tree making a point to recompute
shinfo->gso_segs.

Lets remove superfluous code.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_tx.c

index e0c5ffb3e3a6607456e1f191b0b8c8becfc71219..3ba89bc43d74d8c023776079bcd0bbadd70fb5c6 100644 (file)
@@ -978,8 +978,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
 
                ring->tso_packets++;
 
-               i = ((skb->len - lso_header_size) / shinfo->gso_size) +
-                       !!((skb->len - lso_header_size) % shinfo->gso_size);
+               i = shinfo->gso_segs;
                tx_info->nr_bytes = skb->len + (i - 1) * lso_header_size;
                ring->packets += i;
        } else {