-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: DR, Add modify-header-pattern ICM pool
There is a new ICM area for that memory, so we need to handle it as we did for the others ICM types. The patch added that specific pool with its requirements and management. Signed-off-by: Muhammad Sammar <muhammads@nvidia.com> Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Reviewed-by: Alex Vesker <valex@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
- Loading branch information
Yevgeny Kliteynik
authored and
Saeed Mahameed
committed
Apr 12, 2023
1 parent
1e5cc73
commit 108ff82
Showing
6 changed files
with
132 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ptrn.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB | ||
// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
|
||
#include "dr_types.h" | ||
|
||
struct mlx5dr_ptrn_mgr { | ||
struct mlx5dr_domain *dmn; | ||
struct mlx5dr_icm_pool *ptrn_icm_pool; | ||
}; | ||
|
||
struct mlx5dr_ptrn_mgr *mlx5dr_ptrn_mgr_create(struct mlx5dr_domain *dmn) | ||
{ | ||
struct mlx5dr_ptrn_mgr *mgr; | ||
|
||
if (!mlx5dr_domain_is_support_ptrn_arg(dmn)) | ||
return NULL; | ||
|
||
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); | ||
if (!mgr) | ||
return NULL; | ||
|
||
mgr->dmn = dmn; | ||
mgr->ptrn_icm_pool = mlx5dr_icm_pool_create(dmn, DR_ICM_TYPE_MODIFY_HDR_PTRN); | ||
if (!mgr->ptrn_icm_pool) { | ||
mlx5dr_err(dmn, "Couldn't get modify-header-pattern memory\n"); | ||
goto free_mgr; | ||
} | ||
|
||
return mgr; | ||
|
||
free_mgr: | ||
kfree(mgr); | ||
return NULL; | ||
} | ||
|
||
void mlx5dr_ptrn_mgr_destroy(struct mlx5dr_ptrn_mgr *mgr) | ||
{ | ||
if (!mgr) | ||
return; | ||
|
||
mlx5dr_icm_pool_destroy(mgr->ptrn_icm_pool); | ||
kfree(mgr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters