openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

tcam_entities.h (3069B)


      1 /**
      2 * \file        tcam_entities.h
      3 *
      4 * DESCRIPTION :
      5 *       This file includes a representation for the TCAM database struct used as an input
      6 *       by the TCAM module to create a new tcam handler.
      7 */
      8 /**
      9  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
     10  * 
     11  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     12  */
     13 #ifndef TCAM_DATABASE_H_INCLUDED
     14 /** { */
     15 #define TCAM_DATABASE_H_INCLUDED
     16 
     17 #include <include/bcm_int/dnx/field/field.h>
     18 #include <soc/dnx/swstate/auto_generated/types/dnx_field_tcam_access_types.h>
     19 
     20 /**
     21  * This struct contains the information needed by the TCAM in order
     22  * to add an entry.
     23  */
     24 typedef struct
     25 {
     26     /**
     27      * The id of this entry
     28      */
     29     uint32 id;
     30     /**
     31      * the priority of this entry (determines the location of this entry
     32      * in TCAM relatively to other entries in the same database)
     33      */
     34     uint32 priority;
     35     /**
     36      * Specifies whether entry is valid.
     37      * (Non-valid entries exist in SW/HW but are not active
     38      */
     39     uint8 valid_bit;
     40 } dnx_field_tcam_entry_t;
     41 
     42 /**
     43  * This struct holds information about database that is needed by TCAM module.
     44  * It's used as an input parameter when creating a new handler.
     45  */
     46 typedef struct
     47 {
     48     /**
     49      * The stage of this database
     50      */
     51     dnx_field_tcam_stage_e stage;
     52     /**
     53      * specifies whether this database is direct_extraction/direct_TCAM or normal
     54      * TCAM database
     55      */
     56     uint8 is_direct;
     57     /**
     58      * The key size of this database either 80/160/320b
     59      */
     60     dnx_field_key_length_type_e key_size;
     61     /**
     62      * The action size of this database either 32(lsb)/32(msb)/64/128b
     63      */
     64     dnx_field_action_length_type_e action_size;
     65     /**
     66      * The total actual number of bits used by the database as action.
     67      */
     68     uint32 actual_action_size;
     69     /**
     70      * Restricted TCAM handlers ids which are not allowed to share banks with the
     71      * current TCAM handler to be created.
     72      */
     73     uint32 restricted_tcam_handlers_ids[DNX_DATA_MAX_FIELD_TCAM_NOF_TCAM_HANDLERS];
     74     /**
     75      * Number of restricted TCAM handlers
     76      */
     77     uint32 nof_restricted_tcam_handlers;
     78     /**
     79      * Prefix size
     80      */
     81     uint32 prefix_size;
     82     /**
     83      * Prefix value
     84      */
     85     uint32 prefix_value;
     86     /**
     87      * Bank allocation mode
     88      */
     89     dnx_field_tcam_bank_allocation_mode_e bank_allocation_mode;
     90     /*
     91      * Number of banks to allocate (for Select mode)
     92      */
     93     int nof_banks_to_alloc;
     94     /**
     95      * Bank IDs to allocate (For "Select" mode)
     96      */
     97     int banks_to_alloc[DNX_DATA_MAX_FIELD_TCAM_NOF_BANKS];
     98 } dnx_field_tcam_database_t;
     99 
    100 /**
    101  * \brief
    102  *  Inits the TCAM database info, which is used as an input to
    103  *  "dnx_field_tcam_handler_create()"
    104  *
    105  * \param[in]     unit - Device ID
    106  * \param[in,out] db   - Database to Init (should be allocated by user)
    107  *
    108  * \return
    109  *  \retval _SHR_E_NONE - success
    110  */
    111 shr_error_e dnx_field_tcam_database_t_init(
    112     int unit,
    113     dnx_field_tcam_database_t * db);
    114 
    115 /** } */
    116 #endif