Skip to content

net_mana: log EtherType on CQE_TX_INVALID_ETH_TYPE warnings#3375

Open
erfrimod wants to merge 2 commits intomicrosoft:mainfrom
erfrimod:erfrimod/tracing-invalid-eth-type
Open

net_mana: log EtherType on CQE_TX_INVALID_ETH_TYPE warnings#3375
erfrimod wants to merge 2 commits intomicrosoft:mainfrom
erfrimod:erfrimod/tracing-invalid-eth-type

Conversation

@erfrimod
Copy link
Copy Markdown
Contributor

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)

  • Created a branch in tx_poll() to catch CQE_TX_INVALID_ETH_TYPE, so they are no longer traced as error.
  • Make a best-effort attempt to trace the Eth Type for future triage of what types are being rejected. Attempt to find the SGE in bounce buffer and guest memory.
  • Added unit tests.

Tested on a lab machine

[495.417602] net_mana: WARN  tx ethernet frame eth_type=0x8888

Copilot AI review requested due to automatic review settings April 24, 2026 22:41
@erfrimod erfrimod requested a review from a team as a code owner April 24, 2026 22:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TYPE in tx_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 PostedTx to 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.

Comment thread vm/devices/net/net_mana/src/lib.rs Outdated
Comment thread vm/devices/net/net_mana/src/lib.rs
Comment thread vm/devices/net/net_mana/src/lib.rs Outdated
Copilot AI review requested due to automatic review settings May 8, 2026 23:41
@erfrimod erfrimod force-pushed the erfrimod/tracing-invalid-eth-type branch from 7c3896d to 472a499 Compare May 8, 2026 23:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread vm/devices/net/net_mana/src/lib.rs
Comment thread vm/devices/net/net_mana/src/lib.rs Outdated
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)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring for now

@erfrimod erfrimod force-pushed the erfrimod/tracing-invalid-eth-type branch from 472a499 to e5b09e5 Compare May 9, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants