net/bnxt: add ULP flow counter manager
[dpdk.git] / drivers / net / bnxt / tf_ulp / bnxt_ulp.h
index eecc09c..a133284 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "rte_ethdev.h"
 
+#include "ulp_template_db_enum.h"
+
 struct bnxt_ulp_data {
        uint32_t                        tbl_scope_id;
        struct bnxt_ulp_mark_tbl        *mark_tbl;
@@ -20,6 +22,10 @@ struct bnxt_ulp_data {
        struct bnxt_ulp_flow_db         *flow_db;
        void                            *mapper_data;
        struct bnxt_ulp_port_db         *port_db;
+       struct bnxt_ulp_fc_info         *fc_info;
+       uint32_t                        port_to_app_flow_id;
+       uint32_t                        app_to_port_flow_id;
+       uint32_t                        tx_cfa_action;
 };
 
 struct bnxt_ulp_context {
@@ -49,6 +55,12 @@ struct rte_tf_flow {
        uint32_t        flow_id;
 };
 
+struct ulp_tlv_param {
+       enum bnxt_ulp_df_param_type type;
+       uint32_t length;
+       uint8_t value[16];
+};
+
 /*
  * Allow the deletion of context only for the bnxt device that
  * created the session
@@ -127,4 +139,27 @@ bnxt_ulp_cntxt_ptr2_port_db_set(struct bnxt_ulp_context    *ulp_ctx,
 struct bnxt_ulp_port_db *
 bnxt_ulp_cntxt_ptr2_port_db_get(struct bnxt_ulp_context        *ulp_ctx);
 
+/* Function to create default flows. */
+int32_t
+ulp_default_flow_create(struct rte_eth_dev *eth_dev,
+                       struct ulp_tlv_param *param_list,
+                       uint32_t ulp_class_tid,
+                       uint32_t *flow_id);
+
+/* Function to destroy default flows. */
+int32_t
+ulp_default_flow_destroy(struct rte_eth_dev *eth_dev,
+                        uint32_t flow_id);
+
+int
+bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
+                     struct rte_flow_error *error);
+
+int32_t
+bnxt_ulp_cntxt_ptr2_fc_info_set(struct bnxt_ulp_context *ulp_ctx,
+                               struct bnxt_ulp_fc_info *ulp_fc_info);
+
+struct bnxt_ulp_fc_info *
+bnxt_ulp_cntxt_ptr2_fc_info_get(struct bnxt_ulp_context *ulp_ctx);
+
 #endif /* _BNXT_ULP_H_ */