eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / tf_core / tf_device.h
index ea4dcfb..9b0c037 100644 (file)
@@ -57,6 +57,9 @@ struct tf_dev_info {
  * [in] resources
  *   Pointer to resource allocation information
  *
+ * [in] wc_num_slices
+ *   Number of slices per row for WC
+ *
  * [out] dev_handle
  *   Device handle
  *
@@ -69,6 +72,7 @@ int tf_dev_bind(struct tf *tfp,
                enum tf_device_type type,
                bool shadow_copy,
                struct tf_session_resources *resources,
+               uint16_t wc_num_slices,
                struct tf_dev_info *dev_handle);
 
 /**
@@ -139,6 +143,23 @@ struct tf_dev_ops {
                                       uint16_t resource_id,
                                       const char **resource_str);
 
+       /**
+        * Set the WC TCAM slice information that the device
+        * supports.
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] num_slices_per_row
+        *   Number of slices per row the device supports
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_set_tcam_slice_info)(struct tf *tfp,
+                                         enum tf_wc_num_slice num_slices_per_row);
+
        /**
         * Retrieves the WC TCAM slice information that the device
         * supports.
@@ -241,6 +262,22 @@ struct tf_dev_ops {
        int (*tf_dev_get_ident_resc_info)(struct tf *tfp,
                                          struct tf_identifier_resource_info *parms);
 
+       /**
+        * Indicates whether the index table type is SRAM managed
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] type
+        *   Truflow index table type, e.g. TF_TYPE_FULL_ACT_RECORD
+        *
+        * Returns
+        *   - (0) if the table is not managed by the SRAM manager
+        *   - (1) if the table is managed by the SRAM manager
+        */
+       bool (*tf_dev_is_sram_managed)(struct tf *tfp,
+                                      enum tf_tbl_type tbl_type);
+
        /**
         * Get SRAM table information.
         *
@@ -289,6 +326,25 @@ struct tf_dev_ops {
        int (*tf_dev_alloc_tbl)(struct tf *tfp,
                                struct tf_tbl_alloc_parms *parms);
 
+       /**
+        * Allocation of an SRAM index table type element.
+        *
+        * This API allocates the specified table type element from a
+        * device specific table type DB. The allocated element is
+        * returned.
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to table allocation parameters
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_alloc_sram_tbl)(struct tf *tfp,
+                                    struct tf_tbl_alloc_parms *parms);
        /**
         * Allocation of a external table type element.
         *
@@ -327,9 +383,8 @@ struct tf_dev_ops {
         */
        int (*tf_dev_free_tbl)(struct tf *tfp,
                               struct tf_tbl_free_parms *parms);
-
        /**
-        * Free of a external table type element.
+        * Free of an SRAM table type element.
         *
         * This API free's a previous allocated table type element from a
         * device specific table type DB.
@@ -344,30 +399,26 @@ struct tf_dev_ops {
         *   - (0) if successful.
         *   - (-EINVAL) on failure.
         */
-       int (*tf_dev_free_ext_tbl)(struct tf *tfp,
-                                  struct tf_tbl_free_parms *parms);
-
+       int (*tf_dev_free_sram_tbl)(struct tf *tfp,
+                                   struct tf_tbl_free_parms *parms);
        /**
-        * Searches for the specified table type element in a shadow DB.
+        * Free of a external table type element.
         *
-        * This API searches for the specified table type element in a
-        * device specific shadow DB. If the element is found the
-        * reference count for the element is updated. If the element
-        * is not found a new element is allocated from the table type
-        * DB and then inserted into the shadow DB.
+        * This API free's a previous allocated table type element from a
+        * device specific table type DB.
         *
         * [in] tfp
         *   Pointer to TF handle
         *
         * [in] parms
-        *   Pointer to table allocation and search parameters
+        *   Pointer to table free parameters
         *
         * Returns
         *   - (0) if successful.
         *   - (-EINVAL) on failure.
         */
-       int (*tf_dev_alloc_search_tbl)(struct tf *tfp,
-                                      struct tf_tbl_alloc_search_parms *parms);
+       int (*tf_dev_free_ext_tbl)(struct tf *tfp,
+                                  struct tf_tbl_free_parms *parms);
 
        /**
         * Sets the specified table type element.
@@ -407,6 +458,25 @@ struct tf_dev_ops {
        int (*tf_dev_set_ext_tbl)(struct tf *tfp,
                                  struct tf_tbl_set_parms *parms);
 
+       /**
+        * Sets the specified SRAM table type element.
+        *
+        * This API sets the specified element data by invoking the
+        * firmware.
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to table set parameters
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_set_sram_tbl)(struct tf *tfp,
+                                  struct tf_tbl_set_parms *parms);
+
        /**
         * Retrieves the specified table type element.
         *
@@ -426,6 +496,25 @@ struct tf_dev_ops {
        int (*tf_dev_get_tbl)(struct tf *tfp,
                              struct tf_tbl_get_parms *parms);
 
+       /**
+        * Retrieves the specified SRAM table type element.
+        *
+        * This API retrieves the specified element data by invoking the
+        * firmware.
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to table get parameters
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_get_sram_tbl)(struct tf *tfp,
+                                  struct tf_tbl_get_parms *parms);
+
        /**
         * Retrieves the specified table type element using 'bulk'
         * mechanism.
@@ -446,6 +535,43 @@ struct tf_dev_ops {
        int (*tf_dev_get_bulk_tbl)(struct tf *tfp,
                                   struct tf_tbl_get_bulk_parms *parms);
 
+       /**
+        * Retrieves the specified SRAM table type element using 'bulk'
+        * mechanism.
+        *
+        * This API retrieves the specified element data by invoking the
+        * firmware.
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to table get bulk parameters
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_get_bulk_sram_tbl)(struct tf *tfp,
+                                       struct tf_tbl_get_bulk_parms *parms);
+
+       /**
+        * Gets the increment value to add to the shared session resource
+        * start offset by for each count in the "stride"
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to get shared tbl increment parameters
+        *
+        * Returns
+        *   - (0) if successful.
+        *   - (-EINVAL) on failure.
+        */
+       int (*tf_dev_get_shared_tbl_increment)(struct tf *tfp,
+                               struct tf_get_shared_tbl_increment_parms *parms);
+
        /**
         * Retrieves the table resource info.
         *
@@ -563,6 +689,41 @@ struct tf_dev_ops {
        int (*tf_dev_get_tcam)(struct tf *tfp,
                               struct tf_tcam_get_parms *parms);
 
+#ifdef TF_TCAM_SHARED
+       /**
+        * Move TCAM shared entries
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to parameters
+        *
+        *    returns:
+        *    0       - Success
+        *    -EINVAL - Error
+        */
+       int (*tf_dev_move_tcam)(struct tf *tfp,
+                              struct tf_move_tcam_shared_entries_parms *parms);
+
+       /**
+        * Move TCAM shared entries
+        *
+        * [in] tfp
+        *   Pointer to TF handle
+        *
+        * [in] parms
+        *   Pointer to parameters
+        *
+        *    returns:
+        *    0       - Success
+        *    -EINVAL - Error
+        */
+       int (*tf_dev_clear_tcam)(struct tf *tfp,
+                             struct tf_clear_tcam_shared_entries_parms *parms);
+
+#endif /* TF_TCAM_SHARED */
+
        /**
         * Retrieves the tcam resource info.
         *