net/mlx4_en: Refactor mlx4_en_free_tx_desc
authorTariq Toukan <tariqt@mellanox.com>
Thu, 15 Jun 2017 11:35:40 +0000 (14:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 02:53:23 +0000 (22:53 -0400)
commit4c07c132408a685d31bb6e638aef4d245e30703a
tree6c8379e98405b231cf3e89fb732f938ba58d074e
parent9573e0d39ff8d7d1e0bcc10e23d18b9cbc4ca14e
net/mlx4_en: Refactor mlx4_en_free_tx_desc

Some code re-ordering, functionally equivalent.

- The !tx_info->inl check is evaluated anyway in both flows
  (common case/end case). Run it first, this might finish
  the flows earlier.
- dma_unmap calls are identical in both flows, get it out
  of the if block into the common area.

Performance tests:
Tested on ConnectX3Pro, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz

Gain is too small to be measurable, no degradation sensed.
Results are similar for IPv4 and IPv6.

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