#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"
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) {
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;
.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_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,