Implement Ethernet Interface Properties

Spencer Ku (古世瑜) Spencer.Ku at quantatw.com
Mon Jan 24 13:22:51 AEDT 2022


Hi Kononenko, Thanks for your reply!

> -----Original Message-----
> From: i.kononenko <i.kononenko at yadro.com>
> Subject: Re: Implement Ethernet Interface Properties
> 
> Hi Spencer!
> 
> On 20.01.2022 11:42, Spencer Ku (古世瑜) wrote:
> > Hi All,
> >
> > We finally decide to implement six properties to Ethernet interface:
> > RxPackets, TxPackets, RxBytes, TxBytes, RxDropped, and TxDropped.
> >
> > Those information come from Ethernet statistics and we can read the
> > file to get the property value directly. (under
> > /sys/class/net/<Ethernet name>/statistics)
> >
> > For the suitable property in EthernetInterface model, we got the
> > feedback form Redfish forum and they said OEM properties would be the
> > only other option at this time. For more discussion detail:
> > https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredf
> > ishforum.com%2Fthread%2F579%2Fadditional-information-ethernet-interfac
> >
> e&data=04%7C01%7CSpencer.Ku%40quantatw.com%7Ce2120a7a2bb246
> 9f409c0
> >
> 8d9dbf46100%7C179b032707fc4973ac738de7313561b2%7C1%7C0%7C637782
> 6661318
> >
> 53103%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2lu
> MzIiLCJB
> >
> TiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=fIEODKRf1elAoepIdSbpG
> SL9nY
> > ME3FTEQm1IooJKOLs%3D&reserved=0
> >
> 
> I'd suggest referring to the [1] **9.7. Resource extensibility** to examine the
> proper way of OEM-properties definition.
> 

As we discussed in the PR , I need to define and create the JSON schema "OemEthernetInterface".
I will push the schema to gerrit soon when I finish it.

> 
> > The following output is the result of my currently OEM implement:
> > https://${bmc}/redfish/v1/Managers/bmc/EhernetInterfaces/eth0
> > {
> >   "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
> >   ...
> >   "Oem": {
> >     "Statistics": [
> 
> Looks like "@odata.type" required field is missed. The **9.7.4. OEM property
> examples**
> contains the example of the right way to define OEM-properties.
> 
> >       {
> >         "RxBytes": 48244026,
> >         "RxDropped": 222856,
> >         "RxPackets": 484315,
> >         "TxBytes": 825845,
> >         "TxDropped": 0,
> >         "TxPackets": 5472
> >       }
> >     ]
> >   },
> >   "SpeedMbps": 100,
> >   ...
> > }
> >
> > But it cannot pass the Redfish validator, and here is the error messages:
> > ERROR - This complex object RxBytes should be a dictionary or None, but it's
> of type ...
> 
> Does it require to have the integer values? I guess each mentioned field might
> contain string values.
> 

I think the main reason which occurs the error is that I didn't define the odata ID and type. 
They cannot find the reference to analyze the property. I add the temp odata field (patch 3 in the PR), and the error messages has been changed to WRANING:

WARNING - Couldn't get schema for object, skipping OemObject OpenBmc
WARNING - Statistics not defined in schema Complex OpenBmc Resource.OemObject (check version, spelling and casing)

I will run the Redfish validator again when I finish the schema.

> > ERROR - RxBytes: Could not finish check on this property ('int' object is not
> iterable)
> >
> > Is there anything I didn't notice? Or has there any spec or example that I can
> follow to implement?
> >
> > I had already push the implementation to gerrit and mark as WIP. Here is the
> link:
> >
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgerrit.op
> enbmc-project.xyz%2Fc%2Fopenbmc%2Fbmcweb%2F%2B%2F50522&data
> =04%7C01%7CSpencer.Ku%40quantatw.com%7Ce2120a7a2bb2469f409c08d9d
> bf46100%7C179b032707fc4973ac738de7313561b2%7C1%7C0%7C6377826661
> 31853103%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=dv%2FXHFKTv
> IPnbHDgBFbE0UU%2BH8G6jzfs4XvGYVultDo%3D&reserved=0
> >
> > We are willing to see any suggestions and alternatives as well. Thanks!
> >
> > Sincerely,
> > Spencer Ku
> >
> 
> Links:
> [1] DSP0266 Redfish Specification:
> 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dm
> tf.org%2Fsites%2Fdefault%2Ffiles%2Fstandards%2Fdocuments%2FDSP0266_1.8
> .0.pdf&data=04%7C01%7CSpencer.Ku%40quantatw.com%7Ce2120a7a2bb
> 2469f409c08d9dbf46100%7C179b032707fc4973ac738de7313561b2%7C1%7C0
> %7C637782666131853103%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sd
> ata=kP6kdPx7SGbRU2P8tMZCGfvq6MIhz8jOp%2BQf%2BSmOwTI%3D&res
> erved=0
> 
> --
> Best regards,
> 
> Igor Kononenko

Sincerely,
Spencer Ku


More information about the openbmc mailing list