Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2869fb2 authored by Tariq Toukan's avatar Tariq Toukan Committed by David S. Miller
Browse files

net/mlx5: Kconfig, Better organize compilation flags



Always contain all acceleration functions declarations in
'accel' files, independent to the flags setting.
For this, introduce new flags CONFIG_FPGA_{IPSEC/TLS} and use stubs
where needed.

This obsoletes the need for stubs in 'fpga' files. Remove them.

Also use the new flags in Makefile, to decide whether to compile
TLS-specific or IPSEC-specific objects, or not.

Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c778dd31
Loading
Loading
Loading
Loading
+33 −10
Original line number Diff line number Diff line
@@ -97,26 +97,49 @@ config MLX5_CORE_IPOIB
	---help---
	  MLX5 IPoIB offloads & acceleration support.

config MLX5_FPGA_IPSEC
	bool "Mellanox Technologies IPsec Innova support"
	depends on MLX5_CORE
	depends on MLX5_FPGA
	default n
	help
	Build IPsec support for the Innova family of network cards by Mellanox
	Technologies. Innova network cards are comprised of a ConnectX chip
	and an FPGA chip on one board. If you select this option, the
	mlx5_core driver will include the Innova FPGA core and allow building
	sandbox-specific client drivers.

config MLX5_EN_IPSEC
	bool "IPSec XFRM cryptography-offload accelaration"
	depends on MLX5_ACCEL
	depends on MLX5_CORE_EN
	depends on XFRM_OFFLOAD
	depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD
	depends on MLX5_FPGA_IPSEC
	default n
	---help---
	help
	  Build support for IPsec cryptography-offload accelaration in the NIC.
	  Note: Support for hardware with this capability needs to be selected
	  for this option to become available.

config MLX5_EN_TLS
	bool "TLS cryptography-offload accelaration"
	depends on MLX5_CORE_EN
config MLX5_FPGA_TLS
	bool "Mellanox Technologies TLS Innova support"
	depends on TLS_DEVICE
	depends on TLS=y || MLX5_CORE=m
	depends on MLX5_ACCEL
	depends on MLX5_FPGA
	default n
	---help---
	help
	Build TLS support for the Innova family of network cards by Mellanox
	Technologies. Innova network cards are comprised of a ConnectX chip
	and an FPGA chip on one board. If you select this option, the
	mlx5_core driver will include the Innova FPGA core and allow building
	sandbox-specific client drivers.

config MLX5_EN_TLS
	bool "TLS cryptography-offload accelaration"
	depends on MLX5_CORE_EN
	depends on MLX5_FPGA_TLS
	default y
	help
	Build support for TLS cryptography-offload accelaration in the NIC.
	Note: Support for hardware with this capability needs to be selected
	for this option to become available.
+4 −3
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ mlx5_core-$(CONFIG_MLX5_CORE_IPOIB) += ipoib/ipoib.o ipoib/ethtool.o ipoib/ipoib
#
# Accelerations & FPGA
#
mlx5_core-$(CONFIG_MLX5_ACCEL) += accel/ipsec.o accel/tls.o
mlx5_core-$(CONFIG_MLX5_FPGA_IPSEC) += fpga/ipsec.o
mlx5_core-$(CONFIG_MLX5_FPGA_TLS)   += fpga/tls.o
mlx5_core-$(CONFIG_MLX5_ACCEL)      += accel/tls.o accel/ipsec.o

mlx5_core-$(CONFIG_MLX5_FPGA) += fpga/cmd.o fpga/core.o fpga/conn.o fpga/sdk.o \
				 fpga/ipsec.o fpga/tls.o
mlx5_core-$(CONFIG_MLX5_FPGA) += fpga/cmd.o fpga/core.o fpga/conn.o fpga/sdk.o

mlx5_core-$(CONFIG_MLX5_EN_IPSEC) += en_accel/ipsec.o en_accel/ipsec_rxtx.o \
				     en_accel/ipsec_stats.o
+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@
 *
 */

#ifdef CONFIG_MLX5_FPGA_IPSEC

#include <linux/mlx5/device.h>

#include "accel/ipsec.h"
@@ -112,3 +114,5 @@ int mlx5_accel_esp_modify_xfrm(struct mlx5_accel_esp_xfrm *xfrm,
	return mlx5_fpga_esp_modify_xfrm(xfrm, attrs);
}
EXPORT_SYMBOL_GPL(mlx5_accel_esp_modify_xfrm);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
#include <linux/mlx5/driver.h>
#include <linux/mlx5/accel.h>

#ifdef CONFIG_MLX5_ACCEL
#ifdef CONFIG_MLX5_FPGA_IPSEC

#define MLX5_IPSEC_DEV(mdev) (mlx5_accel_ipsec_device_caps(mdev) & \
			      MLX5_ACCEL_IPSEC_CAP_DEVICE)
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@

#include "accel/tls.h"
#include "mlx5_core.h"

#ifdef CONFIG_MLX5_FPGA_TLS
#include "fpga/tls.h"

int mlx5_accel_tls_add_flow(struct mlx5_core_dev *mdev, void *flow,
@@ -78,3 +80,4 @@ void mlx5_accel_tls_cleanup(struct mlx5_core_dev *mdev)
{
	mlx5_fpga_tls_cleanup(mdev);
}
#endif
Loading