1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2023 Napatech A/S
*/
#ifndef __CREATE_ELEMENTS_H__
#define __CREATE_ELEMENTS_H__
#include "stdint.h"
#include "stream_binary_flow_api.h"
#include <rte_flow.h>
#define MAX_ELEMENTS 64
#define MAX_ACTIONS 32
struct cnv_match_s {
struct rte_flow_item rte_flow_item[MAX_ELEMENTS];
};
struct cnv_attr_s {
struct cnv_match_s match;
struct rte_flow_attr attr;
uint16_t forced_vlan_vid;
uint16_t caller_id;
};
struct cnv_action_s {
struct rte_flow_action flow_actions[MAX_ACTIONS];
struct rte_flow_action_rss flow_rss;
struct flow_action_raw_encap encap;
struct flow_action_raw_decap decap;
struct rte_flow_action_queue queue;
};
/*
* Only needed because it eases the use of statistics through NTAPI
* for faster integration into NTAPI version of driver
* Therefore, this is only a good idea when running on a temporary NTAPI
* The query() functionality must go to flow engine, when moved to Open Source driver
*/
struct rte_flow {
void *flw_hdl;
int used;
uint32_t flow_stat_id;
uint64_t stat_pkts;
uint64_t stat_bytes;
uint8_t stat_tcp_flags;
uint16_t caller_id;
};
enum nt_rte_flow_item_type {
NT_RTE_FLOW_ITEM_TYPE_END = INT_MIN,
NT_RTE_FLOW_ITEM_TYPE_TUNNEL,
};
#endif /* __CREATE_ELEMENTS_H__ */
|