Repository navigation
Add emit/parsing round-trip test cases and fix bugs found by them - #39
Merged
Merged
Conversation
Add public `EthtoolBit`, `EthtoolBitset` and `EthtoolBitsetValue` types to model ethtool bitsets: the verbose form (list of bits with names) and the compact form (value/mask words), with byte exact emitting support. Signed-off-by: Gris Ge <cnfourt@gmail.com>
Replace `EthtoolFeatureBit` with the new `EthtoolBitset` type. Feature bitset parsing now supports the compact form (`ETHTOOL_FLAG_COMPACT_BITSETS`) used by `ethtool -k`, keeps index 0, name-less bits and the `ETHTOOL_A_BITSET_SIZE`/`ETHTOOL_A_BITSET_NOMASK` attributes, and parsed bitsets are emitted instead of panicking with `todo!()`. Signed-off-by: Gris Ge <cnfourt@gmail.com>
`EthtoolLinkModeAttr::Ours`/`Peer` now carry `EthtoolBitset` and are emitted with the `NLA_F_NESTED` flag like the kernel does. Signed-off-by: Gris Ge <cnfourt@gmail.com>
`EthtoolTsInfoAttr` timestamping, tx types and rx filters bitsets now carry `EthtoolBitset` and are emitted with the `NLA_F_NESTED` flag like the kernel does. Signed-off-by: Gris Ge <cnfourt@gmail.com>
`EthtoolFecAttr::Modes` now carries `EthtoolBitset`; modes and stats are emitted with the `NLA_F_NESTED` flag. `EthtoolFecStat` values became `Vec<u64>` to keep total and per lane counters, and the empty `ETHTOOL_A_FEC_STAT_CORR_BITS` case no longer fails to parse. The obsolete `bitset_util` helpers are removed. Signed-off-by: Gris Ge <cnfourt@gmail.com>
`EthtoolPauseStatAttr::Tx` was emitted with the RX attribute id. Signed-off-by: Gris Ge <cnfourt@gmail.com>
Use nlmon captured kernel packets from virtio-net, veth and netdevsim to test features, link modes, tsinfo, rings, channels, coalesce, pause and FEC parsing. Every test parses the kernel reply, asserts the expected attributes and verifies byte exact emitting, following the workflow of netlink-packet-route's tests. The tests live in `src/tests` as unit tests, gated to little-endian hosts because the captured inlined data is little-endian. Signed-off-by: Gris Ge <cnfourt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.