net_mana: log EtherType on CQE_TX_INVALID_ETH_TYPE warnings#3375
Open
erfrimod wants to merge 2 commits intomicrosoft:mainfrom
Open
net_mana: log EtherType on CQE_TX_INVALID_ETH_TYPE warnings#3375erfrimod wants to merge 2 commits intomicrosoft:mainfrom
erfrimod wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts net_mana TX completion handling so CQE_TX_INVALID_ETH_TYPE is treated as a non-fatal condition and logs the rejected EtherType for future triage.
Changes:
- Handle
CQE_TX_INVALID_ETH_TYPEintx_poll()as a WARN (not ERROR) and add best-effort EtherType tracing from the bounced buffer or guest memory. - Track the head segment GPA in
PostedTxto support guest-memory EtherType reads when needed. - Add unit tests for bounce-buffer GPA mapping and EtherType extraction helpers; make
DoorbellPage::null()public to support these tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| vm/devices/net/net_mana/src/lib.rs | Adds CQE-specific WARN handling and EtherType tracing helpers + unit tests. |
| vm/devices/net/mana_driver/src/queues.rs | Exposes DoorbellPage::null() publicly for test construction of Wq. |
yuqiong6
approved these changes
May 4, 2026
7c3896d to
472a499
Compare
Comment on lines
+1609
to
+1613
| fn gpa_to_offset(&self, gpa: u64) -> Option<u32> { | ||
| let page_pfn = gpa / PAGE_SIZE64; | ||
| let offset_in_page = (gpa - page_pfn * PAGE_SIZE64) as u32; | ||
| let page_idx = self.mem.pfns().iter().position(|&pfn| pfn == page_pfn)? as u32; | ||
| Some(page_idx * PAGE_SIZE32 + offset_in_page) |
472a499 to
e5b09e5
Compare
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.
When the MANA HW rejects a packet
CQE_TX_INVALID_ETH_TYPE, it gets incorrectly logged as an Error. The packet has been dropped and the queues are fine. Lowering the severity of the traces to a Warning. Adding a trace of the EtherType that triggered the rejection so in the future we can know what traffic pattern is hitting hardware enforcement.Valid types: IPv4 (0x0800), IPv6 (0x86DD), ARP (0x0806), 802.1Q VLAN (0x8100)
Mostly likely invalid types being sent: LLDP (0x88CC), RARP (0x8035)
CQE_TX_INVALID_ETH_TYPE, so they are no longer traced as error.Tested on a lab machine