From: Hamdan Igbaria <hamdani@nvidia.com>
To: <hamdani@nvidia.com>, <viacheslavo@nvidia.com>,
<thomas@monjalon.net>, <suanmingm@nvidia.com>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, Erez Shitrit <erezsh@nvidia.com>
Subject: [PATCH 3/8] net/mlx5/hws: context changes to support unified domain
Date: Sun, 16 Feb 2025 13:04:09 +0200 [thread overview]
Message-ID: <20250216110414.10926-3-hamdani@nvidia.com> (raw)
In-Reply-To: <20250216110414.10926-1-hamdani@nvidia.com>
From: Erez Shitrit <erezsh@nvidia.com>
Context creates its pools according to the table type.
Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_context.c | 21 ++++++++++++++++++++-
drivers/net/mlx5/hws/mlx5dr_context.h | 3 +++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_context.c b/drivers/net/mlx5/hws/mlx5dr_context.c
index 24741afe58..91d05f1f86 100644
--- a/drivers/net/mlx5/hws/mlx5dr_context.c
+++ b/drivers/net/mlx5/hws/mlx5dr_context.c
@@ -19,6 +19,24 @@ uint8_t mlx5dr_context_get_reparse_mode(struct mlx5dr_context *ctx)
return MLX5_IFC_RTC_REPARSE_ALWAYS;
}
+void mlx5dr_context_set_pool_tbl_attr(struct mlx5dr_pool_attr *attr,
+ enum mlx5dr_table_type table_type)
+{
+ attr->table_type = table_type;
+
+ switch (table_type) {
+ case MLX5DR_TABLE_TYPE_FDB_TX:
+ attr->opt_type = MLX5DR_POOL_OPTIMIZE_ORIG;
+ break;
+ case MLX5DR_TABLE_TYPE_FDB_RX:
+ attr->opt_type = MLX5DR_POOL_OPTIMIZE_MIRROR;
+ break;
+ default:
+ attr->opt_type = MLX5DR_POOL_OPTIMIZE_NONE;
+ break;
+ }
+}
+
static int mlx5dr_context_pools_init(struct mlx5dr_context *ctx,
struct mlx5dr_context_attr *attr)
{
@@ -41,7 +59,8 @@ static int mlx5dr_context_pools_init(struct mlx5dr_context *ctx,
pool_attr.alloc_log_sz = RTE_MAX(max_log_sz, ctx->caps->stc_alloc_log_gran);
for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) {
- pool_attr.table_type = i;
+ mlx5dr_context_set_pool_tbl_attr(&pool_attr,
+ (enum mlx5dr_table_type)i);
ctx->stc_pool[i] = mlx5dr_pool_create(ctx, &pool_attr);
if (!ctx->stc_pool[i]) {
DR_LOG(ERR, "Failed to allocate STC pool [%d]", i);
diff --git a/drivers/net/mlx5/hws/mlx5dr_context.h b/drivers/net/mlx5/hws/mlx5dr_context.h
index 7678232ecc..e89a093c77 100644
--- a/drivers/net/mlx5/hws/mlx5dr_context.h
+++ b/drivers/net/mlx5/hws/mlx5dr_context.h
@@ -72,4 +72,7 @@ bool mlx5dr_context_cap_dynamic_reparse(struct mlx5dr_context *ctx);
uint8_t mlx5dr_context_get_reparse_mode(struct mlx5dr_context *ctx);
+void mlx5dr_context_set_pool_tbl_attr(struct mlx5dr_pool_attr *attr,
+ enum mlx5dr_table_type table_type);
+
#endif /* MLX5DR_CONTEXT_H_ */
--
2.21.0
next prev parent reply other threads:[~2025-02-16 11:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 11:04 [PATCH 1/8] net/mlx5/hws: introduce capability for unified mode Hamdan Igbaria
2025-02-16 11:04 ` [PATCH 2/8] net/mlx5/hws: add new type to existing table-types Hamdan Igbaria
2025-02-16 11:04 ` Hamdan Igbaria [this message]
2025-02-16 11:04 ` [PATCH 4/8] net/mlx5/hws: allow table creation from the new types Hamdan Igbaria
2025-02-16 11:04 ` [PATCH 5/8] net/mlx5/hws: matcher changes to support unified domain Hamdan Igbaria
2025-02-16 11:04 ` [PATCH 6/8] net/mlx5/hws: action " Hamdan Igbaria
2025-02-16 11:04 ` [PATCH 7/8] net/mlx5/hws: unified rule changes Hamdan Igbaria
2025-02-16 11:04 ` [PATCH 8/8] net/mlx5/hws: support debug information for new domains Hamdan Igbaria
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250216110414.10926-3-hamdani@nvidia.com \
--to=hamdani@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=erezsh@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).