ethtool: add RSS and ring configuration over netlink - #1208
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdded Linux generic-netlink ethtool support. The change implements shared request handling, ring-parameter get/set APIs, RSS configuration get/set APIs, validation, attribute parsing, serialization, and Linux tests. ChangesLinux ethtool support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant NetDevRingsSet
participant ethtoolRequest
participant EthtoolFamily
Caller->>NetDevRingsSet: submit ring configuration
NetDevRingsSet->>ethtoolRequest: send ETHTOOL_MSG_RINGS_SET
ethtoolRequest->>EthtoolFamily: generic-netlink update with ring attributes
EthtoolFamily-->>ethtoolRequest: acknowledgement
ethtoolRequest-->>NetDevRingsSet: request result
NetDevRingsSet-->>Caller: error or success
sequenceDiagram
participant Caller
participant NetDevRSSSet
participant ethtoolRequest
participant EthtoolFamily
Caller->>NetDevRSSSet: submit RSS configuration
NetDevRSSSet->>ethtoolRequest: send ETHTOOL_MSG_RSS_SET with context
ethtoolRequest->>EthtoolFamily: generic-netlink update with RSS attributes
EthtoolFamily-->>ethtoolRequest: acknowledgement
ethtoolRequest-->>NetDevRSSSet: request result
NetDevRSSSet-->>Caller: error or success
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Add generic netlink support for reading and updating ring parameters, including TCP header/data split and its threshold. Add RSS get and partial set support for existing contexts so callers can safely update the indirection table without disturbing the hash key or function. Unit tests cover attribute encoding, decoding, malformed replies, optional update semantics, and netlink attribute size limits. Signed-off-by: Aaron Campbell <aaron@monkey.org>
0ab8595 to
cb8f5d0
Compare
Description
Add generic netlink support for reading and updating ring parameters, including TCP header/data split and its threshold. Add RSS get and partial set support for existing contexts so callers can safely update the indirection table without disturbing the hash key or function.
Unit tests cover attribute encoding, decoding, malformed replies, optional update semantics, and netlink attribute size limits.
These changes will help Cilium take advantage of the zero-copy networking features added in Linux 7.1—see the upstream queue-leasing merge.
Hardware validation: RSS and TCP header/data split
The RSS and ring-parameter implementations in this branch were tested on Aquantia Atlantic and Intel ICE hardware using Ubuntu's Linux 7.0 HWE kernel.
Environment
7.0.0-28-genericx86_64go1.25.0 linux/amd64RSS device:
eno21d6a:04c0, revision 03)atlantic, kernel version7.0.0-28-generic1.5.390000:03:00.00x1)0x0)Header-split device:
enp129s0f1np1ice, kernel version7.0.0-28-genericThe standalone sources are attached together as
netlink-ethtool-rss-rings-hardware-tests.tgz:netlink-ethtool-rss-hardware-test.gonetlink-ethtool-header-split-hardware-test.goBuild and execution
RSS indirection-table validation: Atlantic
The RSS program:
NetDevRSSGetfor the main RSS context and independently reads the same state using the legacyETHTOOL_GRSSHioctl.NetDevRSSSetwith the modified table.NetDevRSSSetand checks through both read paths that the complete original configuration is restored.It checks that the device and interface index still match the saved state, refuses to continue if the configuration changes unexpectedly, performs deferred best-effort restoration if a case fails, and exits nonzero on any failed invariant.
The original 64-entry table mapped entries to queues 0 through 7 in a repeating pattern. The program swapped entry 63 from queue 7 with entry 60 from queue 4, then restored both entries:
table[60]table[63]17a3ddcb68d0e9fc1ab26f2c2cb9d6b58f6ae166d985d70996505f9a90cc19c25eb74a4c7001945251acaf941163cde5aed4256e9413a3115bc4fdb0d974840c17a3ddcb68d0e9fc1ab26f2c2cb9d6b58f6ae166d985d70996505f9a90cc19c2The digest covers the context, hash function, input transformation, complete 64-entry table, and hash key. Its change confirms that the requested table was programmed; returning to the original digest confirms exact restoration.
TCP header/data-split validation: Intel ICE
The header-split program:
NetDevRingsGetand the main RSS context withNetDevRSSGet.TCPDataSplitfrom disabled to enabled using a partialNetDevRingsSetupdate.NetDevRingsSet.Scope and limitations
The Atlantic test validates the complete RSS indirection-table control-plane round trip against a real driver: generic-netlink read, partial update, readback, restoration, and agreement with the legacy ioctl read path.
The ICE test validates TCP header/data-split control-plane programming, readback, RSS preservation, and restoration through
NetDevRingsGetandNetDevRingsSet.No controlled matching traffic was generated and per-queue packet counters or receive buffers were not inspected. The tests therefore do not independently validate data-plane RSS distribution or prove that ICE placed TCP headers and payloads in separate buffers.
The RSS test did not change the hash key, hash function, or input transformation. The ICE test changed only
TCPDataSplit; it did not programHDSThreshold, ring sizes, buffer length, or channel count.netlink-ethtool-rss-rings-hardware-tests.tgz
Summary by CodeRabbit