Skip to content

Conversation

erfrimod
Copy link
Contributor

Linux netvsc sends an OID to stop receiving packets on vmbus channel close. Example scenarios: hibernation and MTU change. Prior to opening a new channel and processing the packets, netvsc checks that there are no pending packets. If there are, netvsc logs and error and is unable to recover. We observe the error: hv_netvsc eth0: Ring buffer not empty after closing rndis in the guest syslog.

Modifying netvsp to handle the OID and stop processing RX traffic. This will allow for netvsc to successfully close and re-open the vmbus channel, even under heavy incoming traffic.

Cherry pick of #1873

Linux netvsc sends an OID to stop receiving packets on vmbus channel
close. Example scenarios: hibernation and MTU change. Prior to opening a
new channel and processing the packets, netvsc checks that there are no
pending packets. If there are, netvsc logs and error and is unable to
recover. We observe the error: `hv_netvsc eth0: Ring buffer not empty
after closing rndis` in the guest syslog.

Modifying netvsp to handle the OID and stop processing RX traffic. This
will allow for netvsc to successfully close and re-open the vmbus
channel, even under heavy incoming traffic.

---------

Co-authored-by: Sunil Muthuswamy <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 22:38
@erfrimod erfrimod requested a review from a team as a code owner August 27, 2025 22:38
@github-actions github-actions bot added the release_2505 Targets the release/2505 branch. label Aug 27, 2025
Copy link
Contributor

@Copilot 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

This PR adds handling for the RNDIS packet filter OID (OID_GEN_CURRENT_PACKET_FILTER) to the netvsp driver to support proper vmbus channel closure scenarios. When Linux netvsc needs to close and reopen a vmbus channel (during hibernation or MTU changes), it sends an OID to stop receiving packets, which was previously unhandled and caused channel recovery failures.

Key changes:

  • Implements packet filter OID handling to allow stopping/starting RX traffic
  • Adds packet filter state tracking across channel restore operations
  • Updates coordinator messaging to propagate filter changes across subchannels

Reviewed Changes

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

File Description
vm/devices/net/netvsp/src/lib.rs Core implementation of packet filter handling, state management, and coordinator updates
vm/devices/net/netvsp/src/rndisprot.rs Adds packet filter constants and OID definitions
vm/devices/net/netvsp/src/saved_state.rs Extends saved state to include packet filter for persistence
vm/devices/net/netvsp/src/test.rs Comprehensive test coverage for packet filter functionality

@erfrimod erfrimod merged commit d806090 into microsoft:release/2505 Aug 28, 2025
25 checks passed
@erfrimod erfrimod deleted the erfrimod/netvsp-rndis-packet-filter-2505 branch September 3, 2025 20:47
benhillis added a commit that referenced this pull request Sep 3, 2025
benhillis added a commit that referenced this pull request Sep 3, 2025
#1927)" (#1959)

While doing validation of hibernation an issue was found with this
patch. This change is being reverted until the follow-up is ready.

This reverts commit d806090.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_2505 Targets the release/2505 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants