OpenNetworkLinux
OpenNetworkLinux copied to clipboard
[ONLPv2][sfp.c] Need to put onlp_sfp_control_flags_get function behind onlp_sfp_is_present
Hi
In onlpv2-sfp.c
[OpenNetworkLinux\packages\base\any\onlp\src\onlp\module\src\sfp.c]
[int onlp_sfp_info_get(onlp_oid_t oid, onlp_sfp_info_t* info)]
if(ONLP_FAILURE(rv = onlp_sfp_control_flags_get(oid, &info->controls))) {
AIM_LOG_ERROR("%{onlp_oid}: sfp_info_get: sfp_control_flags_get returned %{onlp_status}",
oid, rv);
return rv;
}
if(ONLP_FAILURE(rv = onlp_sfp_is_present(oid))) {
AIM_LOG_ERROR("%{onlp_oid}: sfp_info_get: is_present returned %{onlp_status}",
oid, rv);
return rv;
}
I think we need to put function
[onlp_sfp_control_flags_get]
behind
[onlp_sfp_is_present]
to make sure sfp is present when we want to get the control value.
Am I right?
Hi
if we get control value without checking sfp present status, it will fail because no sfp eeprom and return error. What do you think about this issue?
Thank you for your reply. Ryan