net/mlx5: Add new APIs for fast update encryption key
authorJianbo Liu <jianbol@nvidia.com>
Wed, 20 Jul 2022 02:36:05 +0000 (02:36 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 31 Jan 2023 03:10:05 +0000 (19:10 -0800)
commit204369e718e9f276bdc8677e8dbb648d3298735f
tree91f403a760b27378e3086f2303273938d067606d
parent942192541675b80222e98b4eb410695c5ab619a3
net/mlx5: Add new APIs for fast update encryption key

New APIs are added to support fast update DEKs. As a pool is created
for each key purpose (type), one pair of pool APIs to get/put pool.
Anotehr pair of DEKs APIs is to get DEK object from pool and update it
with user key, or free it back to the pool. As The bulk allocation
and destruction will be supported in later patches, old implementation
is used here.

To support these APIs, pool and dek structs are defined first. Only
small number of fields are stored in them. For example, key_purpose
and refcnt in pool struct, DEK object id in dek struct. More fields
will be added to these structs in later patches, for example, the
different bulk lists for pool struct, the bulk pointer dek struct
belongs to, and a list_entry for the list in a pool, which is used to
save keys waiting for being freed while other thread is doing sync.

Besides the creation and destruction interfaces, new one is also added
to get obj id.

Currently these APIs are planned to used by TLS only.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.c
drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.h