net/mlx5e: IPsec: Refactor checksum code in tx data path
authorRaed Salem <raeds@nvidia.com>
Tue, 26 Oct 2021 07:10:42 +0000 (10:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:39 +0000 (19:12 +0100)
commit748438b4e62c79b0e6fe14cde29f5795288a80e2
treeb500a1af7c1e776e00bcd185b3fb8bf8d32cf48d
parentf1c0163bb824d17663d748aba7dfd5c9cfc8cb82
net/mlx5e: IPsec: Refactor checksum code in tx data path

[ Upstream commit 428ffea0711a11efa0c1c4ee1fac27903ed091be ]

Part of code that is related solely to IPsec is always compiled in the
driver code regardless if the IPsec functionality is enabled or disabled
in the driver code, this will add unnecessary branch in case IPsec is
disabled at Tx data path.

Move IPsec related code to IPsec related file such that in case of IPsec
is disabled and because of unlikely macro the compiler should be able to
optimize and omit the checksum IPsec code all together from Tx data path

Signed-off-by: Raed Salem <raeds@nvidia.com>
Reviewed-by: Emeel Hakim <ehakim@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c