[PATCH v3 4/4] net/mlx5: clean up TODO comments
Maayan Kashani
mkashani at nvidia.com
Mon Jun 3 12:54:30 CEST 2024
review and cleanup unneeded TODO comments.
Signed-off-by: Maayan Kashani <mkashani at 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
More information about the dev
mailing list