compress/qat: enable compression on GEN3
[dpdk.git] / drivers / net / bnxt / tf_core / tf_tcam.h
index 68c25eb..40d010b 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.
  */
 
@@ -50,10 +50,18 @@ struct tf_tcam_alloc_parms {
         * [in] Type of the allocation
         */
        enum tf_tcam_tbl_type type;
+       /**
+        * [in] key size
+        */
+       uint16_t key_size;
+       /**
+        * [in] Priority of entry requested (definition TBD)
+        */
+       uint32_t priority;
        /**
         * [out] Idx of allocated entry or found entry (if search_enable)
         */
-       uint32_t idx;
+       uint16_t idx;
 };
 
 /**
@@ -68,10 +76,14 @@ struct tf_tcam_free_parms {
         * [in] Type of the allocation type
         */
        enum tf_tcam_tbl_type type;
+       /**
+        * [in] Type of HCAPI
+        */
+       uint16_t hcapi_type;
        /**
         * [in] Index to free
         */
-       uint32_t idx;
+       uint16_t idx;
        /**
         * [out] Reference count after free, only valid if session has been
         * created with shadow_copy.
@@ -90,21 +102,21 @@ struct tf_tcam_alloc_search_parms {
        /**
         * [in] TCAM table type
         */
-       enum tf_tcam_tbl_type tcam_tbl_type;
+       enum tf_tcam_tbl_type type;
        /**
-        * [in] Enable search for matching entry
+        * [in] Type of HCAPI
         */
-       uint8_t search_enable;
+       uint16_t hcapi_type;
        /**
-        * [in] Key data to match on (if search)
+        * [in] Key data to match on
         */
        uint8_t *key;
        /**
-        * [in] key size in bits (if search)
+        * [in] key size in bits
         */
-       uint16_t key_sz_in_bits;
+       uint16_t key_size;
        /**
-        * [in] Mask data to match on (if search)
+        * [in] Mask data to match on
         */
        uint8_t *mask;
        /**
@@ -112,16 +124,31 @@ struct tf_tcam_alloc_search_parms {
         */
        uint32_t priority;
        /**
-        * [out] If search, set if matching entry found
+        * [in] Allocate on miss.
+        */
+       uint8_t alloc;
+       /**
+        * [out] Set if matching entry found
         */
        uint8_t hit;
+       /**
+        * [out] Search result status (hit, miss, reject)
+        */
+       enum tf_search_status search_status;
        /**
         * [out] Current refcnt after allocation
         */
        uint16_t ref_cnt;
        /**
-        * [out] Idx allocated
-        *
+        * [in,out] The result data from the search is copied here
+        */
+       uint8_t *result;
+       /**
+        * [in,out] result size in bits for the result data
+        */
+       uint16_t result_size;
+       /**
+        * [out] Index found
         */
        uint16_t idx;
 };
@@ -139,17 +166,33 @@ struct tf_tcam_set_parms {
         */
        enum tf_tcam_tbl_type type;
        /**
-        * [in] Entry data
+        * [in] Type of HCAPI
         */
-       uint8_t *data;
-       /**
-        * [in] Entry size
-        */
-       uint16_t data_sz_in_bytes;
+       uint16_t hcapi_type;
        /**
         * [in] Entry index to write to
         */
        uint32_t idx;
+       /**
+        * [in] array containing key
+        */
+       uint8_t *key;
+       /**
+        * [in] array containing mask fields
+        */
+       uint8_t *mask;
+       /**
+        * [in] key size
+        */
+       uint16_t key_size;
+       /**
+        * [in] array containing result
+        */
+       uint8_t *result;
+       /**
+        * [in] result size
+        */
+       uint16_t result_size;
 };
 
 /**
@@ -165,17 +208,29 @@ struct tf_tcam_get_parms {
         */
        enum tf_tcam_tbl_type type;
        /**
-        * [out] Entry data
+        * [in] Entry index to read
         */
-       uint8_t *data;
+       uint32_t idx;
        /**
-        * [out] Entry size
+        * [out] array containing key
         */
-       uint16_t data_sz_in_bytes;
+       uint8_t *key;
        /**
-        * [in] Entry index to read
+        * [out] array containing mask fields
         */
-       uint32_t idx;
+       uint8_t *mask;
+       /**
+        * [out] key size
+        */
+       uint16_t key_size;
+       /**
+        * [out] array containing result
+        */
+       uint8_t *result;
+       /**
+        * [out] result size
+        */
+       uint16_t result_size;
 };
 
 /**