compress/qat: enable compression on GEN3
[dpdk.git] / drivers / net / bnxt / tf_core / tf_em_common.h
index 45699a7..5e55f4e 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
  * All rights reserved.
  */
 
@@ -14,8 +14,6 @@
  * Function to search for table scope control block structure
  * with specified table scope ID.
  *
- * [in] session
- *   Session to use for the search of the table scope control block
  * [in] tbl_scope_id
  *   Table scope ID to search for
  *
@@ -23,8 +21,7 @@
  *  Pointer to the found table scope control block struct or NULL if
  *   table scope control block struct not found
  */
-struct tf_tbl_scope_cb *tbl_scope_cb_find(struct tf_session *session,
-                                         uint32_t tbl_scope_id);
+struct tf_tbl_scope_cb *tbl_scope_cb_find(uint32_t tbl_scope_id);
 
 /**
  * Create and initialize a stack to use for action entries
@@ -104,4 +101,34 @@ void *tf_em_get_table_page(struct tf_tbl_scope_cb *tbl_scope_cb,
                           uint32_t offset,
                           enum hcapi_cfa_em_table_type table_type);
 
+/**
+ * Validates EM number of entries requested
+ *
+ * [in] tbl_scope_cb
+ *   Pointer to table scope control block to be populated
+ *
+ * [in] parms
+ *   Pointer to input parameters
+ *
+ * Returns:
+ *   0       - Success
+ *   -EINVAL - Parameter error
+ */
+int tf_em_validate_num_entries(struct tf_tbl_scope_cb *tbl_scope_cb,
+                              struct tf_alloc_tbl_scope_parms *parms);
+
+/**
+ * Size the EM table based on capabilities
+ *
+ * [in] tbl
+ *   EM table to size
+ *
+ * Returns:
+ *   0        - Success
+ *   - EINVAL - Parameter error
+ *   - ENOMEM - Out of memory
+ */
+int tf_em_size_table(struct hcapi_cfa_em_table *tbl,
+                    uint32_t page_size);
+
 #endif /* _TF_EM_COMMON_H_ */