diff options
author | Chenmin Sun <chenmin.sun@intel.com> | 2020-11-19 23:13:30 +0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-03-26 08:30:54 +0000 |
commit | ffe9a5489499467dfb5a2ee0fed14e397f5f825c (patch) | |
tree | 317bc75b046ebe13f27a99b6929a706140a5183a /src/plugins/avf/avf.h | |
parent | 89c98a4bff101ad4270724bde7ca6f21ba4c8482 (diff) |
avf: add avf flow framework
This patch adds the flow support to VPP avf_plugin.
Currently only IP4-N-TUPLE and GTPU flow are supported as
a reference. More flows will be added later.
Type: feature
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I563dbfacecd3eba31e8c3c7769142ea6adba54b6
Diffstat (limited to 'src/plugins/avf/avf.h')
-rw-r--r-- | src/plugins/avf/avf.h | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h index 53e1275ea62..6c09084eb8c 100644 --- a/src/plugins/avf/avf.h +++ b/src/plugins/avf/avf.h @@ -29,6 +29,9 @@ #include <vnet/interface.h> +#include <vnet/devices/devices.h> +#include <vnet/flow/flow.h> + #define AVF_QUEUE_SZ_MAX 4096 #define AVF_QUEUE_SZ_MIN 64 @@ -97,16 +100,17 @@ extern vlib_log_class_registration_t avf_log; format_vlib_pci_addr, &dev->pci_addr, \ ## __VA_ARGS__) -#define foreach_avf_device_flags \ - _(0, INITIALIZED, "initialized") \ - _(1, ERROR, "error") \ - _(2, ADMIN_UP, "admin-up") \ - _(3, VA_DMA, "vaddr-dma") \ - _(4, LINK_UP, "link-up") \ - _(5, SHARED_TXQ_LOCK, "shared-txq-lock") \ - _(6, ELOG, "elog") \ - _(7, PROMISC, "promisc") \ - _(8, RX_INT, "rx-interrupts") +#define foreach_avf_device_flags \ + _ (0, INITIALIZED, "initialized") \ + _ (1, ERROR, "error") \ + _ (2, ADMIN_UP, "admin-up") \ + _ (3, VA_DMA, "vaddr-dma") \ + _ (4, LINK_UP, "link-up") \ + _ (5, SHARED_TXQ_LOCK, "shared-txq-lock") \ + _ (6, ELOG, "elog") \ + _ (7, PROMISC, "promisc") \ + _ (8, RX_INT, "rx-interrupts") \ + _ (9, RX_FLOW_OFFLOAD, "rx-flow-offload") enum { @@ -183,6 +187,20 @@ typedef struct typedef struct { + u32 flow_index; + u32 mark; + struct avf_fdir_conf *rcfg; +} avf_flow_entry_t; + +typedef struct +{ + u32 flow_id; + u16 next_index; + i16 buffer_advance; +} avf_flow_lookup_entry_t; + +typedef struct +{ CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); u32 flags; u32 per_interface_next_index; @@ -224,6 +242,10 @@ typedef struct virtchnl_link_speed_t link_speed; vlib_pci_addr_t pci_addr; + /* flow */ + avf_flow_entry_t *flow_entries; /* pool */ + avf_flow_lookup_entry_t *flow_lookup_entries; /* pool */ + /* stats */ virtchnl_eth_stats_t eth_stats; virtchnl_eth_stats_t last_cleared_eth_stats; @@ -319,6 +341,7 @@ clib_error_t *avf_program_flow (u32 dev_instance, int is_add, u8 *rule, format_function_t format_avf_device; format_function_t format_avf_device_name; format_function_t format_avf_input_trace; +vnet_flow_dev_ops_function_t avf_flow_ops_fn; static_always_inline avf_device_t * avf_get_device (u32 dev_instance) |