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> |
| 25 | |
| 26 | #include "core.h" |
| 27 | #include "indications.h" |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 28 | #include "stats_collection.h" |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 29 | #include "error_format.h" |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 30 | #include "state.h" |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 31 | |
| 32 | extern "C" |
| 33 | { |
| 34 | #include <bcmos_system.h> |
| 35 | #include <bal_api.h> |
| 36 | #include <bal_api_end.h> |
| 37 | } |
| 38 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 39 | State state; |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 40 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame^] | 41 | static Status SchedAdd_(int intf_id, int onu_id, int agg_port_id); |
| 42 | static Status SchedRemove_(int intf_id, int onu_id, int agg_port_id); |
| 43 | |
| 44 | static inline int mk_sched_id(int onu_id) { |
| 45 | return 1023 + onu_id; |
| 46 | } |
| 47 | |
| 48 | static inline int mk_agg_port_id(int onu_id) { |
| 49 | return 1023 + onu_id; |
| 50 | } |
| 51 | |
| 52 | Status Enable_(int argc, char *argv[]) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 53 | bcmbal_access_terminal_cfg acc_term_obj; |
| 54 | bcmbal_access_terminal_key key = { }; |
| 55 | |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 56 | if (!state.is_activated()) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 57 | std::cout << "Enable OLT" << std::endl; |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame^] | 58 | |
| 59 | bcmbal_init(argc, argv, NULL); |
| 60 | |
| 61 | Status status = SubscribeIndication(); |
| 62 | if (!status.ok()) { |
| 63 | std::cout << "ERROR: SubscribeIndication failed - " |
| 64 | << status.error_code() << ": " << status.error_message() |
| 65 | << std::endl; |
| 66 | return status; |
| 67 | } |
| 68 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 69 | key.access_term_id = DEFAULT_ATERM_ID; |
| 70 | BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key); |
| 71 | 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] | 72 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(acc_term_obj.hdr)); |
| 73 | if (err) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 74 | std::cout << "ERROR: Failed to enable OLT" << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 75 | return bcm_to_grpc_err(err, "Failed to enable OLT"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 76 | } |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 77 | init_stats(); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 78 | } |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 79 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 80 | //If already enabled, generate an extra indication ???? |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 81 | return Status::OK; |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | Status Disable_() { |
| 85 | // bcmbal_access_terminal_cfg acc_term_obj; |
| 86 | // bcmbal_access_terminal_key key = { }; |
| 87 | // |
| 88 | // if (state::is_activated) { |
| 89 | // std::cout << "Disable OLT" << std::endl; |
| 90 | // key.access_term_id = DEFAULT_ATERM_ID; |
| 91 | // BCMBAL_CFG_INIT(&acc_term_obj, access_terminal, key); |
| 92 | // BCMBAL_CFG_PROP_SET(&acc_term_obj, access_terminal, admin_state, BCMBAL_STATE_DOWN); |
| 93 | // bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(acc_term_obj.hdr)); |
| 94 | // if (err) { |
| 95 | // std::cout << "ERROR: Failed to disable OLT" << std::endl; |
| 96 | // return bcm_to_grpc_err(err, "Failed to disable OLT"); |
| 97 | // } |
| 98 | // } |
| 99 | // //If already disabled, generate an extra indication ???? |
| 100 | // return Status::OK; |
| 101 | //This fails with Operation Not Supported, bug ??? |
| 102 | |
| 103 | //TEMPORARY WORK AROUND |
| 104 | Status status = DisableUplinkIf_(0); |
| 105 | if (status.ok()) { |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 106 | state.deactivate(); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 107 | openolt::Indication ind; |
| 108 | openolt::OltIndication* olt_ind = new openolt::OltIndication; |
| 109 | olt_ind->set_oper_state("down"); |
| 110 | ind.set_allocated_olt_ind(olt_ind); |
| 111 | std::cout << "Disable OLT, add an extra indication" << std::endl; |
| 112 | oltIndQ.push(ind); |
| 113 | } |
| 114 | return status; |
| 115 | |
| 116 | } |
| 117 | |
| 118 | Status Reenable_() { |
| 119 | Status status = EnableUplinkIf_(0); |
| 120 | if (status.ok()) { |
Shad Ansari | edef213 | 2018-08-10 22:14:50 +0000 | [diff] [blame] | 121 | state.activate(); |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 122 | openolt::Indication ind; |
| 123 | openolt::OltIndication* olt_ind = new openolt::OltIndication; |
| 124 | olt_ind->set_oper_state("up"); |
| 125 | ind.set_allocated_olt_ind(olt_ind); |
| 126 | std::cout << "Reenable OLT, add an extra indication" << std::endl; |
| 127 | oltIndQ.push(ind); |
| 128 | } |
| 129 | return status; |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | Status EnablePonIf_(uint32_t intf_id) { |
| 133 | bcmbal_interface_cfg interface_obj; |
| 134 | bcmbal_interface_key interface_key; |
| 135 | |
| 136 | interface_key.intf_id = intf_id; |
| 137 | interface_key.intf_type = BCMBAL_INTF_TYPE_PON; |
| 138 | |
| 139 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 140 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_UP); |
| 141 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 142 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 143 | if (err) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 144 | std::cout << "ERROR: Failed to enable PON interface: " << intf_id << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 145 | return bcm_to_grpc_err(err, "Failed to enable PON interface"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | return Status::OK; |
| 149 | } |
| 150 | |
Nicolas Palpacuer | e3fc0d2 | 2018-08-02 16:51:05 -0400 | [diff] [blame] | 151 | Status DisableUplinkIf_(uint32_t intf_id) { |
| 152 | bcmbal_interface_cfg interface_obj; |
| 153 | bcmbal_interface_key interface_key; |
| 154 | |
| 155 | interface_key.intf_id = intf_id; |
| 156 | interface_key.intf_type = BCMBAL_INTF_TYPE_NNI; |
| 157 | |
| 158 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 159 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_DOWN); |
| 160 | |
| 161 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 162 | if (err) { |
| 163 | std::cout << "ERROR: Failed to disable Uplink interface: " << intf_id << std::endl; |
| 164 | return bcm_to_grpc_err(err, "Failed to disable Uplink interface"); |
| 165 | } |
| 166 | |
| 167 | return Status::OK; |
| 168 | } |
| 169 | |
| 170 | Status EnableUplinkIf_(uint32_t intf_id) { |
| 171 | bcmbal_interface_cfg interface_obj; |
| 172 | bcmbal_interface_key interface_key; |
| 173 | |
| 174 | interface_key.intf_id = intf_id; |
| 175 | interface_key.intf_type = BCMBAL_INTF_TYPE_NNI; |
| 176 | |
| 177 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 178 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_UP); |
| 179 | |
| 180 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 181 | if (err) { |
| 182 | std::cout << "ERROR: Failed to enable Uplink interface: " << intf_id << std::endl; |
| 183 | return bcm_to_grpc_err(err, "Failed to enable Uplink interface"); |
| 184 | } |
| 185 | |
| 186 | return Status::OK; |
| 187 | } |
| 188 | |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 189 | Status DisablePonIf_(uint32_t intf_id) { |
| 190 | bcmbal_interface_cfg interface_obj; |
| 191 | bcmbal_interface_key interface_key; |
| 192 | |
| 193 | interface_key.intf_id = intf_id; |
| 194 | interface_key.intf_type = BCMBAL_INTF_TYPE_PON; |
| 195 | |
| 196 | BCMBAL_CFG_INIT(&interface_obj, interface, interface_key); |
| 197 | BCMBAL_CFG_PROP_SET(&interface_obj, interface, admin_state, BCMBAL_STATE_DOWN); |
| 198 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 199 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(interface_obj.hdr)); |
| 200 | if (err) { |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 201 | std::cout << "ERROR: Failed to disable PON interface: " << intf_id << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 202 | return bcm_to_grpc_err(err, "Failed to disable PON interface"); |
Nicolas Palpacuer | 05ea0ea | 2018-07-06 11:47:21 -0400 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | return Status::OK; |
| 206 | } |
| 207 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 208 | Status ActivateOnu_(uint32_t intf_id, uint32_t onu_id, |
Shad Ansari | 0610195 | 2018-07-25 00:22:09 +0000 | [diff] [blame] | 209 | const char *vendor_id, const char *vendor_specific, uint32_t pir) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 210 | |
| 211 | bcmbal_subscriber_terminal_cfg sub_term_obj = {}; |
| 212 | bcmbal_subscriber_terminal_key subs_terminal_key; |
| 213 | bcmbal_serial_number serial_num = {}; |
| 214 | bcmbal_registration_id registration_id = {}; |
| 215 | |
| 216 | std::cout << "Enabling ONU " << onu_id << " on PON " << intf_id << std::endl; |
| 217 | std::cout << "Vendor Id " << vendor_id |
| 218 | << "Vendor Specific Id " << vendor_specific |
Shad Ansari | 0610195 | 2018-07-25 00:22:09 +0000 | [diff] [blame] | 219 | << "pir " << pir |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 220 | << std::endl; |
| 221 | |
| 222 | subs_terminal_key.sub_term_id = onu_id; |
| 223 | subs_terminal_key.intf_id = intf_id; |
| 224 | BCMBAL_CFG_INIT(&sub_term_obj, subscriber_terminal, subs_terminal_key); |
| 225 | |
| 226 | memcpy(serial_num.vendor_id, vendor_id, 4); |
| 227 | memcpy(serial_num.vendor_specific, vendor_specific, 4); |
| 228 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, serial_number, serial_num); |
| 229 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 230 | #if 0 |
| 231 | // Commenting out as this is causing issues with onu activation |
| 232 | // with BAL 2.6 (Broadcom CS5248819). |
| 233 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 234 | // FIXME - Use a default (all zeros) registration id. |
| 235 | memset(registration_id.arr, 0, sizeof(registration_id.arr)); |
| 236 | 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] | 237 | #endif |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 238 | |
| 239 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_UP); |
| 240 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 241 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr)); |
| 242 | if (err) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 243 | std::cout << "ERROR: Failed to enable ONU: " << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 244 | return bcm_to_grpc_err(err, "Failed to enable ONU"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 245 | } |
| 246 | |
Shad Ansari | 0610195 | 2018-07-25 00:22:09 +0000 | [diff] [blame] | 247 | /* Create subscriber's tm_sched */ |
| 248 | { |
| 249 | bcmbal_tm_sched_cfg cfg; |
| 250 | bcmbal_tm_sched_key key = { }; |
| 251 | key.dir = BCMBAL_TM_SCHED_DIR_DS; |
| 252 | key.id = intf_id << 7 | onu_id; |
| 253 | BCMBAL_CFG_INIT(&cfg, tm_sched, key); |
| 254 | |
| 255 | bcmbal_tm_sched_owner owner = { }; |
| 256 | owner.type = BCMBAL_TM_SCHED_OWNER_TYPE_SUB_TERM; |
| 257 | owner.u.sub_term.intf_id = intf_id; |
| 258 | owner.u.sub_term.sub_term_id = onu_id; |
| 259 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, owner, owner); |
| 260 | |
| 261 | bcmbal_tm_sched_parent parent = { }; |
| 262 | parent.sched_id = intf_id + 16384; |
| 263 | parent.presence_mask = parent.presence_mask | BCMBAL_TM_SCHED_PARENT_ID_SCHED_ID; |
| 264 | parent.weight = 1; |
| 265 | parent.presence_mask = parent.presence_mask | BCMBAL_TM_SCHED_PARENT_ID_WEIGHT; |
| 266 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, sched_parent, parent); |
| 267 | |
| 268 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, sched_type, BCMBAL_TM_SCHED_TYPE_WFQ); |
| 269 | |
| 270 | bcmbal_tm_shaping shaping = { }; |
| 271 | shaping.pir = pir; |
| 272 | shaping.presence_mask = shaping.presence_mask | BCMBAL_TM_SHAPING_ID_PIR; |
| 273 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, rate, shaping); |
| 274 | |
| 275 | bcmbal_cfg_set(DEFAULT_ATERM_ID, &cfg.hdr); |
| 276 | } |
| 277 | |
| 278 | /* Create tm_queue */ |
| 279 | { |
| 280 | bcmbal_tm_queue_cfg cfg; |
| 281 | bcmbal_tm_queue_key key = { }; |
| 282 | key.sched_id = intf_id << 7 | onu_id; |
| 283 | key.sched_dir = BCMBAL_TM_SCHED_DIR_DS; |
| 284 | key.id = 0; |
| 285 | BCMBAL_CFG_INIT(&cfg, tm_queue, key); |
| 286 | BCMBAL_CFG_PROP_SET(&cfg, tm_queue, weight, 1); |
| 287 | bcmbal_cfg_set(DEFAULT_ATERM_ID, &cfg.hdr); |
| 288 | } |
| 289 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 290 | return SchedAdd_(intf_id, onu_id, mk_agg_port_id(onu_id)); |
| 291 | |
| 292 | //return Status::OK; |
| 293 | } |
| 294 | |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 295 | Status DeactivateOnu_(uint32_t intf_id, uint32_t onu_id, |
| 296 | const char *vendor_id, const char *vendor_specific) { |
| 297 | |
| 298 | SchedRemove_(intf_id, onu_id, mk_agg_port_id(onu_id)); |
| 299 | |
| 300 | bcmbal_subscriber_terminal_cfg sub_term_obj = {}; |
| 301 | bcmbal_subscriber_terminal_key subs_terminal_key; |
| 302 | |
| 303 | std::cout << "Deactivating ONU " << onu_id << " on PON " << intf_id << std::endl; |
| 304 | std::cout << "Vendor Id " << vendor_id |
| 305 | << "Vendor Specific Id " << vendor_specific |
| 306 | << std::endl; |
| 307 | |
| 308 | subs_terminal_key.sub_term_id = onu_id; |
| 309 | subs_terminal_key.intf_id = intf_id; |
| 310 | BCMBAL_CFG_INIT(&sub_term_obj, subscriber_terminal, subs_terminal_key); |
| 311 | |
| 312 | BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_DOWN); |
| 313 | |
| 314 | if (bcmbal_cfg_set(DEFAULT_ATERM_ID, &(sub_term_obj.hdr))) { |
| 315 | std::cout << "ERROR: Failed to deactivate ONU: " << std::endl; |
| 316 | return Status(grpc::StatusCode::INTERNAL, "Failed to deactivate ONU"); |
| 317 | } |
| 318 | |
| 319 | return Status::OK; |
| 320 | } |
| 321 | |
| 322 | Status DeleteOnu_(uint32_t intf_id, uint32_t onu_id, |
| 323 | const char *vendor_id, const char *vendor_specific) { |
| 324 | bcmos_errno err = BCM_ERR_OK; |
| 325 | bcmbal_subscriber_terminal_cfg cfg; |
| 326 | bcmbal_subscriber_terminal_key key = { }; |
| 327 | |
| 328 | std::cout << "Processing subscriber terminal cfg clear for sub_term_id = " |
| 329 | << onu_id << " and intf_id = " << intf_id << std::endl; |
| 330 | |
| 331 | key.sub_term_id = onu_id ; |
| 332 | key.intf_id = intf_id ; |
| 333 | |
| 334 | if (0 == key.sub_term_id) |
| 335 | { |
| 336 | std::cout << "Invalid Key to handle subscriber terminal clear subscriber_terminal_id = " |
| 337 | << onu_id << " Interface ID = " << intf_id << std::endl; |
| 338 | return Status(grpc::StatusCode::INTERNAL, "Failed to delete ONU"); |
| 339 | } |
| 340 | |
| 341 | BCMBAL_CFG_INIT(&cfg, subscriber_terminal, key); |
| 342 | |
| 343 | err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &cfg.hdr); |
| 344 | if (err != BCM_ERR_OK) |
| 345 | { |
| 346 | std::cout << "Failed to clear information for BAL subscriber_terminal_id = " |
| 347 | << onu_id << " Interface ID = " << intf_id << std::endl; |
| 348 | return Status(grpc::StatusCode::INTERNAL, "Failed to delete ONU"); |
| 349 | } |
| 350 | |
| 351 | return Status::OK;; |
| 352 | } |
| 353 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 354 | #define MAX_CHAR_LENGTH 20 |
| 355 | #define MAX_OMCI_MSG_LENGTH 44 |
| 356 | Status OmciMsgOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) { |
| 357 | bcmbal_u8_list_u32_max_2048 buf; /* A structure with a msg pointer and length value */ |
| 358 | bcmos_errno err = BCM_ERR_OK; |
| 359 | |
| 360 | /* The destination of the OMCI packet is a registered ONU on the OLT PON interface */ |
| 361 | bcmbal_dest proxy_pkt_dest; |
| 362 | |
| 363 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_ITU_OMCI_CHANNEL; |
| 364 | proxy_pkt_dest.u.itu_omci_channel.sub_term_id = onu_id; |
| 365 | proxy_pkt_dest.u.itu_omci_channel.intf_id = intf_id; |
| 366 | |
| 367 | // ??? |
| 368 | if ((pkt.size()/2) > MAX_OMCI_MSG_LENGTH) { |
| 369 | buf.len = MAX_OMCI_MSG_LENGTH; |
| 370 | } else { |
| 371 | buf.len = pkt.size()/2; |
| 372 | } |
| 373 | |
| 374 | /* Send the OMCI packet using the BAL remote proxy API */ |
| 375 | uint16_t idx1 = 0; |
| 376 | uint16_t idx2 = 0; |
| 377 | uint8_t arraySend[buf.len]; |
| 378 | char str1[MAX_CHAR_LENGTH]; |
| 379 | char str2[MAX_CHAR_LENGTH]; |
| 380 | memset(&arraySend, 0, buf.len); |
| 381 | |
| 382 | std::cout << "Sending omci msg to ONU of length is " |
| 383 | << buf.len |
| 384 | << std::endl; |
| 385 | |
| 386 | for (idx1=0,idx2=0; idx1<((buf.len)*2); idx1++,idx2++) { |
| 387 | sprintf(str1,"%c", pkt[idx1]); |
| 388 | sprintf(str2,"%c", pkt[++idx1]); |
| 389 | strcat(str1,str2); |
| 390 | arraySend[idx2] = strtol(str1, NULL, 16); |
| 391 | } |
| 392 | |
| 393 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 394 | memcpy(buf.val, (uint8_t *)arraySend, buf.len); |
| 395 | |
| 396 | std::cout << "After converting bytes to hex " |
| 397 | << buf.val << buf.len << std::endl; |
| 398 | |
| 399 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 400 | |
| 401 | std::cout << "OMCI request msg of length " << buf.len |
| 402 | << " sent to ONU" << onu_id |
| 403 | << " through PON " << intf_id << std::endl; |
| 404 | |
| 405 | free(buf.val); |
| 406 | |
| 407 | return Status::OK; |
| 408 | } |
| 409 | |
| 410 | Status OnuPacketOut_(uint32_t intf_id, uint32_t onu_id, const std::string pkt) { |
| 411 | bcmos_errno err = BCM_ERR_OK; |
| 412 | bcmbal_dest proxy_pkt_dest; |
| 413 | bcmbal_u8_list_u32_max_2048 buf; |
| 414 | |
| 415 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_SUB_TERM, |
| 416 | proxy_pkt_dest.u.sub_term.sub_term_id = onu_id; |
| 417 | proxy_pkt_dest.u.sub_term.intf_id = intf_id; |
| 418 | |
| 419 | buf.len = pkt.size(); |
| 420 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 421 | memcpy(buf.val, (uint8_t *)pkt.data(), buf.len); |
| 422 | |
| 423 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 424 | |
| 425 | std::cout << "Packet out of length " << buf.len |
| 426 | << " sent to ONU" << onu_id |
| 427 | << " through PON " << intf_id << std::endl; |
| 428 | |
| 429 | free(buf.val); |
| 430 | |
| 431 | return Status::OK; |
| 432 | } |
| 433 | |
Nicolas Palpacuer | b78def4 | 2018-06-07 12:55:26 -0400 | [diff] [blame] | 434 | Status UplinkPacketOut_(uint32_t intf_id, const std::string pkt) { |
| 435 | bcmos_errno err = BCM_ERR_OK; |
| 436 | bcmbal_dest proxy_pkt_dest; |
| 437 | bcmbal_u8_list_u32_max_2048 buf; |
| 438 | |
| 439 | proxy_pkt_dest.type = BCMBAL_DEST_TYPE_NNI, |
| 440 | proxy_pkt_dest.u.nni.intf_id = intf_id; |
| 441 | |
| 442 | buf.len = pkt.size(); |
| 443 | buf.val = (uint8_t *)malloc((buf.len)*sizeof(uint8_t)); |
| 444 | memcpy(buf.val, (uint8_t *)pkt.data(), buf.len); |
| 445 | |
| 446 | err = bcmbal_pkt_send(0, proxy_pkt_dest, (const char *)(buf.val), buf.len); |
| 447 | |
| 448 | std::cout << "Packet out of length " << buf.len |
| 449 | << " sent through uplink port " << intf_id << std::endl; |
| 450 | |
| 451 | free(buf.val); |
| 452 | |
| 453 | return Status::OK; |
| 454 | } |
| 455 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 456 | Status FlowAdd_(uint32_t onu_id, |
| 457 | uint32_t flow_id, const std::string flow_type, |
| 458 | uint32_t access_intf_id, uint32_t network_intf_id, |
Nicolas Palpacuer | d6cf5aa | 2018-07-16 15:14:39 -0400 | [diff] [blame] | 459 | uint32_t gemport_id, uint32_t priority_value, |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 460 | const ::openolt::Classifier& classifier, |
| 461 | const ::openolt::Action& action) { |
| 462 | bcmos_errno err; |
| 463 | bcmbal_flow_cfg cfg; |
| 464 | bcmbal_flow_key key = { }; |
| 465 | |
| 466 | std::cout << "flow add -" |
| 467 | << " intf_id:" << access_intf_id |
| 468 | << " onu_id:" << onu_id |
| 469 | << " flow_id:" << flow_id |
| 470 | << " flow_type:" << flow_type |
| 471 | << " gemport_id:" << gemport_id |
| 472 | << " network_intf_id:" << network_intf_id |
| 473 | << std::endl; |
| 474 | |
| 475 | key.flow_id = flow_id; |
| 476 | if (flow_type.compare("upstream") == 0 ) { |
| 477 | key.flow_type = BCMBAL_FLOW_TYPE_UPSTREAM; |
| 478 | } else if (flow_type.compare("downstream") == 0) { |
| 479 | key.flow_type = BCMBAL_FLOW_TYPE_DOWNSTREAM; |
| 480 | } else { |
| 481 | std::cout << "Invalid flow type " << flow_type << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 482 | return bcm_to_grpc_err(BCM_ERR_PARM, "Invalid flow type"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | BCMBAL_CFG_INIT(&cfg, flow, key); |
| 486 | |
| 487 | BCMBAL_CFG_PROP_SET(&cfg, flow, admin_state, BCMBAL_STATE_UP); |
| 488 | BCMBAL_CFG_PROP_SET(&cfg, flow, access_int_id, access_intf_id); |
| 489 | BCMBAL_CFG_PROP_SET(&cfg, flow, network_int_id, network_intf_id); |
| 490 | BCMBAL_CFG_PROP_SET(&cfg, flow, sub_term_id, onu_id); |
| 491 | BCMBAL_CFG_PROP_SET(&cfg, flow, svc_port_id, gemport_id); |
Nicolas Palpacuer | d6cf5aa | 2018-07-16 15:14:39 -0400 | [diff] [blame] | 492 | BCMBAL_CFG_PROP_SET(&cfg, flow, priority, priority_value); |
| 493 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 494 | |
| 495 | { |
| 496 | bcmbal_classifier val = { }; |
| 497 | |
| 498 | if (classifier.o_tpid()) { |
| 499 | val.o_tpid = classifier.o_tpid(); |
| 500 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_TPID; |
| 501 | } |
| 502 | |
| 503 | if (classifier.o_vid()) { |
| 504 | val.o_vid = classifier.o_vid(); |
| 505 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_VID; |
| 506 | } |
| 507 | |
| 508 | if (classifier.i_tpid()) { |
| 509 | val.i_tpid = classifier.i_tpid(); |
| 510 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_TPID; |
| 511 | } |
| 512 | |
| 513 | if (classifier.i_vid()) { |
| 514 | val.i_vid = classifier.i_vid(); |
| 515 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_VID; |
| 516 | } |
| 517 | |
| 518 | if (classifier.o_pbits()) { |
| 519 | val.o_pbits = classifier.o_pbits(); |
| 520 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_O_PBITS; |
| 521 | } |
| 522 | |
| 523 | if (classifier.i_pbits()) { |
| 524 | val.i_pbits = classifier.i_pbits(); |
| 525 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_I_PBITS; |
| 526 | } |
| 527 | |
| 528 | if (classifier.eth_type()) { |
| 529 | val.ether_type = classifier.eth_type(); |
| 530 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_ETHER_TYPE; |
| 531 | } |
| 532 | |
| 533 | /* |
| 534 | if (classifier.dst_mac()) { |
| 535 | val.dst_mac = classifier.dst_mac(); |
| 536 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_MAC; |
| 537 | } |
| 538 | |
| 539 | if (classifier.src_mac()) { |
| 540 | val.src_mac = classifier.src_mac(); |
| 541 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_MAC; |
| 542 | } |
| 543 | */ |
| 544 | |
| 545 | if (classifier.ip_proto()) { |
| 546 | val.ip_proto = classifier.ip_proto(); |
| 547 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_IP_PROTO; |
| 548 | } |
| 549 | |
| 550 | /* |
| 551 | if (classifier.dst_ip()) { |
| 552 | val.dst_ip = classifier.dst_ip(); |
| 553 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_IP; |
| 554 | } |
| 555 | |
| 556 | if (classifier.src_ip()) { |
| 557 | val.src_ip = classifier.src_ip(); |
| 558 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_IP; |
| 559 | } |
| 560 | */ |
| 561 | |
| 562 | if (classifier.src_port()) { |
| 563 | val.src_port = classifier.src_port(); |
| 564 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_SRC_PORT; |
| 565 | } |
| 566 | |
| 567 | if (classifier.dst_port()) { |
| 568 | val.dst_port = classifier.dst_port(); |
| 569 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_DST_PORT; |
| 570 | } |
| 571 | |
| 572 | if (!classifier.pkt_tag_type().empty()) { |
| 573 | if (classifier.pkt_tag_type().compare("untagged") == 0) { |
| 574 | val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_UNTAGGED; |
| 575 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE; |
| 576 | } else if (classifier.pkt_tag_type().compare("single_tag") == 0) { |
| 577 | val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_SINGLE_TAG; |
| 578 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE; |
| 579 | } else if (classifier.pkt_tag_type().compare("double_tag") == 0) { |
| 580 | val.pkt_tag_type = BCMBAL_PKT_TAG_TYPE_DOUBLE_TAG; |
| 581 | val.presence_mask = val.presence_mask | BCMBAL_CLASSIFIER_ID_PKT_TAG_TYPE; |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | BCMBAL_CFG_PROP_SET(&cfg, flow, classifier, val); |
| 586 | } |
| 587 | |
| 588 | { |
| 589 | bcmbal_action val = { }; |
| 590 | |
| 591 | const ::openolt::ActionCmd& cmd = action.cmd(); |
| 592 | |
| 593 | if (cmd.add_outer_tag()) { |
| 594 | val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_ADD_OUTER_TAG; |
| 595 | val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK; |
| 596 | } |
| 597 | |
| 598 | if (cmd.remove_outer_tag()) { |
| 599 | val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_REMOVE_OUTER_TAG; |
| 600 | val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK; |
| 601 | } |
| 602 | |
| 603 | if (cmd.trap_to_host()) { |
| 604 | val.cmds_bitmask |= BCMBAL_ACTION_CMD_ID_TRAP_TO_HOST; |
| 605 | val.presence_mask |= BCMBAL_ACTION_ID_CMDS_BITMASK; |
| 606 | } |
| 607 | |
| 608 | if (action.o_vid()) { |
| 609 | val.o_vid = action.o_vid(); |
| 610 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_VID; |
| 611 | } |
| 612 | |
| 613 | if (action.o_pbits()) { |
| 614 | val.o_pbits = action.o_pbits(); |
| 615 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_PBITS; |
| 616 | } |
| 617 | |
| 618 | if (action.o_tpid()) { |
| 619 | val.o_tpid = action.o_tpid(); |
| 620 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_O_TPID; |
| 621 | } |
| 622 | |
| 623 | if (action.i_vid()) { |
| 624 | val.i_vid = action.i_vid(); |
| 625 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_VID; |
| 626 | } |
| 627 | |
| 628 | if (action.i_pbits()) { |
| 629 | val.i_pbits = action.i_pbits(); |
| 630 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_PBITS; |
| 631 | } |
| 632 | |
| 633 | if (action.i_tpid()) { |
| 634 | val.i_tpid = action.i_tpid(); |
| 635 | val.presence_mask = val.presence_mask | BCMBAL_ACTION_ID_I_TPID; |
| 636 | } |
| 637 | |
| 638 | BCMBAL_CFG_PROP_SET(&cfg, flow, action, val); |
| 639 | } |
| 640 | |
| 641 | { |
| 642 | bcmbal_tm_sched_id val; |
| 643 | val = (bcmbal_tm_sched_id) mk_sched_id(onu_id); |
| 644 | BCMBAL_CFG_PROP_SET(&cfg, flow, dba_tm_sched_id, val); |
| 645 | } |
| 646 | |
Shad Ansari | 0610195 | 2018-07-25 00:22:09 +0000 | [diff] [blame] | 647 | if (key.flow_type == BCMBAL_FLOW_TYPE_DOWNSTREAM) { |
| 648 | bcmbal_tm_queue_ref val = { }; |
| 649 | val.sched_id = access_intf_id << 7 | onu_id; |
| 650 | val.queue_id = 0; |
| 651 | BCMBAL_CFG_PROP_SET(&cfg, flow, queue, val); |
| 652 | } |
| 653 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 654 | err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr)); |
| 655 | if (err) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 656 | std::cout << "ERROR: flow add failed" << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 657 | return bcm_to_grpc_err(err, "flow add failed"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 658 | } |
| 659 | |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 660 | register_new_flow(key); |
| 661 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 662 | return Status::OK; |
| 663 | } |
| 664 | |
Nicolas Palpacuer | edfaa0c | 2018-07-05 15:05:27 -0400 | [diff] [blame] | 665 | Status FlowRemove_(uint32_t flow_id, const std::string flow_type) { |
| 666 | |
| 667 | bcmbal_flow_cfg cfg; |
| 668 | bcmbal_flow_key key = { }; |
| 669 | |
| 670 | key.flow_id = (bcmbal_flow_id) flow_id; |
| 671 | key.flow_id = flow_id; |
| 672 | if (flow_type.compare("upstream") == 0 ) { |
| 673 | key.flow_type = BCMBAL_FLOW_TYPE_UPSTREAM; |
| 674 | } else if (flow_type.compare("downstream") == 0) { |
| 675 | key.flow_type = BCMBAL_FLOW_TYPE_DOWNSTREAM; |
| 676 | } else { |
| 677 | std::cout << "Invalid flow type " << flow_type << std::endl; |
| 678 | return bcm_to_grpc_err(BCM_ERR_PARM, "Invalid flow type"); |
| 679 | } |
| 680 | |
| 681 | BCMBAL_CFG_INIT(&cfg, flow, key); |
| 682 | |
| 683 | |
| 684 | bcmos_errno err = bcmbal_cfg_clear(DEFAULT_ATERM_ID, &cfg.hdr); |
| 685 | if (err) { |
| 686 | std::cout << "Error " << err << " while removing flow " |
| 687 | << flow_id << ", " << flow_type << std::endl; |
| 688 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove flow"); |
| 689 | } |
| 690 | |
| 691 | std::cout << "Flow " << flow_id << ", " << flow_type << " removed"; |
| 692 | return Status::OK; |
| 693 | } |
| 694 | |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 695 | Status SchedAdd_(int intf_id, int onu_id, int agg_port_id) { |
| 696 | bcmbal_tm_sched_cfg cfg; |
| 697 | bcmbal_tm_sched_key key = { }; |
| 698 | bcmbal_tm_sched_type sched_type; |
| 699 | |
| 700 | key.id = mk_sched_id(onu_id); |
| 701 | key.dir = BCMBAL_TM_SCHED_DIR_US; |
| 702 | |
| 703 | BCMBAL_CFG_INIT(&cfg, tm_sched, key); |
| 704 | |
| 705 | { |
| 706 | bcmbal_tm_sched_owner val = { }; |
| 707 | |
| 708 | val.type = BCMBAL_TM_SCHED_OWNER_TYPE_AGG_PORT; |
| 709 | val.u.agg_port.intf_id = (bcmbal_intf_id) intf_id; |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 710 | val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_INTF_ID; |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 711 | val.u.agg_port.sub_term_id = (bcmbal_sub_id) onu_id; |
| 712 | val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_SUB_TERM_ID; |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 713 | val.u.agg_port.agg_port_id = (bcmbal_aggregation_port_id) agg_port_id; |
| 714 | val.u.agg_port.presence_mask = val.u.agg_port.presence_mask | BCMBAL_TM_SCHED_OWNER_AGG_PORT_ID_AGG_PORT_ID; |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 715 | |
| 716 | BCMBAL_CFG_PROP_SET(&cfg, tm_sched, owner, val); |
| 717 | } |
| 718 | |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 719 | bcmos_errno err = bcmbal_cfg_set(DEFAULT_ATERM_ID, &(cfg.hdr)); |
| 720 | if (err) { |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 721 | std::cout << "ERROR: Failed to create upstream DBA sched" |
| 722 | << " id:" << key.id |
| 723 | << " intf_id:" << intf_id |
| 724 | << " onu_id:" << onu_id << std::endl; |
Nicolas Palpacuer | 73222e0 | 2018-07-16 12:20:26 -0400 | [diff] [blame] | 725 | return bcm_to_grpc_err(err, "Failed to create upstream DBA sched"); |
Shad Ansari | b7b0ced | 2018-05-11 21:53:32 +0000 | [diff] [blame] | 726 | //return 1; |
| 727 | } |
| 728 | std::cout << "create upstream DBA sched" |
| 729 | << " id:" << key.id |
| 730 | << " intf_id:" << intf_id |
| 731 | << " onu_id:" << onu_id << std::endl; |
| 732 | |
| 733 | return Status::OK; |
| 734 | //return 0; |
| 735 | } |
Jonathan Davis | 70c2181 | 2018-07-19 15:32:10 -0400 | [diff] [blame] | 736 | |
| 737 | Status SchedRemove_(int intf_id, int onu_id, int agg_port_id) { |
| 738 | bcmbal_tm_sched_cfg cfg; |
| 739 | bcmbal_tm_sched_key key = { }; |
| 740 | bcmbal_tm_sched_type sched_type; |
| 741 | |
| 742 | key.id = mk_sched_id(onu_id); |
| 743 | key.dir = BCMBAL_TM_SCHED_DIR_US; |
| 744 | |
| 745 | BCMBAL_CFG_INIT(&cfg, tm_sched, key); |
| 746 | |
| 747 | if (bcmbal_cfg_clear(DEFAULT_ATERM_ID, &(cfg.hdr))) { |
| 748 | std::cout << "ERROR: Failed to remove upstream DBA sched" |
| 749 | << " id:" << key.id |
| 750 | << " intf_id:" << intf_id |
| 751 | << " onu_id:" << onu_id << std::endl; |
| 752 | return Status(grpc::StatusCode::INTERNAL, "Failed to remove upstream DBA sched"); |
| 753 | } |
| 754 | |
| 755 | std::cout << "remove upstream DBA sched" |
| 756 | << " id:" << key.id |
| 757 | << " intf_id:" << intf_id |
| 758 | << " onu_id:" << onu_id << std::endl; |
| 759 | |
| 760 | return Status::OK; |
| 761 | //return 0; |
| 762 | } |