flow: support generic flow and RSS action in vapi
[vpp.git] / src / vnet / flow / flow_types.api
index 86f7ce1..1696001 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-option version = "0.0.3";
+option version = "0.0.4";
 import "vnet/ethernet/ethernet_types.api";
 import "vnet/ip/ip_types.api";
 
@@ -36,6 +36,25 @@ enum flow_type
   FLOW_TYPE_IP4_GTPU,
 };
 
+enum flow_type_v2
+{
+  FLOW_TYPE_ETHERNET_V2 = 1,
+  FLOW_TYPE_IP4_V2,
+  FLOW_TYPE_IP6_V2,
+  FLOW_TYPE_IP4_L2TPV3OIP_V2,
+  FLOW_TYPE_IP4_IPSEC_ESP_V2,
+  FLOW_TYPE_IP4_IPSEC_AH_V2,
+  FLOW_TYPE_IP4_N_TUPLE_V2,
+  FLOW_TYPE_IP6_N_TUPLE_V2,
+  FLOW_TYPE_IP4_N_TUPLE_TAGGED_V2,
+  FLOW_TYPE_IP6_N_TUPLE_TAGGED_V2,
+  FLOW_TYPE_IP4_VXLAN_V2,
+  FLOW_TYPE_IP6_VXLAN_V2,
+  FLOW_TYPE_IP4_GTPC_V2,
+  FLOW_TYPE_IP4_GTPU_V2,
+  FLOW_TYPE_GENERIC_V2,
+};
+
 enum flow_action
 {
   FLOW_ACTION_COUNT = 1,
@@ -46,6 +65,31 @@ enum flow_action
   FLOW_ACTION_DROP = 64,
 };
 
+enum flow_action_v2
+{
+  FLOW_ACTION_COUNT_V2 = 1,
+  FLOW_ACTION_MARK_V2 = 2,
+  FLOW_ACTION_BUFFER_ADVANCE_V2 = 4,
+  FLOW_ACTION_REDIRECT_TO_NODE_V2 = 8,
+  FLOW_ACTION_REDIRECT_TO_QUEUE_V2 = 16,
+  FLOW_ACTION_RSS_V2 = 32,
+  FLOW_ACTION_DROP_V2 = 64,
+};
+
+enum rss_function
+{
+  RSS_FUNC_DEFAULT,
+  RSS_FUNC_TOEPLITZ,
+  RSS_FUNC_SIMPLE_XOR,
+  RSS_FUNC_SYMMETRIC_TOEPLITZ,
+};
+
+typedef generic_pattern
+{
+  u8 spec[1024];
+  u8 mask[1024];
+};
+
 typedef ip_port_and_mask
 {
   u16 port;
@@ -193,6 +237,12 @@ typedef flow_ip4_gtpu
   u32 teid;
 };
 
+typedef flow_generic
+{
+  i32 foo;
+  vl_api_generic_pattern_t pattern;
+};
+
 union flow
 {
   vl_api_flow_ethernet_t ethernet;
@@ -211,6 +261,25 @@ union flow
   vl_api_flow_ip4_gtpu_t ip4_gtpu;
 };
 
+union flow_v2
+{
+  vl_api_flow_ethernet_t ethernet;
+  vl_api_flow_ip4_t ip4;
+  vl_api_flow_ip6_t ip6;
+  vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip;
+  vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp;
+  vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah;
+  vl_api_flow_ip4_n_tuple_t ip4_n_tuple;
+  vl_api_flow_ip6_n_tuple_t ip6_n_tuple;
+  vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged;
+  vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged;
+  vl_api_flow_ip4_vxlan_t ip4_vxlan;
+  vl_api_flow_ip6_vxlan_t ip6_vxlan;
+  vl_api_flow_ip4_gtpc_t ip4_gtpc;
+  vl_api_flow_ip4_gtpu_t ip4_gtpu;
+  vl_api_flow_generic_t generic;
+};
+
 /* main flow struct */
 typedef flow_rule
 {
@@ -240,3 +309,41 @@ typedef flow_rule
   vl_api_flow_t flow;
 };
 
+/* main flow struct */
+typedef flow_rule_v2
+{
+  /* flow type */
+  vl_api_flow_type_v2_t type;
+
+  /* flow index */
+  u32 index;
+
+  /* bitmap of flow actions (FLOW_ACTION_*) */
+  vl_api_flow_action_v2_t actions;
+
+  /* flow id for VNET_FLOW_ACTION_MARK */
+  u32 mark_flow_id;
+
+  /* node index and next index for FLOW_ACTION_REDIRECT_TO_NODE */
+  u32 redirect_node_index;
+  u32 redirect_device_input_next_index;
+
+  /* queue for FLOW_ACTION_REDIRECT_TO_QUEUE */
+  u32 redirect_queue;
+
+  /* start queue index and queue numbers for RSS queue group with FLOW_ACTION_RSS */
+  u32 queue_index;
+  u32 queue_num;
+
+  /* buffer offset for FLOW_ACTION_BUFFER_ADVANCE */
+  i32 buffer_advance;
+
+  /* RSS types, including IPv4/IPv6/TCP/UDP... */
+  u64 rss_types;
+
+  /* RSS functions, including IPv4/IPv6/TCP/UDP... */
+  vl_api_rss_function_t rss_fun;
+
+  /* flow enum */
+  vl_api_flow_v2_t flow;
+};