net/i40e: support adding TM shaper profile
[dpdk.git] / drivers / net / i40e / i40e_ethdev.h
index 07677da..af035cb 100644 (file)
@@ -39,6 +39,7 @@
 #include <rte_kvargs.h>
 #include <rte_hash.h>
 #include <rte_flow_driver.h>
+#include <rte_tm_driver.h>
 
 #define I40E_VLAN_TAG_SIZE        4
 
@@ -651,6 +652,21 @@ struct rte_flow {
 
 TAILQ_HEAD(i40e_flow_list, rte_flow);
 
+/* Struct to store Traffic Manager shaper profile. */
+struct i40e_tm_shaper_profile {
+       TAILQ_ENTRY(i40e_tm_shaper_profile) node;
+       uint32_t shaper_profile_id;
+       uint32_t reference_count;
+       struct rte_tm_shaper_params profile;
+};
+
+TAILQ_HEAD(i40e_shaper_profile_list, i40e_tm_shaper_profile);
+
+/* Struct to store all the Traffic Manager configuration. */
+struct i40e_tm_conf {
+       struct i40e_shaper_profile_list shaper_profile_list;
+};
+
 /*
  * Structure to store private data specific for PF instance.
  */
@@ -665,11 +681,9 @@ struct i40e_pf {
 
        struct i40e_hw_port_stats stats_offset;
        struct i40e_hw_port_stats stats;
-       /* internal packet byte count, it should be excluded from the total */
-       uint64_t internal_rx_bytes;
-       uint64_t internal_tx_bytes;
-       uint64_t internal_rx_bytes_offset;
-       uint64_t internal_tx_bytes_offset;
+       /* internal packet statistics, it should be excluded from the total */
+       struct i40e_eth_stats internal_stats_offset;
+       struct i40e_eth_stats internal_stats;
        bool offset_loaded;
 
        struct rte_eth_dev_data *dev_data; /* Pointer to the device data */
@@ -716,6 +730,7 @@ struct i40e_pf {
        struct i40e_flow_list flow_list;
        bool mpls_replace_flag;  /* 1 - MPLS filter replace is done */
        bool qinq_replace_flag;  /* QINQ filter replace is done */
+       struct i40e_tm_conf tm_conf;
 };
 
 enum pending_msg {
@@ -922,6 +937,7 @@ int i40e_add_macvlan_filters(struct i40e_vsi *vsi,
                             struct i40e_macvlan_filter *filter,
                             int total);
 bool is_i40e_supported(struct rte_eth_dev *dev);
+
 int i40e_validate_input_set(enum i40e_filter_pctype pctype,
                            enum rte_filter_type filter, uint64_t inset);
 int i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask,
@@ -929,6 +945,13 @@ int i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask,
 uint64_t i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input);
 void i40e_check_write_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val);
 
+int i40e_tm_ops_get(struct rte_eth_dev *dev, void *ops);
+void i40e_tm_conf_init(struct rte_eth_dev *dev);
+void i40e_tm_conf_uninit(struct rte_eth_dev *dev);
+
+#define I40E_DEV_TO_PCI(eth_dev) \
+       RTE_DEV_TO_PCI((eth_dev)->device)
+
 /* I40E_DEV_PRIVATE_TO */
 #define I40E_DEV_PRIVATE_TO_PF(adapter) \
        (&((struct i40e_adapter *)adapter)->pf)