xref: /dpdk/examples/ip_pipeline/action.h (revision d46fe9448caf68711e805b8fc2d05ef127fde8af)
171937434SJasvinder Singh /* SPDX-License-Identifier: BSD-3-Clause
271937434SJasvinder Singh  * Copyright(c) 2010-2018 Intel Corporation
371937434SJasvinder Singh  */
471937434SJasvinder Singh 
571937434SJasvinder Singh #ifndef _INCLUDE_ACTION_H_
671937434SJasvinder Singh #define _INCLUDE_ACTION_H_
771937434SJasvinder Singh 
871937434SJasvinder Singh #include <sys/queue.h>
971937434SJasvinder Singh 
1071937434SJasvinder Singh #include <rte_port_in_action.h>
1171937434SJasvinder Singh #include <rte_table_action.h>
1271937434SJasvinder Singh 
1371937434SJasvinder Singh #include "common.h"
1471937434SJasvinder Singh 
1571937434SJasvinder Singh /**
1671937434SJasvinder Singh  * Input port action
1771937434SJasvinder Singh  */
1871937434SJasvinder Singh struct port_in_action_profile_params {
1971937434SJasvinder Singh 	uint64_t action_mask;
2071937434SJasvinder Singh 	struct rte_port_in_action_fltr_config fltr;
2171937434SJasvinder Singh 	struct rte_port_in_action_lb_config lb;
2271937434SJasvinder Singh };
2371937434SJasvinder Singh 
2471937434SJasvinder Singh struct port_in_action_profile {
2571937434SJasvinder Singh 	TAILQ_ENTRY(port_in_action_profile) node;
2671937434SJasvinder Singh 	char name[NAME_SIZE];
2771937434SJasvinder Singh 	struct port_in_action_profile_params params;
2871937434SJasvinder Singh 	struct rte_port_in_action_profile *ap;
2971937434SJasvinder Singh };
3071937434SJasvinder Singh 
3171937434SJasvinder Singh TAILQ_HEAD(port_in_action_profile_list, port_in_action_profile);
3271937434SJasvinder Singh 
3371937434SJasvinder Singh int
3471937434SJasvinder Singh port_in_action_profile_init(void);
3571937434SJasvinder Singh 
3671937434SJasvinder Singh struct port_in_action_profile *
3771937434SJasvinder Singh port_in_action_profile_find(const char *name);
3871937434SJasvinder Singh 
3971937434SJasvinder Singh struct port_in_action_profile *
4071937434SJasvinder Singh port_in_action_profile_create(const char *name,
4171937434SJasvinder Singh 	struct port_in_action_profile_params *params);
4271937434SJasvinder Singh 
4371937434SJasvinder Singh /**
4471937434SJasvinder Singh  * Table action
4571937434SJasvinder Singh  */
4671937434SJasvinder Singh struct table_action_profile_params {
4771937434SJasvinder Singh 	uint64_t action_mask;
4871937434SJasvinder Singh 	struct rte_table_action_common_config common;
49802755dcSJasvinder Singh 	struct rte_table_action_lb_config lb;
5071937434SJasvinder Singh 	struct rte_table_action_mtr_config mtr;
5171937434SJasvinder Singh 	struct rte_table_action_tm_config tm;
5271937434SJasvinder Singh 	struct rte_table_action_encap_config encap;
5371937434SJasvinder Singh 	struct rte_table_action_nat_config nat;
5471937434SJasvinder Singh 	struct rte_table_action_ttl_config ttl;
5571937434SJasvinder Singh 	struct rte_table_action_stats_config stats;
56*d46fe944SFan Zhang 	struct rte_table_action_sym_crypto_config sym_crypto;
5771937434SJasvinder Singh };
5871937434SJasvinder Singh 
5971937434SJasvinder Singh struct table_action_profile {
6071937434SJasvinder Singh 	TAILQ_ENTRY(table_action_profile) node;
6171937434SJasvinder Singh 	char name[NAME_SIZE];
6271937434SJasvinder Singh 	struct table_action_profile_params params;
6371937434SJasvinder Singh 	struct rte_table_action_profile *ap;
6471937434SJasvinder Singh };
6571937434SJasvinder Singh 
6671937434SJasvinder Singh TAILQ_HEAD(table_action_profile_list, table_action_profile);
6771937434SJasvinder Singh 
6871937434SJasvinder Singh int
6971937434SJasvinder Singh table_action_profile_init(void);
7071937434SJasvinder Singh 
7171937434SJasvinder Singh struct table_action_profile *
7271937434SJasvinder Singh table_action_profile_find(const char *name);
7371937434SJasvinder Singh 
7471937434SJasvinder Singh struct table_action_profile *
7571937434SJasvinder Singh table_action_profile_create(const char *name,
7671937434SJasvinder Singh 	struct table_action_profile_params *params);
7771937434SJasvinder Singh 
7871937434SJasvinder Singh #endif /* _INCLUDE_ACTION_H_ */
79