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 uint32_t alg;
57#define DAO_FLOW_KEX_DEFAULT DAO_BIT(0)
58#define DAO_FLOW_KEX_OVS DAO_BIT(1)
59 uint32_t kex_profile;
63 uint32_t aging_tmo_sec;
64};
65
67struct dao_flow {
69 void *rule_data;
71 struct hw_offload_flow *hflow;
73 uint16_t port_id;
75 uint16_t tbl_id;
76 bool is_hw_offloaded;
77};
78
92int dao_flow_init(uint16_t port_id, struct dao_flow_offload_config *config);
93
102int dao_flow_fini(uint16_t port_id);
103
120struct dao_flow *dao_flow_create(uint16_t port_id, const struct rte_flow_attr *attr,
121 const struct rte_flow_item pattern[],
122 const struct rte_flow_action actions[],
123 struct rte_flow_error *error);
124
141struct dao_flow *dao_flow_hw_install(uint16_t port_id, const struct rte_flow_attr *attr,
142 const struct rte_flow_item pattern[],
143 const struct rte_flow_action actions[],
144 struct rte_flow_error *error);
145
159int dao_flow_destroy(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error);
160
175int dao_flow_hw_uninstall(uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error);
176
194int dao_flow_lookup(uint16_t port_id, struct rte_mbuf **objs, uint16_t nb_objs);
195
217int dao_flow_query(uint16_t port_id, struct dao_flow *flow, const struct rte_flow_action *action,
218 void *data, struct rte_flow_error *error);
219
235int dao_flow_dev_dump(uint16_t port_id, struct dao_flow *flow, FILE *file,
236 struct rte_flow_error *error);
237
253int dao_flow_flush(uint16_t port_id, struct rte_flow_error *error);
254
270int dao_flow_info(uint16_t port_id, FILE *file, struct rte_flow_error *error);
271
287int dao_flow_count(uint16_t port_id, struct dao_flow_count *count, struct rte_flow_error *error);
288#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_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:61
uint16_t port_id
Definition dao_flow.h:73
uint16_t tbl_id
Definition dao_flow.h:75
struct hw_offload_flow * hflow
Definition dao_flow.h:71
void * rule_data
Definition dao_flow.h:69