Skip to content

virtio-net follow-ups from #172: warn throttling, VecDeque backlog, unadvertised frame ceiling #174

Description

@cspinetta

Problem

Three findings from the adversarial review of #172, each real but low impact, decided against rather than fixed so the PR stayed focused on the hang.

The break warnings are not throttled. #172 batches the malformed-chain count into one warn! per kick, because a guest can post a malformed chain for every buffer in its ring. The batch-bound, ring-validation, and writability warnings still emit one line each per kick, on the vCPU thread, and a guest kicks at will. The multiplier is far smaller — at most one line per kick per site — but it is the same shape.

rx_buffer uses Vec with remove(0). Shedding the oldest frame at the 1024-frame ceiling memmoves ~1023 Vec headers, not payloads, and only when the guest is consuming no RX at all. VecDeque with pop_front removes the question and reads better. This is a clarity change, not a performance one — the measurement says the current code is fine.

MAX_TX_FRAME_BYTES is a ceiling the driver is never told about. The device does not offer VIRTIO_NET_F_MTU, so a driver has no way to learn the largest frame this device will accept. The value covers a frame at Linux's max_mtu of 65535 carrying two 802.1Q tags, so nothing a Linux driver can hand over lands above it — but a private limit on a wire path is worth either advertising or documenting as deliberately unadvertised.

Proposed change

Take them together or separately; none blocks anything. The MTU one needs a decision before code: advertising VIRTIO_NET_F_MTU changes what the device negotiates, which is a wire-visible change and wants its own justification.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:networkSLIRP, NAT, 9p transport, proxy/egressenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions