Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #ifndef OPENOLT_CORE_DATA_H_ |
| 17 | #define OPENOLT_CORE_DATA_H_ |
| 18 | |
| 19 | #include <bitset> |
| 20 | |
| 21 | #include "core.h" |
| 22 | #include "Queue.h" |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 23 | #include "device.h" |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 24 | |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 25 | // pcapplusplus packet decoder include files |
| 26 | #include "Packet.h" |
| 27 | #include "EthLayer.h" |
| 28 | #include "IPv4Layer.h" |
| 29 | #include "UdpLayer.h" |
| 30 | #include "VlanLayer.h" |
| 31 | |
| 32 | #include <time.h> |
| 33 | #include <arpa/inet.h> |
| 34 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 35 | extern "C" |
| 36 | { |
| 37 | #include <bcmolt_api.h> |
| 38 | #include <bcmolt_api_model_supporting_enums.h> |
| 39 | |
| 40 | #include <bcmolt_api_conn_mgr.h> |
| 41 | //CLI header files |
| 42 | #include <bcmcli_session.h> |
| 43 | #include <bcmcli.h> |
| 44 | #include <bcm_api_cli.h> |
| 45 | |
| 46 | #include <bcmos_common.h> |
| 47 | #include <bcm_config.h> |
| 48 | // FIXME : dependency problem |
| 49 | // #include <bcm_common_gpon.h> |
| 50 | // #include <bcm_dev_log_task.h> |
| 51 | } |
| 52 | |
Girish Gowdra | 5057a3d | 2020-05-29 18:49:56 -0700 | [diff] [blame] | 53 | #define ALLOC_CFG_COMPLETE_WAIT_TIMEOUT 5000 // in milli-seconds |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 54 | #define GEM_CFG_COMPLETE_WAIT_TIMEOUT 5000 // in milli-seconds |
| 55 | |
| 56 | // max retry count to find gem config key in gem_cfg_compltd_map |
| 57 | #define MAX_GEM_CFG_KEY_CHECK 5 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 58 | |
Girish Gowdra | 5057a3d | 2020-05-29 18:49:56 -0700 | [diff] [blame] | 59 | #define ONU_DEACTIVATE_COMPLETE_WAIT_TIMEOUT 5000 // in milli-seconds |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 60 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 61 | |
| 62 | #define MAX_ACL_ID 33 |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 63 | #define MAX_ACL_WITH_VLAN_CLASSIFIER 10 |
| 64 | |
| 65 | #define ANY_VLAN 4095 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 66 | |
| 67 | // **************************************// |
| 68 | // Enums and structures used by the core // |
| 69 | // **************************************// |
| 70 | enum FLOW_CFG { |
| 71 | ONU_ID = 0, |
| 72 | FLOW_TYPE = 1, |
| 73 | SVC_PORT_ID = 2, |
| 74 | PRIORITY = 3, |
| 75 | COOKIE = 4, |
| 76 | INGRESS_INTF_TYPE= 5, |
| 77 | EGRESS_INTF_TYPE= 6, |
| 78 | INGRESS_INTF_ID = 7, |
| 79 | EGRESS_INTF_ID = 8, |
| 80 | CLASSIFIER_O_VID = 9, |
| 81 | CLASSIFIER_O_PBITS = 10, |
| 82 | CLASSIFIER_I_VID = 11, |
| 83 | CLASSIFIER_I_PBITS = 12, |
| 84 | CLASSIFIER_ETHER_TYPE = 13, |
| 85 | CLASSIFIER_IP_PROTO =14, |
| 86 | CLASSIFIER_SRC_PORT = 15, |
| 87 | CLASSIFIER_DST_PORT = 16, |
| 88 | CLASSIFIER_PKT_TAG_TYPE = 17, |
| 89 | EGRESS_QOS_TYPE = 18, |
| 90 | EGRESS_QOS_QUEUE_ID = 19, |
| 91 | EGRESS_QOS_TM_SCHED_ID = 20, |
| 92 | ACTION_CMDS_BITMASK = 21, |
| 93 | ACTION_O_VID = 22, |
| 94 | ACTION_O_PBITS = 23, |
| 95 | ACTION_I_VID = 24, |
| 96 | ACTION_I_PBITS = 25, |
| 97 | STATE = 26, |
| 98 | GROUP_ID = 27 |
| 99 | }; |
| 100 | |
| 101 | enum AllocCfgAction { |
| 102 | ALLOC_OBJECT_CREATE, |
| 103 | ALLOC_OBJECT_DELETE |
| 104 | }; |
| 105 | |
| 106 | enum AllocObjectState { |
| 107 | ALLOC_OBJECT_STATE_NOT_CONFIGURED, |
| 108 | ALLOC_OBJECT_STATE_INACTIVE, |
| 109 | ALLOC_OBJECT_STATE_PROCESSING, |
| 110 | ALLOC_OBJECT_STATE_ACTIVE |
| 111 | }; |
| 112 | |
| 113 | enum AllocCfgStatus { |
| 114 | ALLOC_CFG_STATUS_SUCCESS, |
| 115 | ALLOC_CFG_STATUS_FAIL |
| 116 | }; |
| 117 | |
| 118 | typedef struct { |
| 119 | uint32_t pon_intf_id; |
| 120 | uint32_t alloc_id; |
| 121 | AllocObjectState state; |
| 122 | AllocCfgStatus status; |
| 123 | } alloc_cfg_complete_result; |
| 124 | |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 125 | enum GemCfgAction { |
| 126 | GEM_OBJECT_CREATE, |
| 127 | GEM_OBJECT_DELETE, |
| 128 | GEM_OBJECT_ENCRYPT |
| 129 | }; |
| 130 | |
| 131 | enum GemObjectState { |
| 132 | GEM_OBJECT_STATE_NOT_CONFIGURED, |
| 133 | GEM_OBJECT_STATE_INACTIVE, |
| 134 | GEM_OBJECT_STATE_PROCESSING, |
| 135 | GEM_OBJECT_STATE_ACTIVE |
| 136 | }; |
| 137 | |
| 138 | enum GemCfgStatus { |
| 139 | GEM_CFG_STATUS_SUCCESS, |
| 140 | GEM_CFG_STATUS_FAIL |
| 141 | }; |
| 142 | |
| 143 | typedef struct { |
| 144 | uint32_t pon_intf_id; |
| 145 | uint32_t gem_port_id; |
| 146 | GemObjectState state; |
| 147 | GemCfgStatus status; |
| 148 | } gem_cfg_complete_result; |
| 149 | |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 150 | typedef struct { |
| 151 | uint32_t pon_intf_id; |
| 152 | uint32_t onu_id; |
| 153 | bcmolt_result result; |
| 154 | bcmolt_deactivation_fail_reason reason; |
| 155 | } onu_deactivate_complete_result; |
| 156 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 157 | // key for map used for tracking ITU PON Alloc Configuration results from BAL |
| 158 | typedef std::tuple<uint32_t, uint32_t> alloc_cfg_compltd_key; |
| 159 | |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 160 | // key for map used for tracking ITU PON Gem Configuration results from BAL |
| 161 | typedef std::tuple<uint32_t, uint32_t> gem_cfg_compltd_key; |
| 162 | |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 163 | // key for map used for tracking Onu Deactivation Completed Indication |
| 164 | typedef std::tuple<uint32_t, uint32_t> onu_deact_compltd_key; |
| 165 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 166 | // The elements in this acl_classifier_key structure constitute key to |
| 167 | // acl_classifier_to_acl_id_map. |
| 168 | // Fill invalid values in the acl_classifier_key structure to -1. |
| 169 | typedef struct acl_classifier_key { |
| 170 | int32_t ether_type; |
| 171 | int16_t ip_proto; |
| 172 | int32_t src_port; |
| 173 | int32_t dst_port; |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 174 | int16_t o_vid; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 175 | // Add more classifiers elements as needed here |
| 176 | // For now, ACLs will be classified only based on |
| 177 | // above elements. |
| 178 | } acl_classifier_key; |
| 179 | |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 180 | typedef struct device_flow_params { |
| 181 | uint8_t pbit; // If pbit classifier is not present in flow, use 0xff to invalidate |
| 182 | uint32_t gemport_id; |
| 183 | uint16_t flow_id; |
| 184 | } device_flow_params; |
| 185 | |
| 186 | typedef struct device_flow { |
Girish Gowdra | 52997cc | 2022-06-02 20:58:50 -0700 | [diff] [blame] | 187 | bool is_flow_replicated; // If true number of replicated flows cannot be more than NUMBER_OF_PBITS (i.e., 8) |
Girish Gowdra | fc6c0bf | 2022-01-28 18:31:30 -0800 | [diff] [blame] | 188 | std::string flow_type; // upstream, downstream, multicast |
Girish Gowdra | 52997cc | 2022-06-02 20:58:50 -0700 | [diff] [blame] | 189 | device_flow_params params[MAX_NUMBER_OF_REPLICATED_FLOWS]; // There can be a total of MAX_NUMBER_OF_REPLICATED_FLOWS at max |
| 190 | uint8_t total_replicated_flows; |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 191 | uint64_t voltha_flow_id; // This is corresponding voltha flow-id. |
| 192 | uint64_t symmetric_voltha_flow_id; // Is not applicable for trap-to-controller voltha flows. |
| 193 | // 0 value means invalid or not-applicable |
| 194 | // Applicable for bi-directional data path flows (one flow per direction) |
| 195 | // Symmetric flows should share the same device_flow_id. |
| 196 | |
| 197 | } device_flow; |
| 198 | |
Orhan Kupusoglu | ec57af0 | 2021-05-12 12:38:17 +0000 | [diff] [blame] | 199 | // key for map used for tracking Onu RSSI Measurement Completed Indication |
| 200 | typedef std::tuple<uint32_t, uint32_t> onu_rssi_compltd_key; |
| 201 | |
| 202 | typedef struct { |
| 203 | uint32_t pon_intf_id; |
| 204 | uint32_t onu_id; |
| 205 | std::string status; |
| 206 | bcmolt_rssi_measurement_fail_reason reason; |
| 207 | double rx_power_mean_dbm; |
| 208 | } onu_rssi_complete_result; |
| 209 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 210 | // Key for map used for tracking symmetric datapath flows ==> <pon, onu, uni, tp_id, flow_type> |
| 211 | typedef std::tuple<int32_t, int32_t, int32_t, uint32_t, std::string> symmetric_datapath_flow_id_map_key; |
| 212 | |
| 213 | // Key and value for the pon_gem_to_onu_uni_map |
| 214 | typedef std::tuple<uint32_t, uint32_t> pon_gem; |
| 215 | typedef std::tuple<uint32_t, uint32_t> onu_uni; |
| 216 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 217 | // *******************************************************// |
| 218 | // Extern Variable/Constant declarations used by the core // |
| 219 | // *******************************************************// |
| 220 | extern State state; |
| 221 | |
| 222 | extern dev_log_id openolt_log_id; |
| 223 | extern dev_log_id omci_log_id; |
| 224 | |
| 225 | extern unsigned int num_of_nni_ports; |
| 226 | extern unsigned int num_of_pon_ports; |
| 227 | |
| 228 | extern const uint32_t tm_upstream_sched_id_start; |
| 229 | extern const uint32_t tm_downstream_sched_id_start; |
| 230 | |
| 231 | extern const uint32_t queue_id_list[8]; |
| 232 | |
| 233 | extern const std::string upstream; |
| 234 | extern const std::string downstream; |
| 235 | extern const std::string multicast; |
| 236 | extern bcmolt_oltid dev_id; |
| 237 | |
| 238 | extern const uint32_t BAL_API_RETRY_TIME_IN_USECS; |
| 239 | extern const uint32_t MAX_BAL_API_RETRY_COUNT; |
| 240 | |
| 241 | extern const unsigned int OPENOLT_FIELD_LEN; |
| 242 | |
| 243 | /* Current session */ |
| 244 | extern bcmcli_session *current_session; |
| 245 | extern bcmcli_entry *api_parent_dir; |
| 246 | extern bcmos_bool status_bcm_cli_quit; |
| 247 | extern bcmos_task bal_cli_thread; |
| 248 | extern const char *bal_cli_thread_name; |
| 249 | extern uint16_t flow_id_counters; |
| 250 | |
| 251 | extern std::map<uint32_t, uint32_t> flowid_to_port; // For mapping upstream flows to logical ports |
| 252 | extern std::map<uint32_t, uint32_t> flowid_to_gemport; // For mapping downstream flows into gemports |
| 253 | extern std::map<uint32_t, std::set<uint32_t> > port_to_flows; // For mapping logical ports to downstream flows |
| 254 | |
| 255 | /* This represents the Key to 'sched_map' map. |
Burak Gurdag | 2f2618c | 2020-04-23 13:20:30 +0000 | [diff] [blame] | 256 | Represents (pon_intf_id, onu_id, uni_id, direction, tech_profile_id) */ |
| 257 | typedef std::tuple<uint32_t, uint32_t, uint32_t, std::string, uint32_t> sched_map_key_tuple; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 258 | /* 'sched_map' maps sched_map_key_tuple to DBA (Upstream) or |
| 259 | Subscriber (Downstream) Scheduler ID */ |
| 260 | extern std::map<sched_map_key_tuple, int> sched_map; |
| 261 | |
| 262 | /* Flow control is for flow_id and flow_type */ |
| 263 | typedef std::pair<uint16_t, uint16_t> flow_pair; |
| 264 | extern std::map<flow_pair, int32_t> flow_map; |
| 265 | |
| 266 | /* This represents the Key to 'qos_type_map' map. |
| 267 | Represents (pon_intf_id, onu_id, uni_id) */ |
| 268 | typedef std::tuple<uint32_t, uint32_t, uint32_t> qos_type_map_key_tuple; |
| 269 | /* 'qos_type_map' maps qos_type_map_key_tuple to qos_type*/ |
| 270 | extern std::map<qos_type_map_key_tuple, bcmolt_egress_qos_type> qos_type_map; |
| 271 | |
| 272 | /* This represents the Key to 'sched_qmp_id_map' map. |
| 273 | Represents (sched_id, pon_intf_id, onu_id, uni_id) */ |
| 274 | typedef std::tuple<uint32_t, uint32_t, uint32_t, uint32_t> sched_qmp_id_map_key_tuple; |
| 275 | /* 'sched_qmp_id_map' maps sched_qmp_id_map_key_tuple to TM Queue Mapping Profile ID */ |
| 276 | extern std::map<sched_qmp_id_map_key_tuple, int> sched_qmp_id_map; |
| 277 | /* 'qmp_id_to_qmp_map' maps TM Queue Mapping Profile ID to TM Queue Mapping Profile */ |
| 278 | extern std::map<int, std::vector < uint32_t > > qmp_id_to_qmp_map; |
| 279 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 280 | // Map used to track response from BAL for ITU PON Alloc Configuration. |
| 281 | // The key is alloc_cfg_compltd_key and value is a concurrent thread-safe queue which is |
| 282 | // used for pushing (from BAL) and popping (at application) the results. |
| 283 | extern std::map<alloc_cfg_compltd_key, Queue<alloc_cfg_complete_result> *> alloc_cfg_compltd_map; |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 284 | |
| 285 | // Map used to track response from BAL for ITU PON Gem Configuration. |
| 286 | // The key is gem_cfg_compltd_key and value is a concurrent thread-safe queue which is |
| 287 | // used for pushing (from BAL) and popping (at application) the results. |
| 288 | extern std::map<gem_cfg_compltd_key, Queue<gem_cfg_complete_result> *> gem_cfg_compltd_map; |
| 289 | |
| 290 | /* This represents the Key to 'gemport_status_map' map. |
| 291 | Represents (pon_intf_id, onu_id, uni_id, gemport_id) */ |
| 292 | typedef std::tuple<uint32_t, uint32_t, uint32_t, uint32_t> gemport_status_map_key_tuple; |
| 293 | /* 'gemport_status_map' maps gemport_status_map_key_tuple to boolean value */ |
| 294 | extern std::map<gemport_status_map_key_tuple, bool> gemport_status_map; |
| 295 | |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 296 | // Map used to track response from BAL for Onu Deactivation Completed Indication |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 297 | // The key is onu_deact_compltd_key and value is a concurrent thread-safe queue which is |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 298 | // used for pushing (from BAL) and popping (at application) the results. |
| 299 | extern std::map<onu_deact_compltd_key, Queue<onu_deactivate_complete_result> *> onu_deact_compltd_map; |
| 300 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 301 | // Lock to protect critical section data structure used for handling AllocObject configuration response. |
| 302 | extern bcmos_fastlock alloc_cfg_wait_lock; |
Thiyagarajan Subramani | e976fcf | 2021-05-07 22:46:57 +0530 | [diff] [blame] | 303 | // Lock to protect critical section data structure used for handling GemObject configuration response. |
| 304 | extern bcmos_fastlock gem_cfg_wait_lock; |
Girish Gowdra | 7a79dae | 2020-02-10 18:22:11 +0530 | [diff] [blame] | 305 | // Lock to protect critical section data structure used for handling Onu deactivation completed Indication |
| 306 | extern bcmos_fastlock onu_deactivate_wait_lock; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 307 | |
| 308 | |
| 309 | /*** ACL Handling related data start ***/ |
| 310 | |
| 311 | extern std::map<acl_classifier_key, uint16_t> acl_classifier_to_acl_id_map; |
| 312 | extern bool operator<(const acl_classifier_key& a1, const acl_classifier_key& a2); |
| 313 | |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 314 | typedef std::tuple<uint64_t, std::string> flow_id_flow_direction; |
| 315 | typedef std::tuple<int16_t, int32_t> acl_id_intf_id; |
| 316 | extern std::map<flow_id_flow_direction, acl_id_intf_id> flow_to_acl_map; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 317 | |
| 318 | // Keeps a reference count of how many flows are referencing a given ACL ID. |
| 319 | // Key represents the ACL-ID and value is number of flows referencing the given ACL-ID. |
| 320 | // When there is at least one flow referencing the ACL-ID, the ACL should be installed. |
| 321 | // When there are no flows referencing the ACL-ID, the ACL should be removed. |
| 322 | extern std::map<uint16_t, uint16_t> acl_ref_cnt; |
| 323 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 324 | // Needed to keep track of how many flows for a given acl_id, intf_id and intf_type are |
| 325 | // installed. When there is at least on flow for this key, we should have interface registered |
| 326 | // for the given ACL-ID. When there are no flows, the intf should unregister itself from |
| 327 | // the ACL-ID. |
| 328 | typedef std::tuple<uint16_t, uint8_t, std::string> acl_id_intf_id_intf_type; |
| 329 | extern std::map<acl_id_intf_id_intf_type, uint16_t> intf_acl_registration_ref_cnt; |
| 330 | |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 331 | // Data structures to work around ACL limits on BAL -- start -- |
| 332 | |
| 333 | enum trap_to_host_packet_type { |
| 334 | dhcpv4 = 0, |
| 335 | lldp = 1, |
| 336 | eap = 2, |
| 337 | igmpv4 = 3, |
Marcos Aurelio Carrero (Furukawa) | cfe3e0d | 2021-03-03 10:36:56 -0300 | [diff] [blame] | 338 | pppoed = 4, |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 339 | unsupported_trap_to_host_pkt_type = 0xff |
| 340 | }; |
| 341 | |
| 342 | // Constants useful during trap-to-host packet header field classification |
Marcos Aurelio Carrero (Furukawa) | cfe3e0d | 2021-03-03 10:36:56 -0300 | [diff] [blame] | 343 | #define EAP_ETH_TYPE 0x888e |
| 344 | #define LLDP_ETH_TYPE 0x88cc |
| 345 | #define IPV4_ETH_TYPE 0x0800 |
| 346 | #define VLAN_ETH_TYPE 0x8100 |
| 347 | #define PPPoED_ETH_TYPE 0x8863 |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 348 | |
| 349 | #define IGMPv4_PROTOCOL 2 |
| 350 | #define UDP_PROTOCOL 17 |
| 351 | |
| 352 | #define DHCP_SERVER_SRC_PORT 67 |
| 353 | #define DHCP_CLIENT_SRC_PORT 68 |
| 354 | |
| 355 | // This flag is set as soon as ACL count reaches MAX_ACL_WITH_VLAN_CLASSIFIER is hit. |
| 356 | // It is not reset when ACL count comes below MAX_ACL_WITH_VLAN_CLASSIFIER again |
| 357 | extern bool max_acls_with_vlan_classifiers_hit; |
| 358 | |
| 359 | // Tuple of -> {bcmolt_flow_interface_type, intf-id, trap_to_host_packet_type, gemport-id, c-vid} |
| 360 | typedef std::tuple<int32_t, uint32_t, int32_t, int32_t, uint16_t> trap_to_host_pkt_info_with_vlan; |
| 361 | |
| 362 | // Tuple of -> {bcmolt_flow_interface_type, intf-id, trap_to_host_packet_type, gemport-id} |
| 363 | typedef std::tuple<int32_t, uint32_t, int32_t, int32_t> trap_to_host_pkt_info; |
| 364 | |
| 365 | // Map of flow_id -> trap_to_host_pkt_info_with_vlan |
| 366 | extern std::map<uint64_t, trap_to_host_pkt_info_with_vlan> trap_to_host_pkt_info_with_vlan_for_flow_id; |
| 367 | |
| 368 | // Map of trap_to_host_pkt_info -> cvid_list |
| 369 | extern std::map<trap_to_host_pkt_info, std::list<uint16_t> > trap_to_host_vlan_ids_for_trap_to_host_pkt_info; |
| 370 | |
| 371 | // Data structures to work around ACL limits on BAL -- end -- |
| 372 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 373 | extern std::bitset<MAX_ACL_ID> acl_id_bitset; |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 374 | extern bcmos_fastlock acl_id_bitset_lock; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 375 | |
| 376 | /*** ACL Handling related data end ***/ |
| 377 | |
| 378 | extern std::bitset<MAX_TM_SCHED_ID> tm_sched_bitset; |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 379 | extern bcmos_fastlock tm_sched_bitset_lock; |
| 380 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 381 | extern std::bitset<MAX_TM_QMP_ID> tm_qmp_bitset; |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 382 | extern bcmos_fastlock tm_qmp_bitset_lock; |
| 383 | |
| 384 | extern std::bitset<MAX_FLOW_ID> flow_id_bitset; |
| 385 | extern bcmos_fastlock flow_id_bitset_lock; |
| 386 | |
| 387 | extern std::map<uint64_t, device_flow> voltha_flow_to_device_flow; |
| 388 | extern bcmos_fastlock voltha_flow_to_device_flow_lock; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 389 | |
Girish Gowdra | eec0fc9 | 2021-05-12 15:37:55 -0700 | [diff] [blame] | 390 | extern std::map<symmetric_datapath_flow_id_map_key, uint64_t> symmetric_datapath_flow_id_map; |
| 391 | extern bcmos_fastlock symmetric_datapath_flow_id_lock; |
| 392 | |
| 393 | extern std::map<pon_gem, onu_uni> pon_gem_to_onu_uni_map; |
| 394 | extern bcmos_fastlock pon_gem_to_onu_uni_map_lock; |
| 395 | |
Girish Gowdra | 1935e6a | 2020-10-31 21:48:22 -0700 | [diff] [blame] | 396 | // Lock to protect critical section around handling data associated with ACL trap packet handling |
| 397 | extern bcmos_fastlock acl_packet_trap_handler_lock; |
| 398 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 399 | extern Queue<openolt::Indication> oltIndQ; |
| 400 | |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 401 | /*** ACL Handling related data end ***/ |
| 402 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 403 | extern bcmos_fastlock data_lock; |
| 404 | |
Humera Kouser | 6143c9e | 2020-06-17 22:37:31 +0530 | [diff] [blame] | 405 | // Interface name on which grpc server is running on |
| 406 | // and this can be used to get the mac adress based on interface name. |
| 407 | extern char* grpc_server_interface_name; |
Orhan Kupusoglu | ec57af0 | 2021-05-12 12:38:17 +0000 | [diff] [blame] | 408 | |
| 409 | extern std::map<onu_rssi_compltd_key, Queue<onu_rssi_complete_result>*> onu_rssi_compltd_map; |
| 410 | extern bcmos_fastlock onu_rssi_wait_lock; |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 411 | #endif // OPENOLT_CORE_DATA_H_ |