net/bnxt: update TruFlow core index table
[dpdk.git] / drivers / net / bnxt / tf_core / tf_device_p4.c
index 8797afa..2e7ccec 100644 (file)
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -137,7 +140,8 @@ tf_dev_p4_get_tcam_slice_info(struct tf *tfp __rte_unused,
                              uint16_t key_sz,
                              uint16_t *num_slices_per_row)
 {
-#define CFA_P4_WC_TCAM_SLICES_PER_ROW 2
+/* Single slice support */
+#define CFA_P4_WC_TCAM_SLICES_PER_ROW 1
 #define CFA_P4_WC_TCAM_SLICE_SIZE     12
 
        if (type == TF_TCAM_TBL_TYPE_WC_TCAM) {
@@ -186,6 +190,26 @@ tf_dev_p4_map_parif(struct tf *tfp __rte_unused,
        return 0;
 }
 
+/**
+ * Device specific function that retrieves the increment
+ * required for certain table types in a shared session
+ *
+ * [in] tfp
+ *  tf handle
+ *
+ * [in/out] parms
+ *   pointer to parms structure
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+static int tf_dev_p4_get_shared_tbl_increment(struct tf *tfp __rte_unused,
+                               struct tf_get_shared_tbl_increment_parms *parms)
+{
+       parms->increment_cnt = 1;
+       return 0;
+}
 static int tf_dev_p4_get_mailbox(void)
 {
        return TF_KONG_MB;
@@ -206,25 +230,29 @@ const struct tf_dev_ops tf_dev_ops_p4_init = {
        .tf_dev_alloc_ident = NULL,
        .tf_dev_free_ident = NULL,
        .tf_dev_search_ident = NULL,
+       .tf_dev_get_ident_resc_info = NULL,
        .tf_dev_get_tbl_info = NULL,
        .tf_dev_alloc_ext_tbl = NULL,
        .tf_dev_alloc_tbl = NULL,
        .tf_dev_free_ext_tbl = NULL,
        .tf_dev_free_tbl = NULL,
-       .tf_dev_alloc_search_tbl = NULL,
        .tf_dev_set_tbl = NULL,
        .tf_dev_set_ext_tbl = NULL,
        .tf_dev_get_tbl = NULL,
        .tf_dev_get_bulk_tbl = NULL,
+       .tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,
+       .tf_dev_get_tbl_resc_info = NULL,
        .tf_dev_alloc_tcam = NULL,
        .tf_dev_free_tcam = NULL,
        .tf_dev_alloc_search_tcam = NULL,
        .tf_dev_set_tcam = NULL,
        .tf_dev_get_tcam = NULL,
+       .tf_dev_get_tcam_resc_info = NULL,
        .tf_dev_insert_int_em_entry = NULL,
        .tf_dev_delete_int_em_entry = NULL,
        .tf_dev_insert_ext_em_entry = NULL,
        .tf_dev_delete_ext_em_entry = NULL,
+       .tf_dev_get_em_resc_info = NULL,
        .tf_dev_alloc_tbl_scope = NULL,
        .tf_dev_map_tbl_scope = NULL,
        .tf_dev_map_parif = NULL,
@@ -247,25 +275,38 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
        .tf_dev_alloc_ident = tf_ident_alloc,
        .tf_dev_free_ident = tf_ident_free,
        .tf_dev_search_ident = tf_ident_search,
+       .tf_dev_get_ident_resc_info = tf_ident_get_resc_info,
        .tf_dev_get_tbl_info = NULL,
        .tf_dev_alloc_tbl = tf_tbl_alloc,
        .tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
        .tf_dev_free_tbl = tf_tbl_free,
        .tf_dev_free_ext_tbl = tf_tbl_ext_free,
-       .tf_dev_alloc_search_tbl = tf_tbl_alloc_search,
        .tf_dev_set_tbl = tf_tbl_set,
        .tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
        .tf_dev_get_tbl = tf_tbl_get,
        .tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
+       .tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,
+       .tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
+#ifdef TF_TCAM_SHARED
+       .tf_dev_alloc_tcam = tf_tcam_shared_alloc,
+       .tf_dev_free_tcam = tf_tcam_shared_free,
+       .tf_dev_set_tcam = tf_tcam_shared_set,
+       .tf_dev_get_tcam = tf_tcam_shared_get,
+       .tf_dev_move_tcam = tf_tcam_shared_move_p4,
+       .tf_dev_clear_tcam = tf_tcam_shared_clear,
+#else /* !TF_TCAM_SHARED */
        .tf_dev_alloc_tcam = tf_tcam_alloc,
        .tf_dev_free_tcam = tf_tcam_free,
-       .tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
        .tf_dev_set_tcam = tf_tcam_set,
-       .tf_dev_get_tcam = NULL,
+       .tf_dev_get_tcam = tf_tcam_get,
+#endif
+       .tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
+       .tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
        .tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
        .tf_dev_delete_int_em_entry = tf_em_delete_int_entry,
        .tf_dev_insert_ext_em_entry = tf_em_insert_ext_entry,
        .tf_dev_delete_ext_em_entry = tf_em_delete_ext_entry,
+       .tf_dev_get_em_resc_info = tf_em_get_resc_info,
        .tf_dev_alloc_tbl_scope = tf_em_ext_common_alloc,
        .tf_dev_map_tbl_scope = tf_em_ext_map_tbl_scope,
        .tf_dev_map_parif = tf_dev_p4_map_parif,