From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <dsosnowski@nvidia.com>,
<rasland@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Subject: [PATCH v2 25/34] net/mlx5: clean up TODO comments
Date: Mon, 3 Jun 2024 11:16:39 +0300 [thread overview]
Message-ID: <20240603081640.3609-4-mkashani@nvidia.com> (raw)
In-Reply-To: <20240603081640.3609-1-mkashani@nvidia.com>
review and cleanup unneeded TODO comments.
Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 32 +++++++++-----------------------
1 file changed, 9 insertions(+), 23 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 61b6a71bbf..d9e43c25c3 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -12390,7 +12390,6 @@ static int flow_hw_prepare(struct rte_eth_dev *dev,
return rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"cannot allocate flow aux memory");
- /*TODO: consider if other allocation is needed for actions translate. */
return 0;
}
@@ -12633,9 +12632,8 @@ flow_hw_translate_flow_actions(struct rte_eth_dev *dev,
table_type = MLX5DR_TABLE_TYPE_NIC_TX;
else
table_type = MLX5DR_TABLE_TYPE_NIC_RX;
- /* TODO: consider add flag if using only non template mode to reduce table struct size. */
+ /* TODO: consider to reuse the workspace per thread. */
table = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*table), 0, SOCKET_ID_ANY);
- /* TODO: consider sending only relevant fields to construct. */
if (!table)
return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
actions, "Failed to allocate dummy table");
@@ -12833,9 +12831,7 @@ flow_hw_allocate_actions(struct rte_eth_dev *dev,
NULL, "fail to allocate actions");
}
-/* TODO: remove dev if not used */
-static int flow_hw_apply(struct rte_eth_dev *dev __rte_unused,
- const struct rte_flow_item items[],
+static int flow_hw_apply(const struct rte_flow_item items[],
struct mlx5dr_rule_action rule_actions[],
struct rte_flow_hw *flow,
struct rte_flow_error *error)
@@ -12901,16 +12897,7 @@ flow_hw_create_flow(struct rte_eth_dev *dev, enum mlx5_flow_type type,
.group = attr->group,
.priority = attr->priority,
.rss_level = 0,
- /*
- * TODO: currently only mlx5_flow_lacp_miss rule is relevant:
- * action type=(enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_DEFAULT_MISS.
- * I don't want to waist time going over all actions for this corner case.
- * Needs to use another preparation code to update this action flags.
- * if (action_type == (enum rte_flow_action_type)
- * MLX5_RTE_FLOW_ACTION_TYPE_DEFAULT_MISS)
- * act_flags |= MLX5_FLOW_ACTION_DEFAULT_MISS;
- */
- .act_flags = 0, /*TODO update*/
+ .act_flags = action_flags,
.tbl_type = 0,
};
@@ -12958,11 +12945,6 @@ flow_hw_create_flow(struct rte_eth_dev *dev, enum mlx5_flow_type type,
if (ret)
goto error;
- /*
- * TODO: check regarding release: CT index is not saved per rule,
- * the index is in the conf of given action.
- */
-
/*
* If the flow is external (from application) OR device is started,
* OR mreg discover, then apply immediately.
@@ -12970,7 +12952,7 @@ flow_hw_create_flow(struct rte_eth_dev *dev, enum mlx5_flow_type type,
if (external || dev->data->dev_started ||
(attr->group == MLX5_FLOW_MREG_CP_TABLE_GROUP &&
attr->priority == MLX5_FLOW_LOWEST_PRIO_INDICATOR)) {
- ret = flow_hw_apply(dev, items, hw_act.rule_acts, *flow, error);
+ ret = flow_hw_apply(items, hw_act.rule_acts, *flow, error);
if (ret)
goto error;
}
@@ -13012,7 +12994,7 @@ flow_hw_destroy(struct rte_eth_dev *dev, struct rte_flow_hw *flow)
DRV_LOG(ERR, "bwc rule destroy failed");
}
flow->operation_type = MLX5_FLOW_HW_FLOW_OP_TYPE_DESTROY;
- /* TODO: notice this function does not handle shared/static actions. */
+ /* Notice this function does not handle shared/static actions. */
hw_cmpl_flow_update_or_destroy(dev, flow, 0, NULL);
/**
@@ -13108,6 +13090,10 @@ static uintptr_t flow_hw_list_create(struct rte_eth_dev *dev,
uint64_t item_flags = flow_hw_matching_item_flags_get(items);
uint64_t action_flags = flow_hw_action_flags_get(actions, error);
+ /*
+ * TODO: add a call to flow_hw_validate function once it exist.
+ * and update mlx5_flow_hw_drv_ops accordingly.
+ */
if (action_flags & MLX5_FLOW_ACTION_RSS) {
const struct rte_flow_action_rss
--
2.25.1
next prev parent reply other threads:[~2024-06-03 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-02 10:29 [PATCH 1/4] net/mlx5: reorganize main structures Maayan Kashani
2024-06-03 8:16 ` [PATCH v2 22/34] " Maayan Kashani
2024-06-03 8:16 ` [PATCH v2 23/34] net/mlx5: set modify header as shared action Maayan Kashani
2024-06-03 8:16 ` [PATCH v2 24/34] net/mlx5: set encap " Maayan Kashani
2024-06-03 8:16 ` Maayan Kashani [this message]
2024-06-03 10:54 ` [PATCH v3 1/4] net/mlx5: reorganize main structures Maayan Kashani
2024-06-03 10:54 ` [PATCH v3 2/4] net/mlx5: set modify header as shared action Maayan Kashani
2024-06-03 10:54 ` [PATCH v3 3/4] net/mlx5: set encap " Maayan Kashani
2024-06-03 10:54 ` [PATCH v3 4/4] net/mlx5: clean up TODO comments Maayan Kashani
2024-06-06 10:06 ` [PATCH v4 0/4] non template pmd code changes Maayan Kashani
2024-06-06 10:06 ` [PATCH v4 1/4] net/mlx5: reorganize main structures Maayan Kashani
2024-06-06 10:06 ` [PATCH v4 2/4] net/mlx5: set modify header as shared action Maayan Kashani
2024-06-06 10:06 ` [PATCH v4 3/4] net/mlx5: set encap " Maayan Kashani
2024-06-06 10:06 ` [PATCH v4 4/4] net/mlx5: clean up TODO comments Maayan Kashani
2024-06-11 11:16 ` [PATCH v4 0/4] non template pmd code changes Raslan Darawsheh
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=20240603081640.3609-4-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=suanmingm@nvidia.com \
--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).