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

aacl_in_intf.h (4101B)


      1 /*! \file bcm_int/dnx/aacl/aacl_in_intf.h
      2  *
      3  * Internal DNX AACL APIs
      4  *
      5  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      6  * 
      7  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      8  */
      9 
     10 #ifndef _AACL_IN_INTF_H_INCLUDED__
     11 
     12 #define _AACL_IN_INTF_H_INCLUDED__
     13 
     14 #ifndef BCM_DNX_SUPPORT
     15 #error "This file is for use by DNX (JR2) family only!"
     16 #endif
     17 
     18 
     19 #include <shared/shrextend/shrextend_debug.h>
     20 #include <soc/dnx/dbal/auto_generated/dbal_defines_tables.h>
     21 #include <soc/dnx/dbal/auto_generated/dbal_defines_fields.h>
     22 #include <bcm/types.h>
     23 
     24 
     25 
     26 
     27 
     28 
     29 
     30 
     31 #define AACL_MAX_GROUP_ID 3
     32 
     33 
     34 
     35 
     36 
     37 
     38 
     39 
     40 
     41 
     42 #define AACL_MAX_NUM_OF_FILEDS 25
     43 
     44 typedef enum
     45 {
     46     AACL_TCAM_COMPRESSED_ENTRY,
     47     AACL_TCAM_OVERFLOW_ENTRY
     48 } aacl_tcam_entry_type;
     49 
     50 typedef enum
     51 {
     52     AACL_LPM_INDEX1_ENTRY,
     53     AACL_LPM_INDEX2_ENTRY
     54 } aacl_lpm_entry_type;
     55 
     56 typedef shr_error_e(
     57     *aacl_out_tcam_entry_add) (
     58     int unit,
     59     int group_id,
     60     aacl_tcam_entry_type entry_type,
     61     uint32 *key,
     62     uint32 *mask,
     63     int priority,
     64     uint32 *payload,
     65     int payload_size,
     66     uint32 *entry_id);
     67 
     68 typedef int (
     69     *aacl_out_tcam_entry_delete) (
     70     int unit,
     71     int group_id,
     72     aacl_tcam_entry_type entry_type,
     73     uint32 *key,
     74     uint32 *mask,
     75     uint32 entry_id);
     76 
     77 typedef int (
     78     *aacl_out_tcam_entry_payload_update) (
     79     int unit,
     80     int group_id,
     81     aacl_tcam_entry_type entry_type,
     82     uint32 *key,
     83     uint32 *mask,
     84     uint32 *payload,
     85     int payload_size,
     86     uint32 entry_id);
     87 
     88 typedef int (
     89     *aacl_out_lpm_entry_add) (
     90     int unit,
     91     int group_id,
     92     aacl_lpm_entry_type entry_type,
     93     uint32 *prefix,
     94     int prefix_length,
     95     uint32 *payload,
     96     int payload_size);
     97 
     98 typedef int (
     99     *aacl_out_lpm_entry_delete) (
    100     int unit,
    101     int group_id,
    102     aacl_lpm_entry_type entry_type,
    103     uint32 *prefix,
    104     int prefix_length);
    105 
    106 typedef int (
    107     *aacl_out_lpm_entry_payload_update) (
    108     int unit,
    109     int group_id,
    110     aacl_lpm_entry_type entry_type,
    111     uint32 *prefix,
    112     int prefix_length,
    113     uint32 *payload,
    114     int payload_size);
    115 
    116 typedef struct
    117 {
    118     aacl_out_tcam_entry_add tcam_entry_add;
    119     aacl_out_lpm_entry_add lpm_entry_add;
    120     aacl_out_tcam_entry_delete tcam_entry_delete;
    121     aacl_out_lpm_entry_delete lpm_entry_delete;
    122     aacl_out_tcam_entry_payload_update tcam_entry_payload_update;
    123     aacl_out_lpm_entry_payload_update lpm_entry_payload_update;
    124 } aacl_mngr_out_intf_cb;
    125 
    126 
    127 typedef struct aacl_out_dbal_info
    128 {
    129     dbal_tables_e compressed_dbal_id;
    130     dbal_tables_e overflow_dbal_id;
    131     dbal_tables_e index1_dbal_id;
    132     dbal_tables_e index2_dbal_id;
    133 } aacl_out_intf_dbal_table_info_t;
    134 
    135 aacl_out_intf_dbal_table_info_t aacl_group_to_dbal_info[BCM_MAX_NUM_UNITS][AACL_MAX_GROUP_ID];
    136 
    137 
    138 
    139 
    140 
    141 
    142 shr_error_e dnx_aacl_init(
    143     int unit);
    144 
    145 
    146 shr_error_e dnx_aacl_deinit(
    147     int unit);
    148 
    149 
    150 shr_error_e dnx_aacl_is_enabled(
    151     int unit,
    152     uint8 *is_enabled);
    153 
    154 
    155 shr_error_e dnx_aacl_group_create(
    156     int unit,
    157     uint32 *group_id,
    158     char *group_name,
    159     uint32 flags);
    160 
    161 
    162 shr_error_e dnx_aacl_group_dbal_tables_connect(
    163     int unit,
    164     uint32 group_id,
    165     dbal_tables_e compressed_dbal_id,
    166     dbal_tables_e overflow_dbal_id,
    167     dbal_tables_e index1_dbal_id,
    168     dbal_tables_e index2_dbal_id);
    169 
    170 
    171 shr_error_e dnx_aacl_entry_create(
    172     int unit,
    173     uint32 group_id,
    174     uint32 priority,
    175     uint32 *entry_id);
    176 
    177 
    178 shr_error_e dnx_aacl_entry_key_field_masked_set(
    179     int unit,
    180     uint32 entry_id,
    181     dbal_fields_e field_id,
    182     uint32 *field_value,
    183     uint32 *field_mask);
    184 
    185 
    186 shr_error_e dnx_aacl_entry_key_field_range_set(
    187     int unit,
    188     uint32 entry_id,
    189     dbal_fields_e field_id,
    190     uint32 min_value,
    191     uint32 max_value);
    192 
    193 
    194 shr_error_e dnx_aacl_entry_result_field_set(
    195     int unit,
    196     uint32 entry_id,
    197     dbal_fields_e field_id,
    198     uint32 *result_value);
    199 
    200 
    201 shr_error_e dnx_aacl_entry_install(
    202     int unit,
    203     uint32 entry_id);
    204 
    205 
    206 shr_error_e dnx_aacl_batch_collect(
    207     int unit,
    208     uint32 group_id);
    209 
    210 
    211 shr_error_e dnx_aacl_batch_commit(
    212     int unit,
    213     uint32 group_id);
    214 
    215 #endif