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:51
@erfrimod erfrimod requested a review from a team as a code owner August 27, 2025 22:51
@github-actions github-actions bot added the release_2411 Targets the release/2411 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 implements handling of the RNDIS packet filter OID (Object Identifier) to stop Rx traffic when the filter is set to None. This addresses an issue where Linux netvsc fails to properly close and reopen vmbus channels during operations like hibernation and MTU changes, causing the error "Ring buffer not empty after closing rndis".

Key changes:

  • Added packet filter state tracking and handling for RNDIS OID_GEN_CURRENT_PACKET_FILTER
  • Modified coordinator messaging to handle packet filter updates across all channels
  • Added comprehensive test coverage for packet filter functionality

Reviewed Changes

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

File Description
vm/devices/net/netvsp/src/lib.rs Main implementation: added packet filter state, OID handling, coordinator messaging updates, and Rx filtering logic
vm/devices/net/netvsp/src/rndisprot.rs Added packet filter constants and type definitions for RNDIS protocol
vm/devices/net/netvsp/src/saved_state.rs Added packet filter field to saved state for persistence across restarts
vm/devices/net/netvsp/src/test.rs Added comprehensive test for packet filter functionality and updated existing test to include filter setup

@erfrimod erfrimod closed this Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_2411 Targets the release/2411 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant