WIP: Add Ethernet intf subscription support#29
Conversation
Co-authored-by: Satoru-Shinohara <satoru.shinohara@dell.com> Co-authored-by: Nikita Agarwal <nikita_agarwal1@dell.com>
Co-authored-by: Satoru-Shinohara <satoru.shinohara@dell.com> Co-authored-by: Nikita Agarwal <nikita_agarwal1@dell.com>
| if (ifName == "*") && (inParams.oper == SUBSCRIBE) { | ||
| log.Info("intf_table_xfmr * ifName subscribe with targetUriPath ", targetUriPath) | ||
|
|
||
| // need to check if to add subinterface tbl !!!! |
There was a problem hiding this comment.
Let's remove this subinterface releated comment, since it's not supported now.
| } | ||
|
|
||
| result.dbDataMap = RedisDbSubscribeMap{db.ConfigDB: { | ||
| "PORT": {ifName: {"autoneg": "auto-negotiate", "adv_speeds": "advertised-speed", "link_training": "standalone-link-training", "unreliable_los": "unreliable-los", "speed": "port-speed", "fec": "port-fec"}}}} |
There was a problem hiding this comment.
Please check and remove the fields that we don't support already in community-sonic as part of OC-interfaces support our previous PR (sonic-net#125).
For e.g. These fields we didn't support in previous PR.
- advertised-speed
- standalone-link-training
- unreliable-los
- port-fec
| XlateFuncBind("YangToDb_intf_eth_port_config_xfmr", YangToDb_intf_eth_port_config_xfmr) | ||
| XlateFuncBind("DbToYang_intf_eth_port_config_xfmr", DbToYang_intf_eth_port_config_xfmr) | ||
| XlateFuncBind("Subscribe_intf_eth_port_config_xfmr", Subscribe_intf_eth_port_config_xfmr) | ||
| XlateFuncBind("DbToYangPath_intf_eth_port_config_path_xfmr", DbToYangPath_intf_eth_port_config_path_xfmr) |
There was a problem hiding this comment.
you will have to add path-config xfmr in annotation file
deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config {
deviate add {
sonic-ext:path-transformer "intf_eth_port_config_path_xfmr";
}
}
| return tblList, nil | ||
| } | ||
|
|
||
| intfType, _, ierr := getIntfTypeByName(ifName) |
There was a problem hiding this comment.
Do we really need this getIntfTypeByName code here? because subscribe code returns with above if-check. And this check was not there earlier in previous PR for GET/SET support. This question might come from external review. We should try to remove this code and test how things are.
| log.Info("YangToDb_intf_subintfs_xfmr: i32: %s", i32) | ||
|
|
||
| if i32 != 0 { | ||
| if idx != "0" && idx != "*" && idx != "" { |
There was a problem hiding this comment.
i32 is getting unused here. We can remove i32 variable fetch code and variable itself, if not needed. Please test, GET/SET works now for subinterfaces index value != 0 now. Earlier with previous PR, it was throwing error "Subinterfaces not supported".
|
|
||
| log.Infof("path:%v ifKey:%v, ipKey:%v tbl:[%v]", origTargetUriPath, ifKey, ipKey, tableName) | ||
|
|
||
| ipKey = pathInfo.Var("ip") |
There was a problem hiding this comment.
Lines (2221 to 2230) seems repeated again.. Same as lines (2210 to 2219)
No description provided.