Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1 | /* |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 2 | Copyright (C) 2018 Open Networking Foundation |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 3 | |
| 4 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 3 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #include <iostream> |
| 19 | #include <memory> |
| 20 | #include <string> |
| 21 | |
| 22 | #include "Queue.h" |
| 23 | #include <iostream> |
| 24 | #include <sstream> |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 25 | #include <chrono> |
| 26 | #include <thread> |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 27 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 28 | #include "device.h" |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 29 | #include "core.h" |
| 30 | #include "indications.h" |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 31 | #include "stats_collection.h" |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 32 | #include "error_format.h" |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 33 | #include "state.h" |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 34 | #include "utils.h" |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 35 | |
| 36 | extern "C" |
| 37 | { |
| 38 | #include <bcmos_system.h> |
| 39 | #include <bal_api.h> |
| 40 | #include <bal_api_end.h> |
Nicolas Palpacuer | f0b0249 | 2018-09-10 10:21:29 -0400 | [diff] [blame] | 41 | // FIXME : dependency problem |
| 42 | // #include <bcm_common_gpon.h> |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 43 | // #include <bcm_dev_log_task.h> |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 44 | } |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 45 | // These need patched into bal_model_types.h directly. But, with above extern "C", it cannot be done |
| 46 | inline bcmbal_action_cmd_id& operator|=(bcmbal_action_cmd_id& a, bcmbal_action_cmd_id b) {return a = static_cast<bcmbal_action_cmd_id>(static_cast<int>(a) | static_cast<int>(b));} |
| 47 | inline bcmbal_action_id& operator|=(bcmbal_action_id& a, bcmbal_action_id b) {return a = static_cast<bcmbal_action_id>(static_cast<int>(a) | static_cast<int>(b));} |
| 48 | inline bcmbal_classifier_id& operator|=(bcmbal_classifier_id& a, bcmbal_classifier_id b) {return a = static_cast<bcmbal_classifier_id>(static_cast<int>(a) | static_cast<int>(b));} |
| 49 | inline bcmbal_tm_sched_owner_agg_port_id& operator|=(bcmbal_tm_sched_owner_agg_port_id& a, bcmbal_tm_sched_owner_agg_port_id b) {return a = static_cast<bcmbal_tm_sched_owner_agg_port_id>(static_cast<int>(a) | static_cast<int>(b));} |
| 50 | inline bcmbal_tm_sched_parent_id& operator|=(bcmbal_tm_sched_parent_id& a, bcmbal_tm_sched_parent_id b) {return a = static_cast<bcmbal_tm_sched_parent_id>(static_cast<int>(a) | static_cast<int>(b));} |
| 51 | inline bcmbal_tm_shaping_id& operator|=(bcmbal_tm_shaping_id& a, bcmbal_tm_shaping_id b) {return a = static_cast<bcmbal_tm_shaping_id>(static_cast<int>(a) | static_cast<int>(b));} |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 52 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 53 | dev_log_id openolt_log_id = bcm_dev_log_id_register("OPENOLT", DEV_LOG_LEVEL_INFO, DEV_LOG_ID_TYPE_BOTH); |
| 54 | dev_log_id omci_log_id = bcm_dev_log_id_register("OMCI", DEV_LOG_LEVEL_INFO, DEV_LOG_ID_TYPE_BOTH); |
| 55 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 56 | #define MAX_SUPPORTED_INTF 16 |
| 57 | #define BAL_RSC_MANAGER_BASE_TM_SCHED_ID 16384 |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 58 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 59 | static unsigned int num_of_nni_ports = 0; |
| 60 | static unsigned int num_of_pon_ports = 0; |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 61 | static std::string intf_technologies[MAX_SUPPORTED_INTF]; |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 62 | static const std::string UNKNOWN_TECH("unknown"); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 63 | static const std::string MIXED_TECH("mixed"); |
| 64 | static std::string board_technology(UNKNOWN_TECH); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 65 | |
| 66 | static std::string firmware_version = "Openolt.2018.10.04"; |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 67 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 68 | State state; |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 69 | |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 70 | static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id, int sched_id, int pir); |
| 71 | static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id, int sched_id); |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 72 | |
Nicolas Palpacuer | 8ebaa26 | 2018-08-16 14:56:47 -0400 | [diff] [blame] | 73 | static inline int mk_sched_id(int intf_id, int onu_id) { |
Shad Ansari | 0c6fa3e | 2018-09-26 17:43:21 +0000 | [diff] [blame] | 74 | return 1023 + intf_id * 32 + onu_id; |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 75 | } |
| 76 | |
Nicolas Palpacuer | 8ebaa26 | 2018-08-16 14:56:47 -0400 | [diff] [blame] | 77 | static inline int mk_agg_port_id(int intf_id, int onu_id) { |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 78 | if (board_technology == "gpon") return 511 + intf_id * 32 + onu_id; |
Shad Ansari | 0c6fa3e | 2018-09-26 17:43:21 +0000 | [diff] [blame] | 79 | return 1023 + intf_id * 32 + onu_id; |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 80 | } |
| 81 | |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 82 | Status GetDeviceInfo_(openolt::DeviceInfo* device_info) { |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 83 | device_info->set_vendor(VENDOR_ID); |
| 84 | device_info->set_model(MODEL_ID); |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 85 | device_info->set_hardware_version(""); |
| 86 | device_info->set_firmware_version(firmware_version); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 87 | device_info->set_technology(board_technology); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 88 | device_info->set_pon_ports(num_of_pon_ports); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 89 | |
| 90 | // Legacy, device-wide ranges. To be deprecated when adapter |
| 91 | // is upgraded to support per-interface ranges |
| 92 | if (board_technology == "xgspon") { |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 93 | device_info->set_onu_id_start(1); |
| 94 | device_info->set_onu_id_end(255); |
| 95 | device_info->set_alloc_id_start(1024); |
| 96 | device_info->set_alloc_id_end(16383); |
| 97 | device_info->set_gemport_id_start(1024); |
| 98 | device_info->set_gemport_id_end(65535); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 99 | device_info->set_flow_id_start(1); |
| 100 | device_info->set_flow_id_end(16383); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 101 | } |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 102 | else if (board_technology == "gpon") { |
| 103 | device_info->set_onu_id_start(1); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 104 | device_info->set_onu_id_end(127); |
| 105 | device_info->set_alloc_id_start(256); |
| 106 | device_info->set_alloc_id_end(767); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 107 | device_info->set_gemport_id_start(256); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 108 | device_info->set_gemport_id_end(4095); |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 109 | device_info->set_flow_id_start(1); |
| 110 | device_info->set_flow_id_end(16383); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 111 | } |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 112 | |
| 113 | std::map<std::string, openolt::DeviceInfo::DeviceResourceRanges*> ranges; |
| 114 | for (uint32_t intf_id = 0; intf_id < num_of_pon_ports; ++intf_id) { |
| 115 | std::string intf_technology = intf_technologies[intf_id]; |
| 116 | openolt::DeviceInfo::DeviceResourceRanges *range = ranges[intf_technology]; |
| 117 | if(range == nullptr) { |
| 118 | range = device_info->add_ranges(); |
| 119 | ranges[intf_technology] = range; |
| 120 | range->set_technology(intf_technology); |
| 121 | |
| 122 | if (intf_technology == "xgspon") { |
| 123 | openolt::DeviceInfo::DeviceResourceRanges::Pool* pool; |
| 124 | |
| 125 | pool = range->add_pools(); |
| 126 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::ONU_ID); |
| 127 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::DEDICATED_PER_INTF); |
| 128 | pool->set_start(1); |
| 129 | pool->set_end(255); |
| 130 | |
| 131 | pool = range->add_pools(); |
| 132 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::ALLOC_ID); |
| 133 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_SAME_TECH); |
| 134 | pool->set_start(1024); |
| 135 | pool->set_end(16383); |
| 136 | |
| 137 | pool = range->add_pools(); |
| 138 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::GEMPORT_ID); |
| 139 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_ALL_TECH); |
| 140 | pool->set_start(1024); |
| 141 | pool->set_end(65535); |
| 142 | |
| 143 | pool = range->add_pools(); |
| 144 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::FLOW_ID); |
| 145 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_ALL_TECH); |
| 146 | pool->set_start(1); |
| 147 | pool->set_end(16383); |
| 148 | } |
| 149 | else if (intf_technology == "gpon") { |
| 150 | openolt::DeviceInfo::DeviceResourceRanges::Pool* pool; |
| 151 | |
| 152 | pool = range->add_pools(); |
| 153 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::ONU_ID); |
| 154 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::DEDICATED_PER_INTF); |
| 155 | pool->set_start(1); |
| 156 | pool->set_end(127); |
| 157 | |
| 158 | pool = range->add_pools(); |
| 159 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::ALLOC_ID); |
| 160 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_SAME_TECH); |
| 161 | pool->set_start(256); |
| 162 | pool->set_end(757); |
| 163 | |
| 164 | pool = range->add_pools(); |
| 165 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::GEMPORT_ID); |
| 166 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_ALL_TECH); |
| 167 | pool->set_start(256); |
| 168 | pool->set_end(4095); |
| 169 | |
| 170 | pool = range->add_pools(); |
| 171 | pool->set_type(openolt::DeviceInfo::DeviceResourceRanges::Pool::FLOW_ID); |
| 172 | pool->set_sharing(openolt::DeviceInfo::DeviceResourceRanges::Pool::SHARED_BY_ALL_INTF_ALL_TECH); |
| 173 | pool->set_start(1); |
| 174 | pool->set_end(16383); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | range->add_intf_ids(intf_id); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 179 | } |
Nicolas Palpacuer | f0b0249 | 2018-09-10 10:21:29 -0400 | [diff] [blame] | 180 | |
| 181 | // FIXME: Once dependency problem is fixed |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 182 | // device_info->set_pon_ports(num_of_pon_ports); |
Nicolas Palpacuer | f0b0249 | 2018-09-10 10:21:29 -0400 | [diff] [blame] | 183 | // device_info->set_onu_id_end(XGPON_NUM_OF_ONUS - 1); |
| 184 | // device_info->set_alloc_id_start(1024); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 185 | // device_info->set_alloc_id_end(XGPON_NUM_OF_ALLOC_IDS * num_of_pon_ports ? - 1); |
Nicolas Palpacuer | f0b0249 | 2018-09-10 10:21:29 -0400 | [diff] [blame] | 186 | // device_info->set_gemport_id_start(XGPON_MIN_BASE_SERVICE_PORT_ID); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 187 | // device_info->set_gemport_id_end(XGPON_NUM_OF_GEM_PORT_IDS_PER_PON * num_of_pon_ports ? - 1); |
| 188 | // device_info->set_pon_ports(num_of_pon_ports); |
Nicolas Palpacuer | dff9679 | 2018-09-06 14:59:32 -0400 | [diff] [blame] | 189 | |
| 190 | return Status::OK; |
| 191 | } |
| 192 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 193 | Status Enable_(int argc, char *argv[]) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 194 | bcmbal_access_terminal_cfg acc_term_obj; |
| 195 | bcmbal_access_terminal_key key = { }; |
| 196 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 197 | if (!state.is_activated()) { |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 198 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 199 | vendor_init(); |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 200 | bcmbal_init(argc, argv, NULL); |
| 201 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 202 | BCM_LOG(INFO, openolt_log_id, "Enable OLT - %s-%s\n", VENDOR_ID, MODEL_ID); |
| 203 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 204 | Status status = SubscribeIndication(); |
| 205 | if (!status.ok()) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 206 | BCM_LOG(ERROR, openolt_log_id, "SubscribeIndication failed - %s : %s\n", |
| 207 | grpc_status_code_to_string(status.error_code()).c_str(), |
| 208 | status.error_message().c_str()); |
| 209 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 210 | return status; |
| 211 | } |
| 212 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 213 | key.access_term_id = DEFAULT_ATERM_ID; |
| 214 | BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key); |
| 215 | BCMBAL_CFG_PROP_SET(&acc_term_obj, access_terminal, admin_state, BCMBAL_STATE_UP); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 216 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(acc_term_obj.hdr)); |
| 217 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 218 | BCM_LOG(ERROR, openolt_log_id, "Failed to enable OLT\n"); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 219 | return bcm_to_grpc_err(err, "Failed to enable OLT"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 220 | } |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 221 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 222 | init_stats(); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 223 | } |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 224 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 225 | //If already enabled, generate an extra indication ???? |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 226 | return Status::OK; |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | Status Disable_() { |
| 230 | // bcmbal_access_terminal_cfg acc_term_obj; |
| 231 | // bcmbal_access_terminal_key key = { }; |
| 232 | // |
| 233 | // if (state::is_activated) { |
| 234 | // std::cout << "Disable OLT" << std::endl; |
| 235 | // key.access_term_id = DEFAULT_ATERM_ID; |
| 236 | // BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key); |
| 237 | // BCMBAL_CFG_PROP_SET(&acc_term_obj, access_terminal, admin_state, BCMBAL_STATE_DOWN); |
| 238 | // bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(acc_term_obj.hdr)); |
| 239 | // if (err) { |
| 240 | // std::cout << "ERROR: Failed to disable OLT" << std::endl; |
| 241 | // return bcm_to_grpc_err(err, "Failed to disable OLT"); |
| 242 | // } |
| 243 | // } |
| 244 | // //If already disabled, generate an extra indication ???? |
| 245 | // return Status::OK; |
| 246 | //This fails with Operation Not Supported, bug ??? |
| 247 | |
| 248 | //TEMPORARY WORK AROUND |
| 249 | Status status = DisableUplinkIf_(0); |
| 250 | if (status.ok()) { |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 251 | state.deactivate(); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 252 | openolt::Indication ind; |
| 253 | openolt::OltIndication* olt_ind = new openolt::OltIndication; |
| 254 | olt_ind->set_oper_state("down"); |
| 255 | ind.set_allocated_olt_ind(olt_ind); |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 256 | BCM_LOG(INFO, openolt_log_id, "Disable OLT, add an extra indication\n"); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 257 | oltIndQ.push(ind); |
| 258 | } |
| 259 | return status; |
| 260 | |
| 261 | } |
| 262 | |
| 263 | Status Reenable_() { |
| 264 | Status status = EnableUplinkIf_(0); |
| 265 | if (status.ok()) { |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 266 | state.activate(); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 267 | openolt::Indication ind; |
| 268 | openolt::OltIndication* olt_ind = new openolt::OltIndication; |
| 269 | olt_ind->set_oper_state("up"); |
| 270 | ind.set_allocated_olt_ind(olt_ind); |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 271 | BCM_LOG(INFO, openolt_log_id, "Reenable OLT, add an extra indication\n"); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 272 | oltIndQ.push(ind); |
| 273 | } |
| 274 | return status; |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | Status EnablePonIf_(uint32_t intf_id) { |
| 278 | bcmbal_interface_cfg interface_obj; |
| 279 | bcmbal_interface_key interface_key; |
| 280 | |
| 281 | interface_key.intf_id = intf_id; |
| 282 | interface_key.intf_type = BCMBAL_INTF_TYPE_PON; |
| 283 | |
| 284 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 285 | |
| 286 | BCMBAL_CFG_PROP_GET(&interface_obj, interface, admin_state); |
| 287 | bcmos_errno err = bcmbal_cfg_get(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 288 | if (err == BCM_ERR_OK && interface_obj.data.admin_state == BCMBAL_STATE_UP) { |
| 289 | BCM_LOG(DEBUG, openolt_log_id, "PON interface: %d already enabled\n", intf_id); |
| 290 | return Status::OK; |
| 291 | } |
| 292 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 293 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_UP); |
| 294 | |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 295 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 296 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 297 | BCM_LOG(ERROR, openolt_log_id, "Failed to enable PON interface: %d\n", intf_id); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 298 | return bcm_to_grpc_err(err, "Failed to enable PON interface"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | return Status::OK; |
| 302 | } |
| 303 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 304 | Status DisableUplinkIf_(uint32_t intf_id) { |
| 305 | bcmbal_interface_cfg interface_obj; |
| 306 | bcmbal_interface_key interface_key; |
| 307 | |
| 308 | interface_key.intf_id = intf_id; |
| 309 | interface_key.intf_type = BCMBAL_INTF_TYPE_NNI; |
| 310 | |
| 311 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 312 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_DOWN); |
| 313 | |
| 314 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 315 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 316 | BCM_LOG(ERROR, openolt_log_id, "Failed to disable Uplink interface: %d\n", intf_id); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 317 | return bcm_to_grpc_err(err, "Failed to disable Uplink interface"); |
| 318 | } |
| 319 | |
| 320 | return Status::OK; |
| 321 | } |
| 322 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 323 | Status ProbeDeviceCapabilities_() { |
| 324 | bcmbal_access_terminal_cfg acc_term_obj; |
| 325 | bcmbal_access_terminal_key key = { }; |
| 326 | |
| 327 | key.access_term_id = DEFAULT_ATERM_ID; |
| 328 | BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key); |
| 329 | BCMBAL_CFG_PROP_GET(&acc_term_obj, access_terminal, admin_state); |
| 330 | BCMBAL_CFG_PROP_GET(&acc_term_obj, access_terminal, oper_status); |
| 331 | BCMBAL_CFG_PROP_GET(&acc_term_obj, access_terminal, topology); |
| 332 | BCMBAL_CFG_PROP_GET(&acc_term_obj, access_terminal, sw_version); |
| 333 | BCMBAL_CFG_PROP_GET(&acc_term_obj, access_terminal, conn_id); |
| 334 | bcmos_errno err = bcmbal_cfg_get(DEFAULT_ATERM_ID, &(acc_term_obj.hdr)); |
| 335 | if (err) { |
| 336 | BCM_LOG(ERROR, openolt_log_id, "Failed to query OLT\n"); |
| 337 | return bcm_to_grpc_err(err, "Failed to query OLT"); |
| 338 | } |
| 339 | |
| 340 | BCM_LOG(INFO, openolt_log_id, "OLT capabilitites, admin_state: %s oper_state: %s\n", |
| 341 | acc_term_obj.data.admin_state == BCMBAL_STATE_UP ? "up" : "down", |
| 342 | acc_term_obj.data.oper_status == BCMBAL_STATUS_UP ? "up" : "down"); |
| 343 | |
| 344 | std::string bal_version; |
| 345 | bal_version += std::to_string(acc_term_obj.data.sw_version.major_rev) |
| 346 | + "." + std::to_string(acc_term_obj.data.sw_version.minor_rev) |
| 347 | + "." + std::to_string(acc_term_obj.data.sw_version.release_rev); |
| 348 | firmware_version = "BAL." + bal_version + "__" + firmware_version; |
| 349 | |
| 350 | BCM_LOG(INFO, openolt_log_id, "--------------- version %s object model: %d\n", bal_version.c_str(), |
| 351 | acc_term_obj.data.sw_version.om_version); |
| 352 | |
| 353 | BCM_LOG(INFO, openolt_log_id, "--------------- topology nni:%d pon:%d dev:%d ppd:%d family: %d:%d\n", |
| 354 | acc_term_obj.data.topology.num_of_nni_ports, |
| 355 | acc_term_obj.data.topology.num_of_pon_ports, |
| 356 | acc_term_obj.data.topology.num_of_mac_devs, |
| 357 | acc_term_obj.data.topology.num_of_pons_per_mac_dev, |
| 358 | acc_term_obj.data.topology.pon_family, |
| 359 | acc_term_obj.data.topology.pon_sub_family |
| 360 | ); |
| 361 | |
| 362 | switch(acc_term_obj.data.topology.pon_sub_family) |
| 363 | { |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 364 | case BCMBAL_PON_SUB_FAMILY_GPON: board_technology = "gpon"; break; |
| 365 | case BCMBAL_PON_SUB_FAMILY_XGS: board_technology = "xgspon"; break; |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | num_of_nni_ports = acc_term_obj.data.topology.num_of_nni_ports; |
| 369 | num_of_pon_ports = acc_term_obj.data.topology.num_of_pon_ports; |
| 370 | |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 371 | BCM_LOG(INFO, openolt_log_id, "PON num_intfs: %d global board_technology: %s\n", num_of_pon_ports, board_technology.c_str()); |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 372 | |
| 373 | return Status::OK; |
| 374 | } |
| 375 | |
| 376 | Status ProbePonIfTechnology_() { |
| 377 | // Probe maximum extent possible as configured into BAL driver to determine |
| 378 | // which are active in the current BAL topology. And for those |
| 379 | // that are active, determine each port's access technology, i.e. "gpon" or "xgspon". |
| 380 | for (uint32_t intf_id = 0; intf_id < num_of_pon_ports; ++intf_id) { |
| 381 | bcmbal_interface_cfg interface_obj; |
| 382 | bcmbal_interface_key interface_key; |
| 383 | |
| 384 | interface_key.intf_id = intf_id; |
| 385 | interface_key.intf_type = BCMBAL_INTF_TYPE_PON; |
| 386 | |
| 387 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 388 | BCMBAL_CFG_PROP_GET(&interface_obj, interface, admin_state); |
| 389 | BCMBAL_CFG_PROP_GET(&interface_obj, interface, transceiver_type); |
| 390 | |
| 391 | bcmos_errno err = bcmbal_cfg_get(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 392 | if (err != BCM_ERR_OK) { |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 393 | intf_technologies[intf_id] = UNKNOWN_TECH; |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 394 | if(err != BCM_ERR_RANGE) BCM_LOG(ERROR, openolt_log_id, "Failed to get PON config: %d\n", intf_id); |
| 395 | } |
| 396 | else { |
| 397 | switch(interface_obj.data.transceiver_type) { |
| 398 | case BCMBAL_TRX_TYPE_GPON_SPS_43_48: |
| 399 | case BCMBAL_TRX_TYPE_GPON_SPS_SOG_4321: |
| 400 | case BCMBAL_TRX_TYPE_GPON_LTE_3680_M: |
| 401 | case BCMBAL_TRX_TYPE_GPON_SOURCE_PHOTONICS: |
| 402 | case BCMBAL_TRX_TYPE_GPON_LTE_3680_P: |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 403 | intf_technologies[intf_id] = "gpon"; |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 404 | break; |
| 405 | default: |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 406 | intf_technologies[intf_id] = "xgspon"; |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 407 | break; |
| 408 | } |
Craig Lutgen | b2601f0 | 2018-10-23 13:04:31 -0500 | [diff] [blame] | 409 | BCM_LOG(INFO, openolt_log_id, "PON intf_id: %d intf_technologies: %d:%s\n", intf_id, |
| 410 | interface_obj.data.transceiver_type, intf_technologies[intf_id].c_str()); |
| 411 | |
| 412 | if (board_technology != UNKNOWN_TECH) { |
| 413 | board_technology = intf_technologies[intf_id]; |
| 414 | } else if (board_technology != MIXED_TECH && board_technology != intf_technologies[intf_id]) { |
| 415 | intf_technologies[intf_id] = MIXED_TECH; |
| 416 | } |
| 417 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 418 | } |
| 419 | } |
| 420 | |
| 421 | return Status::OK; |
| 422 | } |
| 423 | |
| 424 | unsigned NumNniIf_() {return num_of_nni_ports;} |
| 425 | unsigned NumPonIf_() {return num_of_pon_ports;} |
| 426 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 427 | Status EnableUplinkIf_(uint32_t intf_id) { |
| 428 | bcmbal_interface_cfg interface_obj; |
| 429 | bcmbal_interface_key interface_key; |
| 430 | |
| 431 | interface_key.intf_id = intf_id; |
| 432 | interface_key.intf_type = BCMBAL_INTF_TYPE_NNI; |
| 433 | |
| 434 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 435 | |
| 436 | BCMBAL_CFG_PROP_GET(&interface_obj, interface, admin_state); |
| 437 | bcmos_errno err = bcmbal_cfg_get(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 438 | if (err == BCM_ERR_OK && interface_obj.data.admin_state == BCMBAL_STATE_UP) { |
| 439 | BCM_LOG(DEBUG, openolt_log_id, "Uplink interface: %d already enabled\n", intf_id); |
| 440 | return Status::OK; |
| 441 | } |
| 442 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 443 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_UP); |
| 444 | |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 445 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 446 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 447 | BCM_LOG(ERROR, openolt_log_id, "Failed to enable Uplink interface: %d\n", intf_id); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 448 | return bcm_to_grpc_err(err, "Failed to enable Uplink interface"); |
| 449 | } |
| 450 | |
| 451 | return Status::OK; |
| 452 | } |
| 453 | |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 454 | Status DisablePonIf_(uint32_t intf_id) { |
| 455 | bcmbal_interface_cfg interface_obj; |
| 456 | bcmbal_interface_key interface_key; |
| 457 | |
| 458 | interface_key.intf_id = intf_id; |
| 459 | interface_key.intf_type = BCMBAL_INTF_TYPE_PON; |
| 460 | |
| 461 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 462 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_DOWN); |
| 463 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 464 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 465 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 466 | BCM_LOG(ERROR, openolt_log_id, "Failed to disable PON interface: %d\n", intf_id); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 467 | return bcm_to_grpc_err(err, "Failed to disable PON interface"); |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 468 | } |
| 469 | |
| 470 | return Status::OK; |
| 471 | } |
| 472 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 473 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 474 | const char *vendor_id, const char *vendor_specific, uint32_t pir, |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 475 | uint32_t alloc_id) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 476 | |
| 477 | bcmbal_subscriber_terminal_cfg sub_term_obj = {}; |
| 478 | bcmbal_subscriber_terminal_key subs_terminal_key; |
| 479 | bcmbal_serial_number serial_num = {}; |
| 480 | bcmbal_registration_id registration_id = {}; |
| 481 | |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 482 | BCM_LOG(INFO, openolt_log_id, "Enabling ONU %d on PON %d : vendor id %s, vendor specific %s, pir %d, alloc_id %d\n", |
| 483 | onu_id, intf_id, vendor_id, vendor_specific_to_str(vendor_specific).c_str(), pir, alloc_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 484 | |
| 485 | subs_terminal_key.sub_term_id = onu_id; |
| 486 | subs_terminal_key.intf_id = intf_id; |
| 487 | BCMBAL_CFG_INIT(&sub_term_obj, subscriber_terminal, subs_terminal_key); |
| 488 | |
| 489 | memcpy(serial_num.vendor_id, vendor_id, 4); |
| 490 | memcpy(serial_num.vendor_specific, vendor_specific, 4); |
| 491 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, serial_number, serial_num); |
| 492 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 493 | #if 0 |
| 494 | // Commenting out as this is causing issues with onu activation |
| 495 | // with BAL 2.6 (Broadcom CS5248819). |
| 496 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 497 | // FIXME - Use a default (all zeros) registration id. |
| 498 | memset(registration_id.arr, 0, sizeof(registration_id.arr)); |
| 499 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, registration_id, registration_id); |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 500 | #endif |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 501 | |
| 502 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_UP); |
| 503 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 504 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr)); |
| 505 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 506 | BCM_LOG(ERROR, openolt_log_id, "Failed to enable ONU %d on PON %d\n", onu_id, intf_id); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 507 | return bcm_to_grpc_err(err, "Failed to enable ONU"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 508 | } |
| 509 | |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 510 | if (alloc_id != 0) { |
| 511 | // Use alloc_id as both agg_port_id and sched_id. |
| 512 | // Additional Notes: |
| 513 | // The agg_port_id is a BAL nomenclature for alloc_id (TCONT identifier). |
| 514 | // The TCONT is associated with its own DBA scheduler with a unique scheduler ID. |
| 515 | // Use the alloc_id itself as the DBA Scheduler identifier (sched_id). |
| 516 | return SchedAdd_(intf_id, onu_id, alloc_id, alloc_id, pir); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 517 | } else { |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 518 | return SchedAdd_(intf_id, onu_id, mk_agg_port_id(intf_id, onu_id), mk_sched_id(intf_id, onu_id), pir); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 519 | } |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 520 | |
| 521 | //return Status::OK; |
| 522 | } |
| 523 | |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 524 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 525 | const char *vendor_id, const char *vendor_specific) { |
| 526 | |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 527 | bcmbal_subscriber_terminal_cfg sub_term_obj = {}; |
| 528 | bcmbal_subscriber_terminal_key subs_terminal_key; |
| 529 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 530 | BCM_LOG(INFO, openolt_log_id, "Deactivating ONU %d on PON %d : vendor id %s, vendor specific %s\n", |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 531 | onu_id, intf_id, vendor_id, vendor_specific_to_str(vendor_specific).c_str()); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 532 | |
| 533 | subs_terminal_key.sub_term_id = onu_id; |
| 534 | subs_terminal_key.intf_id = intf_id; |
| 535 | BCMBAL_CFG_INIT(&sub_term_obj, subscriber_terminal, subs_terminal_key); |
| 536 | |
| 537 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_DOWN); |
| 538 | |
| 539 | if (bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr))) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 540 | BCM_LOG(ERROR, openolt_log_id, "Failed to deactivate ONU %d on PON %d\n", onu_id, intf_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 541 | return Status(grpc::StatusCode::INTERNAL, "Failed to deactivate ONU"); |
| 542 | } |
| 543 | |
| 544 | return Status::OK; |
| 545 | } |
| 546 | |
| 547 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 548 | const char *vendor_id, const char *vendor_specific, |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 549 | uint32_t alloc_id) { |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 550 | |
Craig Lutgen | d0bae9b | 2018-10-18 18:02:07 -0500 | [diff] [blame] | 551 | BCM_LOG(INFO, openolt_log_id, "DeleteOnu ONU %d on PON %d : vendor id %s, vendor specific %s\n", |
| 552 | onu_id, intf_id, vendor_id, vendor_specific_to_str(vendor_specific).c_str()); |
| 553 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 554 | // Need to deactivate before removing it (BAL rules) |
| 555 | |
| 556 | DeactivateOnu_(intf_id, onu_id, vendor_id, vendor_specific); |
| 557 | // Sleep to allow the state to propagate |
| 558 | // We need the subscriber terminal object to be admin down before removal |
| 559 | // Without sleep the race condition is lost by ~ 20 ms |
| 560 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
| 561 | |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 562 | if (alloc_id != 0) { |
| 563 | // Use alloc_id as both agg_port_id and sched_id |
| 564 | // Additional Notes: |
| 565 | // The agg_port_id is a BAL nomenclature for alloc_id (TCONT identifier). |
| 566 | // The TCONT is associated with its own DBA scheduler with a unique scheduler ID. |
| 567 | // Use the alloc_id itself as the DBA Scheduler identifier (sched_id). |
| 568 | SchedRemove_(intf_id, onu_id, alloc_id, alloc_id); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 569 | } else { |
Girish Gowdru | 0ffa48b | 2018-09-26 01:55:29 -0700 | [diff] [blame] | 570 | SchedRemove_(intf_id, onu_id, mk_agg_port_id(intf_id, onu_id), mk_sched_id(intf_id, onu_id)); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 571 | } |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 572 | |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 573 | bcmos_errno err = BCM_ERR_OK; |
| 574 | bcmbal_subscriber_terminal_cfg cfg; |
| 575 | bcmbal_subscriber_terminal_key key = { }; |
| 576 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 577 | BCM_LOG(INFO, openolt_log_id, "Processing subscriber terminal cfg clear for sub_term_id %d and intf_id %d\n", |
| 578 | onu_id, intf_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 579 | |
| 580 | key.sub_term_id = onu_id ; |
| 581 | key.intf_id = intf_id ; |
| 582 | |
| 583 | if (0 == key.sub_term_id) |
| 584 | { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 585 | BCM_LOG(INFO, openolt_log_id,"Invalid Key to handle subscriber terminal clear subscriber_terminal_id %d, Interface ID %d\n", |
| 586 | onu_id, intf_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 587 | return Status(grpc::StatusCode::INTERNAL, "Failed to delete ONU"); |
| 588 | } |
| 589 | |
| 590 | BCMBAL_CFG_INIT(&cfg, subscriber_terminal, key); |
| 591 | |
| 592 | err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &cfg.hdr); |
| 593 | if (err != BCM_ERR_OK) |
| 594 | { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 595 | BCM_LOG(ERROR, openolt_log_id, "Failed to clear information for BAL subscriber_terminal_id %d, Interface ID %d\n", |
| 596 | onu_id, intf_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 597 | return Status(grpc::StatusCode::INTERNAL, "Failed to delete ONU"); |
| 598 | } |
| 599 | |
| 600 | return Status::OK;; |
| 601 | } |
| 602 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 603 | #define MAX_CHAR_LENGTH 20 |
| 604 | #define MAX_OMCI_MSG_LENGTH 44 |
| 605 | Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) { |
| 606 | bcmbal_u8_list_u32_max_2048 buf; /* A structure with a msg pointer and length value */ |
| 607 | bcmos_errno err = BCM_ERR_OK; |
| 608 | |
| 609 | /* The destination of the OMCI packet is a registered ONU on the OLT PON interface */ |
| 610 | bcmbal_dest proxy_pkt_dest; |
| 611 | |
| 612 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_ITU_OMCI_CHANNEL; |
| 613 | proxy_pkt_dest.u.itu_omci_channel.sub_term_id = onu_id; |
| 614 | proxy_pkt_dest.u.itu_omci_channel.intf_id = intf_id; |
| 615 | |
| 616 | // ??? |
| 617 | if ((pkt.size()/2) > MAX_OMCI_MSG_LENGTH) { |
| 618 | buf.len = MAX_OMCI_MSG_LENGTH; |
| 619 | } else { |
| 620 | buf.len = pkt.size()/2; |
| 621 | } |
| 622 | |
| 623 | /* Send the OMCI packet using the BAL remote proxy API */ |
| 624 | uint16_t idx1 = 0; |
| 625 | uint16_t idx2 = 0; |
| 626 | uint8_t arraySend[buf.len]; |
| 627 | char str1[MAX_CHAR_LENGTH]; |
| 628 | char str2[MAX_CHAR_LENGTH]; |
| 629 | memset(&arraySend, 0, buf.len); |
| 630 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 631 | for (idx1=0,idx2=0; idx1<((buf.len)*2); idx1++,idx2++) { |
| 632 | sprintf(str1,"%c", pkt[idx1]); |
| 633 | sprintf(str2,"%c", pkt[++idx1]); |
| 634 | strcat(str1,str2); |
| 635 | arraySend[idx2] = strtol(str1, NULL, 16); |
| 636 | } |
| 637 | |
| 638 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 639 | memcpy(buf.val, (uint8_t *)arraySend, buf.len); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 640 | |
| 641 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 642 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 643 | if (err) { |
| 644 | BCM_LOG(ERROR, omci_log_id, "Error sending OMCI message to ONU %d on PON %d\n", onu_id, intf_id); |
| 645 | } else { |
| 646 | BCM_LOG(DEBUG, omci_log_id, "OMCI request msg of length %d sent to ONU %d on PON %d : %s\n", |
Craig Lutgen | 88a22ad | 2018-10-04 12:30:46 -0500 | [diff] [blame] | 647 | buf.len, onu_id, intf_id, pkt.c_str()); |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 648 | } |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 649 | |
| 650 | free(buf.val); |
| 651 | |
| 652 | return Status::OK; |
| 653 | } |
| 654 | |
| 655 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) { |
| 656 | bcmos_errno err = BCM_ERR_OK; |
| 657 | bcmbal_dest proxy_pkt_dest; |
| 658 | bcmbal_u8_list_u32_max_2048 buf; |
| 659 | |
| 660 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_SUB_TERM, |
| 661 | proxy_pkt_dest.u.sub_term.sub_term_id = onu_id; |
| 662 | proxy_pkt_dest.u.sub_term.intf_id = intf_id; |
| 663 | |
| 664 | buf.len = pkt.size(); |
| 665 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 666 | memcpy(buf.val, (uint8_t *)pkt.data(), buf.len); |
| 667 | |
| 668 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 669 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 670 | BCM_LOG(INFO, openolt_log_id, "Packet out of length %d sent to ONU %d on PON %d\n", |
| 671 | buf.len, onu_id, intf_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 672 | |
| 673 | free(buf.val); |
| 674 | |
| 675 | return Status::OK; |
| 676 | } |
| 677 | |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 678 | Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt) { |
| 679 | bcmos_errno err = BCM_ERR_OK; |
| 680 | bcmbal_dest proxy_pkt_dest; |
| 681 | bcmbal_u8_list_u32_max_2048 buf; |
| 682 | |
| 683 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_NNI, |
| 684 | proxy_pkt_dest.u.nni.intf_id = intf_id; |
| 685 | |
| 686 | buf.len = pkt.size(); |
| 687 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 688 | memcpy(buf.val, (uint8_t *)pkt.data(), buf.len); |
| 689 | |
| 690 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 691 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 692 | BCM_LOG(INFO, openolt_log_id, "Packet out of length %d sent through uplink port %d\n", |
| 693 | buf.len, intf_id); |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 694 | |
| 695 | free(buf.val); |
| 696 | |
| 697 | return Status::OK; |
| 698 | } |
| 699 | |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 700 | Status FlowAdd_(int32_t onu_id, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 701 | uint32_t flow_id, const std::string flow_type, |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 702 | int32_t access_intf_id, int32_t network_intf_id, |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 703 | uint32_t gemport_id, uint32_t sched_id, |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 704 | int32_t priority_value, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 705 | const ::openolt::Classifier& classifier, |
| 706 | const ::openolt::Action& action) { |
| 707 | bcmos_errno err; |
| 708 | bcmbal_flow_cfg cfg; |
| 709 | bcmbal_flow_key key = { }; |
| 710 | |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 711 | BCM_LOG(INFO, openolt_log_id, "flow add - intf_id %d, onu_id %d, flow_id %d, `flow_type` %s, gemport_id %d, network_intf_id %d\n", |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 712 | access_intf_id, onu_id, flow_id, flow_type.c_str(), gemport_id, network_intf_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 713 | |
| 714 | key.flow_id = flow_id; |
| 715 | if (flow_type.compare("upstream") == 0 ) { |
| 716 | key.flow_type = BCMBAL_FLOW_TYPE_UPSTREAM; |
| 717 | } else if (flow_type.compare("downstream") == 0) { |
| 718 | key.flow_type = BCMBAL_FLOW_TYPE_DOWNSTREAM; |
| 719 | } else { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 720 | BCM_LOG(WARNING, openolt_log_id, "Invalid flow type %s\n", flow_type.c_str()); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 721 | return bcm_to_grpc_err(BCM_ERR_PARM, "Invalid flow type"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | BCMBAL_CFG_INIT(&cfg, flow, key); |
| 725 | |
| 726 | BCMBAL_CFG_PROP_SET(&cfg, flow, admin_state, BCMBAL_STATE_UP); |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 727 | if (access_intf_id >= 0) { |
| 728 | BCMBAL_CFG_PROP_SET(&cfg, flow, access_int_id, access_intf_id); |
| 729 | } |
| 730 | if (network_intf_id >= 0) { |
| 731 | BCMBAL_CFG_PROP_SET(&cfg, flow, network_int_id, network_intf_id); |
| 732 | } |
| 733 | if (onu_id >= 0) { |
| 734 | BCMBAL_CFG_PROP_SET(&cfg, flow, sub_term_id, onu_id); |
| 735 | } |
| 736 | if (gemport_id >= 0) { |
| 737 | BCMBAL_CFG_PROP_SET(&cfg, flow, svc_port_id, gemport_id); |
| 738 | } |
| 739 | if (priority_value >= 0) { |
| 740 | BCMBAL_CFG_PROP_SET(&cfg, flow, priority, priority_value); |
| 741 | } |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 742 | |
| 743 | { |
| 744 | bcmbal_classifier val = { }; |
| 745 | |
| 746 | if (classifier.o_tpid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 747 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, o_tpid, classifier.o_tpid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 748 | } |
| 749 | |
| 750 | if (classifier.o_vid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 751 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, o_vid, classifier.o_vid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | if (classifier.i_tpid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 755 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, i_tpid, classifier.i_tpid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 756 | } |
| 757 | |
| 758 | if (classifier.i_vid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 759 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, i_vid, classifier.i_vid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | if (classifier.o_pbits()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 763 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, o_pbits, classifier.o_pbits()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 764 | } |
| 765 | |
| 766 | if (classifier.i_pbits()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 767 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, i_pbits, classifier.i_pbits()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 768 | } |
| 769 | |
| 770 | if (classifier.eth_type()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 771 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, ether_type, classifier.eth_type()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 772 | } |
| 773 | |
| 774 | /* |
| 775 | if (classifier.dst_mac()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 776 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, dst_mac, classifier.dst_mac()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 777 | } |
| 778 | |
| 779 | if (classifier.src_mac()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 780 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, src_mac, classifier.src_mac()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 781 | } |
| 782 | */ |
| 783 | |
| 784 | if (classifier.ip_proto()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 785 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, ip_proto, classifier.ip_proto()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 786 | } |
| 787 | |
| 788 | /* |
| 789 | if (classifier.dst_ip()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 790 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, dst_ip, classifier.dst_ip()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 791 | } |
| 792 | |
| 793 | if (classifier.src_ip()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 794 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, src_ip, classifier.src_ip()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 795 | } |
| 796 | */ |
| 797 | |
| 798 | if (classifier.src_port()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 799 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, src_port, classifier.src_port()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | if (classifier.dst_port()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 803 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, dst_port, classifier.dst_port()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 804 | } |
| 805 | |
| 806 | if (!classifier.pkt_tag_type().empty()) { |
| 807 | if (classifier.pkt_tag_type().compare("untagged") == 0) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 808 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, pkt_tag_type, BCMBAL_PKT_TAG_TYPE_UNTAGGED); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 809 | } else if (classifier.pkt_tag_type().compare("single_tag") == 0) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 810 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, pkt_tag_type, BCMBAL_PKT_TAG_TYPE_SINGLE_TAG); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 811 | } else if (classifier.pkt_tag_type().compare("double_tag") == 0) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 812 | BCMBAL_ATTRIBUTE_PROP_SET(&val, classifier, pkt_tag_type, BCMBAL_PKT_TAG_TYPE_DOUBLE_TAG); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 813 | } |
| 814 | } |
| 815 | |
| 816 | BCMBAL_CFG_PROP_SET(&cfg, flow, classifier, val); |
| 817 | } |
| 818 | |
| 819 | { |
| 820 | bcmbal_action val = { }; |
| 821 | |
| 822 | const ::openolt::ActionCmd& cmd = action.cmd(); |
| 823 | |
| 824 | if (cmd.add_outer_tag()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 825 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, cmds_bitmask, BCMBAL_ACTION_CMD_ID_ADD_OUTER_TAG); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 826 | } |
| 827 | |
| 828 | if (cmd.remove_outer_tag()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 829 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, cmds_bitmask, BCMBAL_ACTION_CMD_ID_REMOVE_OUTER_TAG); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | if (cmd.trap_to_host()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 833 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, cmds_bitmask, BCMBAL_ACTION_CMD_ID_TRAP_TO_HOST); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 834 | } |
| 835 | |
| 836 | if (action.o_vid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 837 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, o_vid, action.o_vid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 838 | } |
| 839 | |
| 840 | if (action.o_pbits()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 841 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, o_pbits, action.o_pbits()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 842 | } |
| 843 | |
| 844 | if (action.o_tpid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 845 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, o_tpid, action.o_tpid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 846 | } |
| 847 | |
| 848 | if (action.i_vid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 849 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, i_vid, action.i_vid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 850 | } |
| 851 | |
| 852 | if (action.i_pbits()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 853 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, i_pbits, action.i_pbits()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 854 | } |
| 855 | |
| 856 | if (action.i_tpid()) { |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 857 | BCMBAL_ATTRIBUTE_PROP_SET(&val, action, i_tpid, action.i_tpid()); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 858 | } |
| 859 | |
| 860 | BCMBAL_CFG_PROP_SET(&cfg, flow, action, val); |
| 861 | } |
| 862 | |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 863 | if ((access_intf_id >= 0) && (onu_id >= 0)) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 864 | bcmbal_tm_sched_id val; |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 865 | if (sched_id != 0) { |
| 866 | val = sched_id; |
| 867 | } else { |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 868 | val = (bcmbal_tm_sched_id) mk_sched_id(access_intf_id, onu_id); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 869 | } |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 870 | BCMBAL_CFG_PROP_SET(&cfg, flow, dba_tm_sched_id, val); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 871 | |
Shad Ansari | 39739bc | 2018-09-13 21:38:37 +0000 | [diff] [blame] | 872 | if (key.flow_type == BCMBAL_FLOW_TYPE_DOWNSTREAM) { |
| 873 | bcmbal_tm_queue_ref val = { }; |
| 874 | val.sched_id = access_intf_id << 7 | onu_id; |
| 875 | val.queue_id = 0; |
| 876 | BCMBAL_CFG_PROP_SET(&cfg, flow, queue, val); |
| 877 | } |
Shad Ansari | 0610195 | 2018-07-25 00:22:09 +0000 | [diff] [blame] | 878 | } |
| 879 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 880 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr)); |
| 881 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 882 | BCM_LOG(ERROR, openolt_log_id, "Flow add failed\n"); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 883 | return bcm_to_grpc_err(err, "flow add failed"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 884 | } |
| 885 | |
Nicolas Palpacuer | 6a63ea9 | 2018-09-05 17:21:37 -0400 | [diff] [blame] | 886 | // register_new_flow(key); |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 887 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 888 | return Status::OK; |
| 889 | } |
| 890 | |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 891 | Status FlowRemove_(uint32_t flow_id, const std::string flow_type) { |
| 892 | |
| 893 | bcmbal_flow_cfg cfg; |
| 894 | bcmbal_flow_key key = { }; |
| 895 | |
| 896 | key.flow_id = (bcmbal_flow_id) flow_id; |
| 897 | key.flow_id = flow_id; |
| 898 | if (flow_type.compare("upstream") == 0 ) { |
| 899 | key.flow_type = BCMBAL_FLOW_TYPE_UPSTREAM; |
| 900 | } else if (flow_type.compare("downstream") == 0) { |
| 901 | key.flow_type = BCMBAL_FLOW_TYPE_DOWNSTREAM; |
| 902 | } else { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 903 | BCM_LOG(WARNING, openolt_log_id, "Invalid flow type %s\n", flow_type.c_str()); |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 904 | return bcm_to_grpc_err(BCM_ERR_PARM, "Invalid flow type"); |
| 905 | } |
| 906 | |
| 907 | BCMBAL_CFG_INIT(&cfg, flow, key); |
| 908 | |
| 909 | |
| 910 | bcmos_errno err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &cfg.hdr); |
| 911 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 912 | BCM_LOG(ERROR, openolt_log_id, "Error %d while removing flow %d, %s\n", |
| 913 | err, flow_id, flow_type.c_str()); |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 914 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove flow"); |
| 915 | } |
| 916 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 917 | BCM_LOG(INFO, openolt_log_id, "Flow %d, %s removed\n", flow_id, flow_type.c_str()); |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 918 | return Status::OK; |
| 919 | } |
| 920 | |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 921 | Status SchedAdd_(int intf_id, int onu_id, int agg_port_id, int sched_id, int pir) { |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 922 | |
| 923 | bcmos_errno err; |
| 924 | |
| 925 | /* Downstream */ |
| 926 | |
| 927 | /* Create subscriber's tm_sched */ |
| 928 | { |
| 929 | bcmbal_tm_sched_cfg cfg; |
| 930 | bcmbal_tm_sched_key key = { }; |
| 931 | key.dir = BCMBAL_TM_SCHED_DIR_DS; |
| 932 | key.id = intf_id << 7 | onu_id; |
| 933 | BCMBAL_CFG_INIT(&cfg, tm_sched, key); |
| 934 | |
| 935 | bcmbal_tm_sched_owner owner = { }; |
| 936 | owner.type = BCMBAL_TM_SCHED_OWNER_TYPE_SUB_TERM; |
| 937 | owner.u.sub_term.intf_id = intf_id; |
| 938 | owner.u.sub_term.sub_term_id = onu_id; |
| 939 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, owner, owner); |
| 940 | |
| 941 | bcmbal_tm_sched_parent parent = { }; |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 942 | |
| 943 | BCMBAL_ATTRIBUTE_PROP_SET(&parent, tm_sched_parent, sched_id, intf_id + BAL_RSC_MANAGER_BASE_TM_SCHED_ID); |
| 944 | |
| 945 | BCMBAL_ATTRIBUTE_PROP_SET(&parent, tm_sched_parent, weight, 1); |
| 946 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 947 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, sched_parent, parent); |
| 948 | |
| 949 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, sched_type, BCMBAL_TM_SCHED_TYPE_WFQ); |
| 950 | |
| 951 | bcmbal_tm_shaping shaping = { }; |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 952 | BCMBAL_ATTRIBUTE_PROP_SET(&shaping, tm_shaping, pir, pir); |
| 953 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 954 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, rate, shaping); |
| 955 | |
| 956 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &cfg.hdr); |
| 957 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 958 | BCM_LOG(ERROR, openolt_log_id, "Failed to create subscriber downstream sched, id %d, intf_id %d, onu_id %d\n", |
| 959 | key.id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 960 | return bcm_to_grpc_err(err, "Failed to create subscriber downstream sched"); |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | /* Create tm_queue */ |
| 965 | { |
| 966 | bcmbal_tm_queue_cfg cfg; |
| 967 | bcmbal_tm_queue_key key = { }; |
| 968 | key.sched_id = intf_id << 7 | onu_id; |
| 969 | key.sched_dir = BCMBAL_TM_SCHED_DIR_DS; |
| 970 | key.id = 0; |
| 971 | |
| 972 | BCMBAL_CFG_INIT(&cfg, tm_queue, key); |
| 973 | BCMBAL_CFG_PROP_SET(&cfg, tm_queue, weight, 1); |
| 974 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &cfg.hdr); |
| 975 | |
| 976 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 977 | BCM_LOG(ERROR, openolt_log_id, "Failed to create subscriber downstream tm queue, id %d, sched_id %d, intf_id %d, onu_id %d\n", |
| 978 | key.id, key.sched_id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 979 | return bcm_to_grpc_err(err, "Failed to create subscriber downstream tm queue"); |
| 980 | } |
| 981 | |
| 982 | } |
| 983 | |
| 984 | /* Upstream */ |
| 985 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 986 | bcmbal_tm_sched_cfg cfg; |
| 987 | bcmbal_tm_sched_key key = { }; |
| 988 | bcmbal_tm_sched_type sched_type; |
| 989 | |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 990 | if (sched_id != 0) { |
| 991 | key.id = sched_id; |
| 992 | } else { |
Nicolas Palpacuer | 8ebaa26 | 2018-08-16 14:56:47 -0400 | [diff] [blame] | 993 | key.id = mk_sched_id(intf_id, onu_id); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 994 | } |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 995 | key.dir = BCMBAL_TM_SCHED_DIR_US; |
| 996 | |
| 997 | BCMBAL_CFG_INIT(&cfg, tm_sched, key); |
| 998 | |
| 999 | { |
| 1000 | bcmbal_tm_sched_owner val = { }; |
| 1001 | |
| 1002 | val.type = BCMBAL_TM_SCHED_OWNER_TYPE_AGG_PORT; |
Craig Lutgen | 1951231 | 2018-11-02 10:14:46 -0500 | [diff] [blame^] | 1003 | BCMBAL_ATTRIBUTE_PROP_SET(&val.u.agg_port, tm_sched_owner_agg_port, intf_id, (bcmbal_intf_id) intf_id); |
| 1004 | BCMBAL_ATTRIBUTE_PROP_SET(&val.u.agg_port, tm_sched_owner_agg_port, sub_term_id, (bcmbal_sub_id) onu_id); |
| 1005 | BCMBAL_ATTRIBUTE_PROP_SET(&val.u.agg_port, tm_sched_owner_agg_port, agg_port_id, (bcmbal_aggregation_port_id) agg_port_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1006 | |
| 1007 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, owner, val); |
| 1008 | } |
| 1009 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1010 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr)); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 1011 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1012 | BCM_LOG(ERROR, openolt_log_id, "Failed to create upstream DBA sched, id %d, intf_id %d, onu_id %d\n", |
| 1013 | key.id, intf_id, onu_id); |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 1014 | return bcm_to_grpc_err(err, "Failed to create upstream DBA sched"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1015 | } |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1016 | BCM_LOG(INFO, openolt_log_id, "Create upstream DBA sched, id %d, intf_id %d, onu_id %d\n", |
| 1017 | key.id,intf_id,onu_id); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1018 | |
| 1019 | return Status::OK; |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 1020 | } |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1021 | |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 1022 | Status SchedRemove_(int intf_id, int onu_id, int agg_port_id, int sched_id) { |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1023 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1024 | bcmos_errno err; |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1025 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1026 | /* Upstream */ |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1027 | |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1028 | bcmbal_tm_sched_cfg tm_cfg_us; |
| 1029 | bcmbal_tm_sched_key tm_key_us = { }; |
| 1030 | |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 1031 | if (sched_id != 0) { |
| 1032 | tm_key_us.id = sched_id; |
| 1033 | } else { |
Nicolas Palpacuer | 8ebaa26 | 2018-08-16 14:56:47 -0400 | [diff] [blame] | 1034 | tm_key_us.id = mk_sched_id(intf_id, onu_id); |
Girish Gowdru | 1cdf6ce | 2018-08-27 02:43:02 -0700 | [diff] [blame] | 1035 | } |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1036 | tm_key_us.dir = BCMBAL_TM_SCHED_DIR_US; |
| 1037 | |
| 1038 | BCMBAL_CFG_INIT(&tm_cfg_us, tm_sched, tm_key_us); |
| 1039 | |
| 1040 | err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &(tm_cfg_us.hdr)); |
| 1041 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1042 | BCM_LOG(ERROR, openolt_log_id, "Failed to remove upstream DBA sched, id %d, intf_id %d, onu_id %d\n", |
| 1043 | tm_key_us.id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1044 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove upstream DBA sched"); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1045 | } |
| 1046 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1047 | BCM_LOG(INFO, openolt_log_id, "Remove upstream DBA sched, id %d, intf_id %d, onu_id %d\n", |
| 1048 | tm_key_us.id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1049 | |
| 1050 | /* Downstream */ |
| 1051 | |
| 1052 | // Queue |
| 1053 | |
| 1054 | bcmbal_tm_queue_cfg queue_cfg; |
| 1055 | bcmbal_tm_queue_key queue_key = { }; |
| 1056 | queue_key.sched_id = intf_id << 7 | onu_id; |
| 1057 | queue_key.sched_dir = BCMBAL_TM_SCHED_DIR_DS; |
| 1058 | queue_key.id = 0; |
| 1059 | |
| 1060 | BCMBAL_CFG_INIT(&queue_cfg, tm_queue, queue_key); |
| 1061 | |
| 1062 | err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &(queue_cfg.hdr)); |
| 1063 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1064 | BCM_LOG(ERROR, openolt_log_id, "Failed to remove downstream tm queue, id %d, sched_id %d, intf_id %d, onu_id %d\n", |
| 1065 | queue_key.id, queue_key.sched_id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1066 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove downstream tm queue"); |
| 1067 | } |
| 1068 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1069 | BCM_LOG(INFO, openolt_log_id, "Remove upstream DBA sched, id %d, sched_id %d, intf_id %d, onu_id %d\n", |
| 1070 | queue_key.id, queue_key.sched_id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1071 | |
| 1072 | // Sheduler |
| 1073 | |
| 1074 | bcmbal_tm_sched_cfg tm_cfg_ds; |
| 1075 | bcmbal_tm_sched_key tm_key_ds = { }; |
| 1076 | tm_key_ds.dir = BCMBAL_TM_SCHED_DIR_DS; |
| 1077 | tm_key_ds.id = intf_id << 7 | onu_id; |
| 1078 | BCMBAL_CFG_INIT(&tm_cfg_ds, tm_sched, tm_key_ds); |
| 1079 | |
| 1080 | err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &(tm_cfg_ds.hdr)); |
| 1081 | if (err) { |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1082 | BCM_LOG(ERROR, openolt_log_id, "Failed to remove sub downstream sched, id %d, intf_id %d, onu_id %d\n", |
| 1083 | tm_key_us.id, intf_id, onu_id); |
Nicolas Palpacuer | 9c35208 | 2018-08-14 16:37:14 -0400 | [diff] [blame] | 1084 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove sub downstream sched"); |
| 1085 | } |
| 1086 | |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 1087 | BCM_LOG(INFO, openolt_log_id, "Remove sub downstream sched, id %d, intf_id %d, onu_id %d\n", |
| 1088 | tm_key_us.id, intf_id, onu_id); |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 1089 | |
| 1090 | return Status::OK; |
| 1091 | //return 0; |
| 1092 | } |