Data Accelerator Offload
Loading...
Searching...
No Matches
dao_flow.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: Marvell-MIT
2 * Copyright (c) 2024 Marvell.
3 */
4
5#ifndef __DAO_FLOW_OFFLOAD_H__
6#define __DAO_FLOW_OFFLOAD_H__
7
14#include <rte_flow.h>
15
16#include "dao_util.h"
17
19#define DAO_FLOW_PROFILE_NAME_MAX 60
20
24 uint32_t reset : 1;
26 uint32_t hits_set : 1;
28 uint32_t bytes_set : 1;
30 uint32_t reserved : 29;
32 uint64_t hits;
34 uint64_t bytes;
36 uint64_t rule_hits;
37};
38
42 uint32_t dao_flow;
43 /* Number of HW offload flows per port */
44 uint32_t hw_offload_flow;
46 uint32_t rule_per_port;
47};
48
52#define DAO_FLOW_HW_OFFLOAD_ENABLE DAO_BIT(0)
53 uint32_t feature;
54#define DAO_FLOW_ALG_EM DAO_BIT(0)
55#define DAO_FLOW_ALG_ACL DAO_BIT(1)
56#define DAO_FLOW_ALG_CPT_EM DAO_BIT(2)
57 uint32_t alg;
58#define DAO_FLOW_KEX_DEFAULT DAO_BIT(0)
59#define DAO_FLOW_KEX_OVS DAO_BIT(1)
60#define DAO_FLOW_KEX_CPT_EM DAO_BIT(2)
61 uint32_t kex_profile;
65 uint32_t aging_tmo_sec;
67 uint8_t cpt_egrp;
70};
71
73struct dao_flow {
75 void *rule_data;
77 struct hw_offload_flow *hflow;
79 uint16_t port_id;
81 uint16_t tbl_id;
82 bool is_hw_offloaded;
83};
84
98int dao_flow_init(uint16_t port_id, struct dao_flow_offload_config *config);
99
108int dao_flow_fini(uint16_t port_id);
109
126struct dao_flow *dao_flow_create(uint16_t port_id, const struct rte_flow_attr *attr,
127 const struct rte_flow_item pattern[],
128 const struct rte_flow_action actions[],
129 struct rte_flow_error *error);
130
147struct dao_flow *dao_flow_hw_install(uint16_t port_id, const struct rte_flow_attr *attr,
148 const struct rte_flow_item pattern[],
149 const struct rte_flow_action actions[],
150 struct rte_flow_error *error);
151
165int dao_flow_destroy(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error);
166
181int dao_flow_hw_uninstall(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error);
182
200int dao_flow_lookup(uint16_t port_id, struct rte_mbuf **objs, uint16_t nb_objs);
201
223int dao_flow_query(uint16_t port_id, struct dao_flow *flow, const struct rte_flow_action *action,
224 void *data, struct rte_flow_error *error);
225
241int dao_flow_dev_dump(uint16_t port_id, struct dao_flow *flow, FILE *file,
242 struct rte_flow_error *error);
243
259int dao_flow_flush(uint16_t port_id, struct rte_flow_error *error);
260
276int dao_flow_info(uint16_t port_id, FILE *file, struct rte_flow_error *error);
277
293int dao_flow_count(uint16_t port_id, struct dao_flow_count *count, struct rte_flow_error *error);
294
309
310#endif /* __DAO_FLOW_OFFLOAD_H__ */
#define DAO_FLOW_PROFILE_NAME_MAX
Definition dao_flow.h:19
int dao_flow_info(uint16_t port_id, FILE *file, struct rte_flow_error *error)
int dao_flow_fini(uint16_t port_id)
int dao_flow_dev_dump(uint16_t port_id, struct dao_flow *flow, FILE *file, struct rte_flow_error *error)
int dao_flow_init(uint16_t port_id, struct dao_flow_offload_config *config)
struct dao_flow * dao_flow_hw_install(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
int dao_flow_destroy(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error)
struct dao_flow * dao_flow_create(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
int dao_flow_flush(uint16_t port_id, struct rte_flow_error *error)
int dao_flow_lookup(uint16_t port_id, struct rte_mbuf **objs, uint16_t nb_objs)
int dao_flow_hw_uninstall(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error)
int dao_flow_ctx_cache_warm(uint16_t port_id)
int dao_flow_query(uint16_t port_id, struct dao_flow *flow, const struct rte_flow_action *action, void *data, struct rte_flow_error *error)
uint32_t dao_flow
Definition dao_flow.h:42
uint32_t rule_per_port
Definition dao_flow.h:46
char parse_profile[DAO_FLOW_PROFILE_NAME_MAX]
Definition dao_flow.h:63
uint16_t port_id
Definition dao_flow.h:79
uint16_t tbl_id
Definition dao_flow.h:81
struct hw_offload_flow * hflow
Definition dao_flow.h:77
void * rule_data
Definition dao_flow.h:75