[v5,72/80] net/ntnic: add flow action update

Message ID 20241030213940.3470062-73-sil-plv@napatech.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Provide flow filter and statistics support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Serhii Iliushyk Oct. 30, 2024, 9:39 p.m. UTC
From: Danylo Vodopianov <dvo-plv@napatech.com>

flow_filter_ops was extended with flow action update API.

Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
---
 drivers/net/ntnic/nthw/flow_api/flow_api.c       | 16 ++++++++++++++++
 .../profile_inline/flow_api_profile_inline.h     |  5 +++++
 2 files changed, 21 insertions(+)
  

Patch

diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c
index 76492902ad..1fcccd37fd 100644
--- a/drivers/net/ntnic/nthw/flow_api/flow_api.c
+++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c
@@ -264,6 +264,21 @@  static int flow_flush(struct flow_eth_dev *dev, uint16_t caller_id, struct rte_f
 	return profile_inline_ops->flow_flush_profile_inline(dev, caller_id, error);
 }
 
+static int flow_actions_update(struct flow_eth_dev *dev,
+	struct flow_handle *flow,
+	const struct rte_flow_action action[],
+	struct rte_flow_error *error)
+{
+	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+
+	if (profile_inline_ops == NULL) {
+		NT_LOG_DBGX(ERR, FILTER, "profile_inline module uninitialized");
+		return -1;
+	}
+
+	return profile_inline_ops->flow_actions_update_profile_inline(dev, flow, action, error);
+}
+
 /*
  * Device Management API
  */
@@ -1093,6 +1108,7 @@  static const struct flow_filter_ops ops = {
 	.flow_create = flow_create,
 	.flow_destroy = flow_destroy,
 	.flow_flush = flow_flush,
+	.flow_actions_update = flow_actions_update,
 	.flow_dev_dump = flow_dev_dump,
 	.flow_get_flm_stats = flow_get_flm_stats,
 	.flow_get_aged_flows = flow_get_aged_flows,
diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h
index ea1d9c31b2..8a03be1ab7 100644
--- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h
+++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h
@@ -42,6 +42,11 @@  int flow_flush_profile_inline(struct flow_eth_dev *dev,
 	uint16_t caller_id,
 	struct rte_flow_error *error);
 
+int flow_actions_update_profile_inline(struct flow_eth_dev *dev,
+	struct flow_handle *flow,
+	const struct rte_flow_action action[],
+	struct rte_flow_error *error);
+
 int flow_dev_dump_profile_inline(struct flow_eth_dev *dev,
 	struct flow_handle *flow,
 	uint16_t caller_id,