Skip to content

Commit 0e02b03

Browse files
Iulian Barbudianpopa
authored andcommitted
[net] fix rx queue freeze
Under heavy ingress traffic we might end up in a situation where the tap device is full, but the rx.deferred_frame flag is not set. Beeing in this state the firecracker RX queue becomes effectively blocked. The tap won't issue any new event because of the EPOLLET flag, while any rate limiter or RX queue event won't do any processing because the rx.deferred_frame flag is not set. We need to make sure we set the rx.deferred_frame flag on all the paths that leave unprocessed frames in the tap. Signed-off-by: Serban Iorga <[email protected]> Signed-off-by: Iulian Barbu <[email protected]>
1 parent 03bd5dc commit 0e02b03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/devices/src/virtio/net/device.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl Net {
612612
DeviceState::Inactive => unreachable!(),
613613
};
614614
METRICS.net.rx_tap_event_count.inc();
615-
if self.queues[RX_INDEX].is_empty(mem) {
615+
if self.queues[RX_INDEX].is_empty(mem) && self.rx_deferred_frame {
616616
METRICS.net.no_rx_avail_buffer.inc();
617617
return;
618618
}
@@ -1402,6 +1402,7 @@ pub(crate) mod tests {
14021402

14031403
// The RX queue is empty.
14041404
let tap_event = EpollEvent::new(EventSet::IN, net.tap.as_raw_fd() as u64);
1405+
net.rx_deferred_frame = true;
14051406
check_metric_after_block!(
14061407
&METRICS.net.no_rx_avail_buffer,
14071408
1,

0 commit comments

Comments
 (0)