eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / tf_core / tf_tcam.h
index 5090dfd..b1e7a92 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.
  */
 
@@ -12,6 +12,9 @@
  * The TCAM module provides processing of Internal TCAM types.
  */
 
+/* Number of slices per row for WC TCAM */
+extern uint16_t g_wc_num_slices_per_row;
+
 /**
  * TCAM configuration parameters
  */
@@ -36,6 +39,10 @@ struct tf_tcam_cfg_parms {
         * Session resource allocations
         */
        struct tf_session_resources *resources;
+       /**
+        * WC number of slices per row.
+        */
+       enum tf_wc_num_slice wc_num_slices;
 };
 
 /**
@@ -76,6 +83,10 @@ 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
         */
@@ -100,19 +111,19 @@ struct tf_tcam_alloc_search_parms {
         */
        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 (if search)
+        * [in] key size in bits
         */
        uint16_t key_size;
        /**
-        * [in] Mask data to match on (if search)
+        * [in] Mask data to match on
         */
        uint8_t *mask;
        /**
@@ -120,16 +131,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;
 };
@@ -188,6 +214,10 @@ struct tf_tcam_get_parms {
         * [in] Type of object to get
         */
        enum tf_tcam_tbl_type type;
+       /**
+        * [in] Type of HCAPI
+        */
+       uint16_t hcapi_type;
        /**
         * [in] Entry index to read
         */
@@ -214,6 +244,16 @@ struct tf_tcam_get_parms {
        uint16_t result_size;
 };
 
+/**
+ * TCAM database
+ *
+ * Tcam rm database
+ *
+ */
+struct tcam_rm_db {
+       struct rm_db *tcam_db[TF_DIR_MAX];
+};
+
 /**
  * @page tcam TCAM
  *
@@ -353,4 +393,20 @@ int tf_tcam_set(struct tf *tfp,
 int tf_tcam_get(struct tf *tfp,
                struct tf_tcam_get_parms *parms);
 
+/**
+ * Retrieves the allocated resource info
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_tcam_get_resc_info(struct tf *tfp,
+                         struct tf_tcam_resource_info *parms);
+
 #endif /* _TF_TCAM_H */