Commit c673b677 authored by Tariq Toukan's avatar Tariq Toukan Committed by Saeed Mahameed

net/mlx5: Header file for crypto

Take crypto API out of the generic mlx5.h header into a dedicated
header.
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarJianbo Liu <jianbol@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 90e8ca0a
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "mlx5_core.h" #include "mlx5_core.h"
#include "en.h" #include "en.h"
#include "ipsec.h" #include "ipsec.h"
#include "lib/mlx5.h" #include "lib/crypto.h"
enum { enum {
MLX5_IPSEC_ASO_REMOVE_FLOW_PKT_CNT_OFFSET, MLX5_IPSEC_ASO_REMOVE_FLOW_PKT_CNT_OFFSET,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include "en.h" #include "en.h"
#include "lib/mlx5.h" #include "lib/mlx5.h"
#include "lib/crypto.h"
#include "en_accel/ktls.h" #include "en_accel/ktls.h"
#include "en_accel/ktls_utils.h" #include "en_accel/ktls_utils.h"
#include "en_accel/fs_tcp.h" #include "en_accel/fs_tcp.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "en.h" #include "en.h"
#include "lib/aso.h" #include "lib/aso.h"
#include "lib/mlx5.h" #include "lib/crypto.h"
#include "en_accel/macsec.h" #include "en_accel/macsec.h"
#include "en_accel/macsec_fs.h" #include "en_accel/macsec_fs.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Copyright (c) 2019 Mellanox Technologies. // Copyright (c) 2019 Mellanox Technologies.
#include "mlx5_core.h" #include "mlx5_core.h"
#include "lib/mlx5.h" #include "lib/crypto.h"
int mlx5_create_encryption_key(struct mlx5_core_dev *mdev, int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes, void *key, u32 sz_bytes,
......
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
#ifndef __MLX5_LIB_CRYPTO_H__
#define __MLX5_LIB_CRYPTO_H__
enum {
MLX5_ACCEL_OBJ_TLS_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_TLS,
MLX5_ACCEL_OBJ_IPSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_IPSEC,
MLX5_ACCEL_OBJ_MACSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_MACSEC,
};
int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes,
u32 key_type, u32 *p_key_id);
void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
#endif /* __MLX5_LIB_CRYPTO_H__ */
...@@ -79,18 +79,6 @@ struct mlx5_pme_stats { ...@@ -79,18 +79,6 @@ struct mlx5_pme_stats {
void mlx5_get_pme_stats(struct mlx5_core_dev *dev, struct mlx5_pme_stats *stats); void mlx5_get_pme_stats(struct mlx5_core_dev *dev, struct mlx5_pme_stats *stats);
int mlx5_notifier_call_chain(struct mlx5_events *events, unsigned int event, void *data); int mlx5_notifier_call_chain(struct mlx5_events *events, unsigned int event, void *data);
/* Crypto */
enum {
MLX5_ACCEL_OBJ_TLS_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_TLS,
MLX5_ACCEL_OBJ_IPSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_IPSEC,
MLX5_ACCEL_OBJ_MACSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_MACSEC,
};
int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes,
u32 key_type, u32 *p_key_id);
void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev) static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev)
{ {
return devlink_net(priv_to_devlink(dev)); return devlink_net(priv_to_devlink(dev));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment