Skip to content

Conversation

@727Hsj
Copy link

@727Hsj 727Hsj commented Jan 1, 2026

Problem Description and Root Cause:
During the communication process based on VSOCK between Kylinos and Starry, Starry encountered communication stagnation after receiving 1KB of data, despite configuring a 64KB receiving buffer. The root cause is that StarryOS did not receive the CreditRequest event from the sender, so the receiver needs to actively update the buffer.

Modifications Implemented:

  1. Proactive update logic after receive operations was integrated into axdriver_virtio.
    Related commit: axdriver_virtio

  2. Receive decisions following Received event polling are now elevated from axdriver_virtio to the upper layer.

  3. A pending_event queue was introduced to track Received events that were intentionally ignored due to either axnet's or virtio's ring buffer capacity being exhausted.

4.Redundant parameters (e.g., buf) were removed to streamline the interface.

Testing & Validation:

  1. Normal Receive Operation: Data is correctly read when the upper-layer buffer has sufficient space.
  2. Stress Test – virtio_drivers Ring Buffer: When the underlying ring buffer is full but the upper layer has capacity, data is transferred as much as possible from the driver layer.
  3. Stress Test – axnet Ring Buffer: If the upper-layer buffer is insufficient, only partial data is read, with the remainder retained in the underlying driver—no packets are dropped, and ignored events are logged.
  4. Full Buffer Saturation: When both upper-layer and underlying buffers are completely full, no data is read, no packets are dropped, and no transmissions are triggered. Once buffer space becomes available, receive operations resume based on previously logged ignored events.

Performance Impact:
Before the fix: Communication was limited to one ACK per 1KB receive, with Starry achieving ~101 KB/s throughput.

After the fix: Starry’s receive throughput increased to ~2900 KB/s.

@AsakuraMizu
Copy link

Please note that this PR is temporarily postponed due to the need to update the axdriver_crates version. I need to figure out a suitable way to track its version on the dev branch.

@AsakuraMizu AsakuraMizu changed the title fix: modify the receiving logic of vsock fix(net/vsock): receiving logic Jan 12, 2026
@AsakuraMizu AsakuraMizu merged commit e044290 into Starry-OS:dev Jan 12, 2026
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.

2 participants