[v2,11/11] net/nfp: support QUEUE flow action

Message ID 20231205025457.1067372-12-chaoyong.he@corigine.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series Add basic flow support for corenic firmware |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing warning Testing issues

Commit Message

Chaoyong He Dec. 5, 2023, 2:54 a.m. UTC
  Add the corresponding logics to support the offload of QUEUE action.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 doc/guides/nics/features/nfp.ini |  1 +
 drivers/net/nfp/nfp_net_flow.c   | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
  

Patch

diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini
index 248fd34a39..df1d403c6e 100644
--- a/doc/guides/nics/features/nfp.ini
+++ b/doc/guides/nics/features/nfp.ini
@@ -54,6 +54,7 @@  of_pop_vlan          = Y
 of_push_vlan         = Y
 of_set_vlan_pcp      = Y
 of_set_vlan_vid      = Y
+queue                = Y
 raw_decap            = Y
 raw_encap            = Y
 represented_port     = Y
diff --git a/drivers/net/nfp/nfp_net_flow.c b/drivers/net/nfp/nfp_net_flow.c
index 71f126156e..98e8499756 100644
--- a/drivers/net/nfp/nfp_net_flow.c
+++ b/drivers/net/nfp/nfp_net_flow.c
@@ -562,6 +562,20 @@  nfp_net_flow_action_mark(struct rte_flow *nfp_flow,
 	action_data->mark_id = mark->id;
 }
 
+static void
+nfp_net_flow_action_queue(struct rte_flow *nfp_flow,
+		const struct rte_flow_action *action)
+{
+	struct nfp_net_cmsg_action *action_data;
+	const struct rte_flow_action_queue *queue;
+
+	action_data = (struct nfp_net_cmsg_action *)nfp_flow->payload.action_data;
+	queue = action->conf;
+
+	action_data->action |= NFP_NET_CMSG_ACTION_QUEUE;
+	action_data->queue = queue->index;
+}
+
 static int
 nfp_net_flow_compile_actions(const struct rte_flow_action actions[],
 		struct rte_flow *nfp_flow)
@@ -578,6 +592,10 @@  nfp_net_flow_compile_actions(const struct rte_flow_action actions[],
 			PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_MARK");
 			nfp_net_flow_action_mark(nfp_flow, action);
 			break;
+		case RTE_FLOW_ACTION_TYPE_QUEUE:
+			PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_QUEUE");
+			nfp_net_flow_action_queue(nfp_flow, action);
+			break;
 		default:
 			PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type);
 			return -ENOTSUP;