-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ethernet Port: Add LLDP port schema to interfaces #1121
base: 1110
Are you sure you want to change the base?
Conversation
redfish-core/lib/ethernet.hpp
Outdated
asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( | ||
"/redfish/v1/Managers/{}/EthernetInterfaces/Ports/{}", | ||
BMCWEB_REDFISH_MANAGER_URI_NAME, portId); | ||
asyncResp->res.jsonValue["@odata.type"] = "#Port.v1_4_0.Port"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use latest Port.v1_14 schema version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
8770ee8
to
05dd7bd
Compare
Need to Implement Port Collection as per dmtf mockups
|
455885a
to
06fa6ff
Compare
done |
1 similar comment
done |
redfish-core/lib/ethernet.hpp
Outdated
@@ -2265,7 +2400,7 @@ inline void requestEthernetInterfacesRoutes(App& app) | |||
} | |||
|
|||
asyncResp->res.jsonValue["@odata.type"] = | |||
"#EthernetInterface.v1_9_0.EthernetInterface"; | |||
"#EthernetInterface.v1_9_1.EthernetInterface"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any reason for this version change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
06fa6ff
to
b9e0773
Compare
Please add upstream gerrit commit info. |
redfish-core/lib/ethernet.hpp
Outdated
return; | ||
} | ||
std::string path = "/xyz/openbmc_project/network/"; | ||
path += portId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part is better to be like
std::string path = std::format("/xyz/openbmc_project/network/{}", portId);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a few comments related to the schemas.
I believe the Redfish.md file also need to be updated.
I think it would be helpful to show the actual command output in the commit message.
Question on Testing: Were the Links verified as correct?
redfish-core/lib/ethernet.hpp
Outdated
@@ -2246,6 +2380,7 @@ inline void requestEthernetInterfacesRoutes(App& app) | |||
managerId); | |||
return; | |||
} | |||
populateConnectedPortLink(asyncResp, ifaceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If getEthernetIfaceData() fails below the Links will have been populated but the required fields for EthernetInterface will not be populated. I don't think the links should be populated first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
redfish-core/lib/ethernet.hpp
Outdated
|
||
asyncResp->res.jsonValue["Members@odata.count"] = ifaceArray.size(); | ||
asyncResp->res.jsonValue["@odata.id"] = boost::urls::format( | ||
"/redfish/v1/Managers/{}/EthernetInterfaces", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already filled in on line 2231.
Let's make sure to go upstream with this first |
55cbd5c
to
653d10f
Compare
Done |
653d10f
to
6a7cda3
Compare
I have updated the upstream PR. But we cannot pull the commit here. The rebase status of this file very old. |
79c76b8
to
b08feac
Compare
redfish-core/lib/ethernet.hpp
Outdated
[asyncResp, portId](const boost::system::error_code& ec, bool enabled) { | ||
if (ec.value() == EBADR) | ||
{ | ||
BMCWEB_LOG_ERROR("Port {} Unreachable", portId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Yes I have updated the test result in commit log. Are you asking for the validator run? Yes validator run successfully |
Link Layer Discovery Protocol is a Data Link Layer protocol used for discovering devices on a local network. LLDP advertises information about themselves to directly connected devices. This information includes the device's identity, capabilities, and network management information, which can be used for network monitoring, topology discovery and network troubleshooting. This commit will add Bmcweb changes required to enable/disable LLDP property in ethernet interfaces. Schema: https://redfish.dmtf.org/schemas/v1/PortCollection.json https://redfish.dmtf.org/schemas/v1/Port.v1_14_0.json Tested by Get/Patch on curl https://xxx/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1 { "@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1", "@odata.type": "#Port.v1_14_0.Port", "Ethernet": { "LLDPEnabled": false }, "Id": "eth1", "Links": { "EthernetInterfaces": [ { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth1" } ] }, "Name": "Manager Dedicated Network Port" } Get on curl https://xxx/redfish/v1/Managers/bmc/EthernetInterfaces { ... "Links": { "Ports": [ { "@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1" } ], "Ports@odata.count": 1 } ... } Get on curl https://xxx/redfish/v1/Managers/bmc/DedicatedNetworkPorts { "@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts", "@odata.type": "#PortCollection.PortCollection", "Members": [ { "@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth0" }, { "@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1" } ], "Members@odata.count": 2, "Name": "Port Collection" } Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>
b08feac
to
1c79d53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to Redfish.md are still needed to document the new properties being returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this seems good to me for 1110.
@rfrandse This is a base bmcweb change for the complete LLDP feature. Please merge this to get the testing go smooth as per the plan. All major comments are already addressed and the pending comments are not closely related to this feature - can be done as separate PRs |
https://jsw.ibm.com/browse/PFEBMC-3823 is created for the redfish.md document updates |
Ethernet Port: Add LLDP port schema to interfaces
Link Layer Discovery Protocol is a Data Link Layer protocol used for
discovering devices on a local network. LLDP advertises information
about themselves to directly connected devices. This information
includes the device's identity, capabilities, and network management
information, which can be used for network monitoring, topology
discovery and network troubleshooting.
This commit will add Bmcweb changes required to enable/disable LLDP
property in ethernet interfaces.
Schema:
https://redfish.dmtf.org/schemas/v1/PortCollection.json
https://redfish.dmtf.org/schemas/v1/Port.v1_14_0.json
Tested by
Get/Patch on
curl https://xxx/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1
{
"@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1",
"@odata.type": "#Port.v1_14_0.Port",
"Ethernet": {
"LLDPEnabled": false
},
"Id": "eth1",
"Links": {
"EthernetInterfaces": [
{
"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth1"
}
]
},
"Name": "Manager Dedicated Network Port"
}
Get on
curl https://xxx/redfish/v1/Managers/bmc/EthernetInterfaces
{
...
"Links": {
"Ports": [
{
"@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1"
}
],
"Ports@odata.count": 1
}
...
}
Get on
curl https://xxx/redfish/v1/Managers/bmc/DedicatedNetworkPorts
{
"@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts",
"@odata.type": "#PortCollection.PortCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth0"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/DedicatedNetworkPorts/eth1"
}
],
"Members@odata.count": 2,
"Name": "Port Collection"
}
Upstream PR:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76569