ab29641a | 30-Dec-2020 |
Patrick Venture <venture@google.com> |
split readFRUContents() into FruUtils module
Splits the readFRUContents() method into its own module. This utility code can then be more easily tested without extra dependencies.
Signed-off-by: Pa
split readFRUContents() into FruUtils module
Splits the readFRUContents() method into its own module. This utility code can then be more easily tested without extra dependencies.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I1b8fa7179d7d0092e0236e8586f99c45121eca84
show more ...
|
c4732138 | 17-Dec-2020 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
FruDevice: Add error message for header
Verifying each bytes of header and reporting error message for respective byte failure like version, pad or checksum under debug for debugging.
Signed-off-by
FruDevice: Add error message for header
Verifying each bytes of header and reporting error message for respective byte failure like version, pad or checksum under debug for debugging.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: I9a651316b7653a46b485f10f7bbb32415ee427b4
show more ...
|
10a8c5fe | 07-Dec-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: scan after ObjectManager signals
Trigger a rescan whenever interfaces are added or removed, since they might result in a probe event.
The schema of ObjectManager signals does not al
entity-manager: scan after ObjectManager signals
Trigger a rescan whenever interfaces are added or removed, since they might result in a probe event.
The schema of ObjectManager signals does not allow us to match the specific interfaces in our probes so we are stuck subscribing to all events from all services. Rescans could be avoided however, with a custom signal handler with wrapper logic that discards wakeups without a rescan if the interfaces added (or removed) are not in our list of probe interfaces.
Change-Id: I834db793ebe05305248a02cb04b601ff0cc6a1ff Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
c76af0fb | 04-Dec-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: scan after NameOwnerChanged
We need a poke from DBus for static providers that create all their objects prior to claiming a well-known name, and thus don't emit any org.freedesktop.D
entity-manager: scan after NameOwnerChanged
We need a poke from DBus for static providers that create all their objects prior to claiming a well-known name, and thus don't emit any org.freedesktop.DBus.Properties signals. Similarly if a process exits for any reason, expected or otherwise, we'll need a poke to remove entities from DBus.
Testcase is as follows. Consider a static provider service xyz.openbmc_project.Inventory.Manager[1] that implements interfaces found in a DBus probe statement. Prior to this patch these commands do not result in a successful probe:
systemctl stop xyz.openbmc_project.EntityManager systemctl stop xyz.openbmc_project.Inventory.Manager systemctl start xyz.openbmc_project.EntityManager systemctl start xyz.openbmc_project.Inventory.Manager
Yet these commands do: systemctl stop xyz.openbmc_project.EntityManager systemctl stop xyz.openbmc_project.Inventory.Manager systemctl start xyz.openbmc_project.Inventory.Manager systemctl start xyz.openbmc_project.EntityManager
However if we then: systemctl stop xyz.openbmc_project.Inventory.Manager
entity manager does not detect the missing objects and remove the previously exposed configuration (un-probe).
With this patch applied, all scenarios above result in a successful probe (or un-probe).
[1] To execute this testcase, this series is required: https://gerrit.openbmc-project.xyz/38853
Change-Id: I54f5b445bafb37551664d57b0444701dc54013f7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
b45324a0 | 14-Oct-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: improve warning messages in FRU parse logic
When got any warnings while formatFRU, is hard to understand which device cause it since formatFRU has no information about device address. Thi
FruDevice: improve warning messages in FRU parse logic
When got any warnings while formatFRU, is hard to understand which device cause it since formatFRU has no information about device address. This adds printing device address after parsing FRU data if error/warning occurs.
Makes some check to be not critical (checksum error and non-zero bytes after EndOfFields) since we found invalid FRU in FLEXTRONICS S-1100ADU00-201 PSU where was wrong size in PRODUCT section header:
00000000 01 00 00 00 01 09 00 f5 01 09 19 cb 46 4c 45 58 |............FLEX| 00000010 54 52 4f 4e 49 43 53 cf 53 2d 31 31 30 30 41 44 |TRONICS.S-1100AD| 00000020 55 30 30 2d 32 30 31 ca 47 38 34 30 32 37 2d 30 |U00-201.G84027-0| 00000030 30 37 c2 30 31 cc 45 58 57 44 36 34 39 30 31 31 |07.01.EXWD649011| 00000040 32 31 c0 c0 c1 00 00 dc 00 02 18 3f a7 4c 04 28 |21.........?.L.(| 00000050 0a 37 05 28 23 b0 36 50 46 20 67 2f 3f 0a 1f f8 |.7.(#.6PF g/?...| 00000060 05 00 00 00 21 01 02 0d 6d 83 01 b0 04 74 04 ec |....!...m....t..| 00000070 04 78 00 00 00 ff ff 01 82 0d ae c2 82 b0 04 74 |.x.............t| 00000080 04 ec 04 78 00 00 00 34 08 |...x...4.|
Also fixes some other messages.
Tested: ensure there are expected messages in the log for FRU above: fru-device[355]: Checksum error in FRU area PRODUCT fru-device[355]: Computed checksum: 0xb0 fru-device[355]: The read checksum: 0x28 fru-device[355]: Non-zero byte after EndOfFields in FRU area PRODUCT fru-device[355]: there were warnings while parsing FRU for device at bus 7 address 82
Change-Id: I1e1d08ca0547ec4e6a8ce4e1f71a479622d5f243 Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
show more ...
|
272bafdd | 09-Oct-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: print checksum values on checksum error
Following up adding verbose diagnostic on FRU decoding, this adds printing exact checksum values against to just printing mismatch error.
Tested:
FruDevice: print checksum values on checksum error
Following up adding verbose diagnostic on FRU decoding, this adds printing exact checksum values against to just printing mismatch error.
Tested: 1) tested with good FRU: no changes 2) tested with invalid FRU: got message in the log: fru-device[355]: Checksum error in FRU area PRODUCT fru-device[355]: Computed checksum: 0xb0 fru-device[355]: The read checksum: 0x28
Change-Id: Ieabc143d81a6f816351eebf0ba5ab7552a7f5ee3 Signed-off-by: Bruce Mitchell <Bruce_Mitchell@phoenix.com> Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
show more ...
|
ef3cdc9a | 01-Oct-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
fru-device: Fix -Werror=sign-compare
Fix a warning under GCC10. There doesn't seem to be any need for this length holding variable to be signed.
Fixes: 2f0de17eddbc Change-Id: If19849acd975b496992
fru-device: Fix -Werror=sign-compare
Fix a warning under GCC10. There doesn't seem to be any need for this length holding variable to be signed.
Fixes: 2f0de17eddbc Change-Id: If19849acd975b49699218296742c8a369e4b8af2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
2a7e3954 | 02-Sep-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: additional diagnostics when decode FRU
FruDevice currently has kind of loyal policy for FRU decoding, so one can have a broken FRU but doesn't notice it. This adds more diagnostics when d
FruDevice: additional diagnostics when decode FRU
FruDevice currently has kind of loyal policy for FRU decoding, so one can have a broken FRU but doesn't notice it. This adds more diagnostics when decode FRU binary.
Tested: 1) tested with several different good FRUs 2) tested with modified FRU like: * wrong checksum in data area * no C1 in the end of area * change one of C0 to C1
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: Id703dada73eb1fa35abd531a3303b06288bd4aad
show more ...
|
d7b66599 | 13-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: try to parse Fru even it a bit broken
It was discovered that some of Delta PSUs have FRU which is not properly formatted: there was no endOfFields mark in product area. This FRU actually
FruDevice: try to parse Fru even it a bit broken
It was discovered that some of Delta PSUs have FRU which is not properly formatted: there was no endOfFields mark in product area. This FRU actually is not valid but we still can show useful information to user.
This change fixes some problems in out of area control and make decoder not fail if endOfFields was not found but all general fields are present.
Tested: tested with several different Frus
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: If5a386e3c2cb9412a13cc43cdf5a622c2250082d
show more ...
|
6cfb775b | 10-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: parse more than 2 custom fields
The current implementation supports up to two custom fileds for each FRU Area but there is no such limitation in the specification.
This adds support for
FruDevice: parse more than 2 custom fields
The current implementation supports up to two custom fileds for each FRU Area but there is no such limitation in the specification.
This adds support for unlimited number of custom fields
Tested: tested with FRU which contains three binary BOARD_INFO_AM fields
Change-Id: I6722ff6d98d27badef7a1493d67510596b6cabe9 Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
show more ...
|
9f0f2d11 | 19-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: use FRU Areas enum to iterate
Using integer constants more effective and simple then iterating over strings array. This change refactor code that works with FRU areas to use enum.
Tested
FruDevice: use FRU Areas enum to iterate
Using integer constants more effective and simple then iterating over strings array. This change refactor code that works with FRU areas to use enum.
Tested: verified that there is no visible changes in behavior.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: Ic95cddbcc3301fcf49c011a603d6373852f51058
show more ...
|
32d1f0a4 | 10-Sep-2020 |
James Feist <james.feist@linux.intel.com> |
Add retries to mapper calls
During cycling we're seeing sometimes we exit due to mapper errors. Put in retries to avoid EM shutting down.
Tested: Saw retries happen and EM stay up
Change-Id: I2caa
Add retries to mapper calls
During cycling we're seeing sometimes we exit due to mapper errors. Put in retries to avoid EM shutting down.
Tested: Saw retries happen and EM stay up
Change-Id: I2caa4a7ca0ae17a621c23152b3c362442c45592e Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
6b3d4c59 | 10-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: improve updateFRUProperty function
updateFRUProperty function is used to write ASSET field but it pretended to be generic.
This change fixes number of issues like * wrong size check * no
FruDevice: improve updateFRUProperty function
updateFRUProperty function is used to write ASSET field but it pretended to be generic.
This change fixes number of issues like * wrong size check * no control of data overflow * erase FRU Area next to updated area * wrong handle of first/last fields in area and some other This change also implements functionality to resize FRU Area, but it is disabled by default.
Tested: Tested by setting all properties as writable ad then trying to change them using "set-property" busctl call to FruDevice.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: Ic049bbf591878b4af344a352a2bec296e70cfb6e
show more ...
|
c994c029 | 10-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: add binary fields decoding
Binary fields are generally contains binary data, not text. This commit adds printing binary fields in HEX representation, as follows: BOARD_INFO_AM1: "00112233
FruDevice: add binary fields decoding
Binary fields are generally contains binary data, not text. This commit adds printing binary fields in HEX representation, as follows: BOARD_INFO_AM1: "00112233"
Tested: tested with Fru contains binary custom fields
Change-Id: Iaf271e54dd02e2a00167da5657857dc49b3e9734 Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
show more ...
|
2f0de17e | 13-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: some code cleanup
* Rename some variables to better represent meaning. * Replace "Fru" in fuctions/variables names to "FRU" according to OpenBMC "C++ Coding Style and Conventions" * Rep
FruDevice: some code cleanup
* Rename some variables to better represent meaning. * Replace "Fru" in fuctions/variables names to "FRU" according to OpenBMC "C++ Coding Style and Conventions" * Replace magical "8" with global named constant * Change some variables types from int to size_t
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: If492b1b7ad3ddc097a773530767c4d9c8010b3aa
show more ...
|
2eb946fa | 28-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: remove dead code
After the probe match refactor, some code is unused.
Change-Id: Ia2e2b708db17aa7a93e8a08a3260fe3af0f42b1f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> |
5d525413 | 26-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: Refactor matching
In a nutshell, rely on nlohmann's comparison operator to make the match instead of rolling our own. A nice side effect is the expected match behavior is wel
entity-manager: probe: Refactor matching
In a nutshell, rely on nlohmann's comparison operator to make the match instead of rolling our own. A nice side effect is the expected match behavior is well documented by nlohmann.
Code size and performance are unaffected (after removing dead code): before: 25121752 bytes unstripped, 3202608 bytes stripped after: 25146552 bytes unstripped, 3202616 bytes stripped before: ~22 seconds for 5000 iterations of the tests after: ~22 seconds for 5000 iterations of the tests
This refactor reduces the number of lines of code we need to maintain and test and increases the number of lines of code used from the extensively tested nlohmann json library.
The refactor simplifies the logic down to: return probe == value; for non-string probes. A string specialization is still required so we can pattern match.
The refactor enables support for matching non-trivial json types such as arrays and objects. New types need only be added to BasicVariantType.
There are several changed testcase expectations introduced by the refactor. Each is discussed in detail below.
- stringRegexError - boolStringError -> boolNeqString - falseEmptyError -> falseNeqEmpty - trueEmptyError -> trueNeqEmpty - uintStringError -> uintNeqString - uintEmptyError -> unitNeqEmpty - intStringError -> intNeqString - intEmptyError -> intNeqEmpty - doubleStringError -> doubleNeqString - doubleEmptyError -> doubleNeqEmpty Configuration file validation of regular expression syntax or the correct json type for a given dbus interface and property is better done by our offline validation tools. Avoid runtime complexity attempting to distinguish between user errors and probe statements that simply do not match by treating them the same and always return "no-match" instead of an invalid argument error for user error situations. stringRegexError could be an exception - there is no additional runtime complexity overhead associated with flagging it as a user error, but doing so would result in inconsistent behavior, so return no-match for it as well.
- stringZeroEqFalse -> stringZeroNeqFalse - stringOneEqTrue -> stringOneNeqTrue - stringEqUnit8 -> stringNeqUint8 - stringEqUint32 -> stringNeqUint32 - stringEqInt32 -> stringNeqInt32 - stringRegexEqInt32 -> stringRegexNeqInt32 - stringEqDouble -> stringNeqDouble Prior to this patch dbus properties are converted to strings in the event of a string probe. This works around mistakes in configuration files where the wrong json type is used but it can provide unexpected results like the probe "1" matching a true and the probe "11" matching a false, and the string "1*2" matching the number 112. Implementing the expected behavior is possible but would add complexity. For these reasons this refactor drops the string conversion and requires the user to use the correct types in their configurations.
- falseEqUint32Zero -> falseNeqUint32Zero - trueEqUint32Zero -> falseNeqUint32Zero - trueEqDoubleOne -> trueNeqDoubleOne - falseEqDoubleZero -> falseNeqDoubleZero - uintEqTrue -> uintNeqTrue - uintEqFalse -> uintNeqFalse - unitEqDoubleRound -> uintNeqDouble Prior to this patch dbus properties are coerced to unsigned integers in the event of a boolean or unsigned integer probes. Like in the previous section this can have unexpected results such as integral json types matching floats with fractional components from dbus. Again, implementing the expected behavior is possible but would add coomplexity, and again these conversions are abandoned and instead require the user to use the correct types in their configurations.
- intEqDoubleRound -> intNeqDoubleRoound - doubleEqFalse -> doubleNeqFalse - doubleEqTrue -> doubleNeqTrue Like the previous two sections, dbus properties are coerced to integers in the event of an integer probe, and dbus properties are coerced to doubles in the event of a double probe, and can result in unexpected behavior. Require the user to use the correct types in their configurations.
Change-Id: I6ce7a9c4a80d9612b15cd5e7bb4647bd96852e48 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
3cb8a604 | 25-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: factor out probe logic
Move the probe matching logic to a function so unit tests can be written for it.
Change-Id: Ie6d1ec82deb48437138c9065aea3a0eeacc9cffb Signed-off-by: Br
entity-manager: probe: factor out probe logic
Move the probe matching logic to a function so unit tests can be written for it.
Change-Id: Ie6d1ec82deb48437138c9065aea3a0eeacc9cffb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
1fb9f3ff | 28-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
docs: Add minimal doxygen setup
Add a Doxyfile and the minimum required tags to the sources to make anything useful appear in the documentation.
To generate just run: doxygen from the project root
docs: Add minimal doxygen setup
Add a Doxyfile and the minimum required tags to the sources to make anything useful appear in the documentation.
To generate just run: doxygen from the project root or doxygen ./Doxyfile.
Change-Id: Ie60eb1458586dc0a7843dca69e969b78817260d3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
82c84bbe | 26-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
fru-device: explicitly include headers
We were depending on our dependencies to include asio.hpp. Our dependency (sdbusplus) reworked things such that it doesn't include asio.hpp and now we are bro
fru-device: explicitly include headers
We were depending on our dependencies to include asio.hpp. Our dependency (sdbusplus) reworked things such that it doesn't include asio.hpp and now we are broken.
Change-Id: I3feb1b30cd91534e3a4ebb605f7a25af7322aa3f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
1c5b7064 | 19-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: use uint8_t instead of char for data
Currently there is mix of char and uint8_t in binary data handling code, which require lot of unnecessary casts. This change replaces char by uint8_t
FruDevice: use uint8_t instead of char for data
Currently there is mix of char and uint8_t in binary data handling code, which require lot of unnecessary casts. This change replaces char by uint8_t everywhere and removes casts where they are not needed anymore.
Tested: tested that there is no changes in FRU data published to dbus
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: Ic1ee984299c9be790a661e0c8e2111b3a2b98d6b
show more ...
|
4212485f | 19-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
probe: don't match unsupported json types
Prior to this patch unrecognized json types, such as arrays would cause a probe statement to match.
Change-Id: I05575e70ad5841b988ca1ae929381011c4cec28e Si
probe: don't match unsupported json types
Prior to this patch unrecognized json types, such as arrays would cause a probe statement to match.
Change-Id: I05575e70ad5841b988ca1ae929381011c4cec28e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
e707de6b | 10-Aug-2020 |
Andrei Kartashev <a.kartashev@yadro.com> |
FruDevice: fix FRU 6-bit ASCII field decoding
Fix uninitialized variable in 6-bit ASCII Fru field decoder which can cause wrong decoding of first 4 symbols group.
Signed-off-by: Andrei Kartashev <a
FruDevice: fix FRU 6-bit ASCII field decoding
Fix uninitialized variable in 6-bit ASCII Fru field decoder which can cause wrong decoding of first 4 symbols group.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com> Change-Id: I82522c651344fd08e707fa6ffde0974d3b970d14
show more ...
|
d73b7444 | 27-Mar-2020 |
Joshi-Mansi <mansi.joshi@linux.intel.com> |
Entity-Manager: Update product AssetTag inside Fru
Enable product assetTag property to writable in FruDevice. Added update AssetTag method to write new assetTag.
Tested: - Tested using "set-propert
Entity-Manager: Update product AssetTag inside Fru
Enable product assetTag property to writable in FruDevice. Added update AssetTag method to write new assetTag.
Tested: - Tested using "set-property" busctl call to FruDevice Service and checked that PRODUCT_ASSET_TAG property is getting updated.
Change-Id: Iff492b6d53467246a16515c4a766fcc99f4d0f20 Signed-off-by: Joshi-Mansi <mansi.joshi@linux.intel.com>
show more ...
|
c1136b7a | 24-Jun-2020 |
Wludzik, Jozef <jozef.wludzik@intel.com> |
Fix segfault caused by accessing non existing key in busmap
Tested: - Succesfully boot OpenBMC with error that key does not exist in busmap.
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.c
Fix segfault caused by accessing non existing key in busmap
Tested: - Succesfully boot OpenBMC with error that key does not exist in busmap.
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> Change-Id: I79736a786f9a88886ee8c54f7c6bf6e32d855769 Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|