diff options
author | Hongjun Ni <hongjun.ni@intel.com> | 2019-11-06 06:12:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-11-06 06:12:03 +0000 |
commit | 9c5b99514ec3d9ba6cf61002394de1bd1a9fbdd9 (patch) | |
tree | 37b84ad5b41d6b4315513ac0c074b7bbda7fe5b5 /src/dpi.c | |
parent | 4ec2e1124a00cd0f7841042a6d90096c77e0a72b (diff) | |
parent | cac2bd1cefb29e7cc7a6602c7a0780a8c0d2fd86 (diff) |
Merge "enable dpi hw-offload basic feature"
Diffstat (limited to 'src/dpi.c')
-rw-r--r-- | src/dpi.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -323,6 +323,7 @@ dpi_flow_add_del (dpi_add_del_flow_args_t * a, u32 * flow_idp) int add_failed; if (is_ip6) { + flow->next_index = DPI_INPUT_NEXT_IP6_LOOKUP; key6.value = (u64) flow_id; add_failed = clib_bihash_add_del_48_8 (&dm->dpi6_flow_by_key, &key6, 1 /*add */ ); @@ -530,7 +531,7 @@ dpi_add_del_rx_flow (u32 hw_if_index, u32 flow_id, int is_add, u32 is_ipv6) .actions = VNET_FLOW_ACTION_REDIRECT_TO_NODE | VNET_FLOW_ACTION_MARK, .mark_flow_id = flow_id + dm->flow_id_start, - .redirect_node_index = 0, + .redirect_node_index = dpi4_flow_input_node.index, .type = VNET_FLOW_TYPE_IP4_N_TUPLE, .ip4_n_tuple = { .src_addr = src_addr4, @@ -560,7 +561,7 @@ dpi_add_del_rx_flow (u32 hw_if_index, u32 flow_id, int is_add, u32 is_ipv6) .actions = VNET_FLOW_ACTION_REDIRECT_TO_NODE | VNET_FLOW_ACTION_MARK, .mark_flow_id = flow_id + dm->flow_id_start, - .redirect_node_index = 0, + .redirect_node_index = dpi6_flow_input_node.index, .type = VNET_FLOW_TYPE_IP6_N_TUPLE, .ip6_n_tuple = { .src_addr = src_addr6, @@ -593,6 +594,17 @@ dpi_flow_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable) sw_if_index, is_enable, 0, 0); } +void +dpi_flow_offload_mode (u32 hw_if_index, u8 is_ip6, u8 is_enable) +{ + if (is_ip6) + vnet_feature_enable_disable ("ip4-unicast", "dpi6-flow-input", + hw_if_index, is_enable, 0, 0); + else + vnet_feature_enable_disable ("ip6-unicast", "dpi4-flow-input", + hw_if_index, is_enable, 0, 0); +} + int dpi_init_hs_database (dpi_entry_t * entry) { |