#include <rte_pipeline.h>
#include <rte_ethdev_core.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_tm_driver.h>
#include <rte_flow_driver.h>
#include <rte_mtr_driver.h>
TAILQ_HEAD(softnic_mtr_meter_profile_list, softnic_mtr_meter_profile);
+/* MTR meter policy */
+struct softnic_mtr_meter_policy {
+ TAILQ_ENTRY(softnic_mtr_meter_policy) node;
+ uint32_t meter_policy_id;
+ enum rte_table_action_policer policer[RTE_COLORS];
+ uint32_t n_users;
+};
+
+TAILQ_HEAD(softnic_mtr_meter_policy_list, softnic_mtr_meter_policy);
+
/* MTR meter object */
struct softnic_mtr {
TAILQ_ENTRY(softnic_mtr) node;
struct mtr_internals {
struct softnic_mtr_meter_profile_list meter_profiles;
+ struct softnic_mtr_meter_policy_list meter_policies;
struct softnic_mtr_list mtrs;
};
#ifndef TM_MAX_PIPE_PROFILE
#define TM_MAX_PIPE_PROFILE 256
#endif
+
+#ifndef TM_MAX_SUBPORT_PROFILE
+#define TM_MAX_SUBPORT_PROFILE 256
+#endif
+
struct tm_params {
struct rte_sched_port_params port_params;
-
struct rte_sched_subport_params subport_params[TM_MAX_SUBPORTS];
-
+ struct rte_sched_subport_profile_params
+ subport_profile[TM_MAX_SUBPORT_PROFILE];
+ uint32_t n_subport_profiles;
+ uint32_t subport_to_profile[TM_MAX_SUBPORT_PROFILE];
struct rte_sched_pipe_params pipe_profiles[TM_MAX_PIPE_PROFILE];
uint32_t n_pipe_profiles;
uint32_t pipe_to_profile[TM_MAX_SUBPORTS * TM_MAX_PIPES_PER_SUBPORT];
#endif
/**
- * Master thead: data plane thread context
+ * Main thread: data plane thread context
*/
struct softnic_thread {
struct rte_ring *msgq_req;
softnic_mtr_meter_profile_find(struct pmd_internals *p,
uint32_t meter_profile_id);
+struct softnic_mtr_meter_policy *
+softnic_mtr_meter_policy_find(struct pmd_internals *p,
+ uint32_t meter_policy_id);
+
extern const struct rte_mtr_ops pmd_mtr_ops;
/**
const char *name,
struct softnic_table_action_profile_params *params);
-enum rte_table_action_policer
-softnic_table_action_policer(enum rte_mtr_policer_action action);
-
/**
* Pipeline
*/