test/threads: add unit test
[dpdk.git] / app / test-pmd / testpmd.h
index 096b682..31f766c 100644 (file)
@@ -166,6 +166,27 @@ enum age_action_context_type {
        ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION,
 };
 
+/** Descriptor for a template. */
+struct port_template {
+       struct port_template *next; /**< Next template in list. */
+       struct port_template *tmp; /**< Temporary linking. */
+       uint32_t id; /**< Template ID. */
+       union {
+               struct rte_flow_pattern_template *pattern_template;
+               struct rte_flow_actions_template *actions_template;
+       } template; /**< PMD opaque template object */
+};
+
+/** Descriptor for a flow table. */
+struct port_table {
+       struct port_table *next; /**< Next table in list. */
+       struct port_table *tmp; /**< Temporary linking. */
+       uint32_t id; /**< Table ID. */
+       uint32_t nb_pattern_templates; /**< Number of pattern templates. */
+       uint32_t nb_actions_templates; /**< Number of actions templates. */
+       struct rte_flow_template_table *table; /**< PMD opaque template object */
+};
+
 /** Descriptor for a single flow. */
 struct port_flow {
        struct port_flow *next; /**< Next flow in list. */
@@ -246,6 +267,9 @@ struct rte_port {
        queueid_t               queue_nb; /**< nb. of queues for flow rules */
        uint32_t                queue_sz; /**< size of a queue for flow rules */
        uint8_t                 slave_flag; /**< bonding slave port */
+       struct port_template    *pattern_templ_list; /**< Pattern templates. */
+       struct port_template    *actions_templ_list; /**< Actions templates. */
+       struct port_table       *table_list; /**< Flow tables. */
        struct port_flow        *flow_list; /**< Associated flows. */
        struct port_indirect_action *actions_list;
        /**< Associated indirect actions. */
@@ -892,6 +916,42 @@ int port_flow_configure(portid_t port_id,
                        const struct rte_flow_port_attr *port_attr,
                        uint16_t nb_queue,
                        const struct rte_flow_queue_attr *queue_attr);
+int port_flow_pattern_template_create(portid_t port_id, uint32_t id,
+                                     const struct rte_flow_pattern_template_attr *attr,
+                                     const struct rte_flow_item *pattern);
+int port_flow_pattern_template_destroy(portid_t port_id, uint32_t n,
+                                      const uint32_t *template);
+int port_flow_actions_template_create(portid_t port_id, uint32_t id,
+                                     const struct rte_flow_actions_template_attr *attr,
+                                     const struct rte_flow_action *actions,
+                                     const struct rte_flow_action *masks);
+int port_flow_actions_template_destroy(portid_t port_id, uint32_t n,
+                                      const uint32_t *template);
+int port_flow_template_table_create(portid_t port_id, uint32_t id,
+                  const struct rte_flow_template_table_attr *table_attr,
+                  uint32_t nb_pattern_templates, uint32_t *pattern_templates,
+                  uint32_t nb_actions_templates, uint32_t *actions_templates);
+int port_flow_template_table_destroy(portid_t port_id,
+                           uint32_t n, const uint32_t *table);
+int port_queue_flow_create(portid_t port_id, queueid_t queue_id,
+                          bool postpone, uint32_t table_id,
+                          uint32_t pattern_idx, uint32_t actions_idx,
+                          const struct rte_flow_item *pattern,
+                          const struct rte_flow_action *actions);
+int port_queue_flow_destroy(portid_t port_id, queueid_t queue_id,
+                           bool postpone, uint32_t n, const uint32_t *rule);
+int port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
+                       bool postpone, uint32_t id,
+                       const struct rte_flow_indir_action_conf *conf,
+                       const struct rte_flow_action *action);
+int port_queue_action_handle_destroy(portid_t port_id,
+                                    uint32_t queue_id, bool postpone,
+                                    uint32_t n, const uint32_t *action);
+int port_queue_action_handle_update(portid_t port_id, uint32_t queue_id,
+                                   bool postpone, uint32_t id,
+                                   const struct rte_flow_action *action);
+int port_queue_flow_push(portid_t port_id, queueid_t queue_id);
+int port_queue_flow_pull(portid_t port_id, queueid_t queue_id);
 int port_flow_validate(portid_t port_id,
                       const struct rte_flow_attr *attr,
                       const struct rte_flow_item *pattern,