Skip to content

Commit 68be7b8

Browse files
committed
Merge branch 'mlx5e-use-tls-tx-pool-to-improve-connection-rate'
Tariq Toukan says: ==================== mlx5e use TLS TX pool to improve connection rate To offload encryption operations, the mlx5 device maintains state and keeps track of every kTLS device-offloaded connection. Two HW objects are used per TX context of a kTLS offloaded connection: a. Transport interface send (TIS) object, to reach the HW context. b. Data Encryption Key (DEK) to perform the crypto operations. These two objects are created and destroyed per TLS TX context, via FW commands. In total, 4 FW commands are issued per TLS TX context, which seriously limits the connection rate. In this series, we aim to save creation and destroy of TIS objects by recycling them. Upon recycling of a TIS, the HW still needs to be notified for the re-mapping between a TIS and a context. This is done by posting WQEs via an SQ, significantly faster API than the FW command interface. A pool is used for recycling. The pool dynamically interacts to the load and connection rate, growing and shrinking accordingly. Saving the TIS FW commands per context increases connection rate by ~42%, from 11.6K to 16.5K connections per sec. Connection rate is still limited by FW bottleneck due to the remaining per context FW commands (DEK create/destroy). This will soon be addressed in a followup series. By combining the two series, the FW bottleneck will be released, and a significantly higher (about 100K connections per sec) kTLS TX device-offloaded connection rate is reached. ==================== Link: https://lore.kernel.org/r/20220727094346.10540-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 8fd1e15 + 624bf09 commit 68be7b8

File tree

7 files changed

+527
-102
lines changed

7 files changed

+527
-102
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,14 @@ static inline void mlx5e_accel_cleanup_rx(struct mlx5e_priv *priv)
194194
{
195195
mlx5e_ktls_cleanup_rx(priv);
196196
}
197+
198+
static inline int mlx5e_accel_init_tx(struct mlx5e_priv *priv)
199+
{
200+
return mlx5e_ktls_init_tx(priv);
201+
}
202+
203+
static inline void mlx5e_accel_cleanup_tx(struct mlx5e_priv *priv)
204+
{
205+
mlx5e_ktls_cleanup_tx(priv);
206+
}
197207
#endif /* __MLX5E_EN_ACCEL_H__ */

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ static inline bool mlx5e_ktls_type_check(struct mlx5_core_dev *mdev,
4242
}
4343

4444
void mlx5e_ktls_build_netdev(struct mlx5e_priv *priv);
45+
int mlx5e_ktls_init_tx(struct mlx5e_priv *priv);
46+
void mlx5e_ktls_cleanup_tx(struct mlx5e_priv *priv);
4547
int mlx5e_ktls_init_rx(struct mlx5e_priv *priv);
4648
void mlx5e_ktls_cleanup_rx(struct mlx5e_priv *priv);
4749
int mlx5e_ktls_set_feature_rx(struct net_device *netdev, bool enable);
@@ -62,13 +64,16 @@ static inline bool mlx5e_is_ktls_rx(struct mlx5_core_dev *mdev)
6264
struct mlx5e_tls_sw_stats {
6365
atomic64_t tx_tls_ctx;
6466
atomic64_t tx_tls_del;
67+
atomic64_t tx_tls_pool_alloc;
68+
atomic64_t tx_tls_pool_free;
6569
atomic64_t rx_tls_ctx;
6670
atomic64_t rx_tls_del;
6771
};
6872

6973
struct mlx5e_tls {
7074
struct mlx5e_tls_sw_stats sw_stats;
7175
struct workqueue_struct *rx_wq;
76+
struct mlx5e_tls_tx_pool *tx_pool;
7277
};
7378

7479
int mlx5e_ktls_init(struct mlx5e_priv *priv);
@@ -83,6 +88,15 @@ static inline void mlx5e_ktls_build_netdev(struct mlx5e_priv *priv)
8388
{
8489
}
8590

91+
static inline int mlx5e_ktls_init_tx(struct mlx5e_priv *priv)
92+
{
93+
return 0;
94+
}
95+
96+
static inline void mlx5e_ktls_cleanup_tx(struct mlx5e_priv *priv)
97+
{
98+
}
99+
86100
static inline int mlx5e_ktls_init_rx(struct mlx5e_priv *priv)
87101
{
88102
return 0;

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_stats.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
static const struct counter_desc mlx5e_ktls_sw_stats_desc[] = {
4242
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, tx_tls_ctx) },
4343
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, tx_tls_del) },
44+
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, tx_tls_pool_alloc) },
45+
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, tx_tls_pool_free) },
4446
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, rx_tls_ctx) },
4547
{ MLX5E_DECLARE_STAT(struct mlx5e_tls_sw_stats, rx_tls_del) },
4648
};

0 commit comments

Comments
 (0)