linux-support 0.0.25

Comprehensive Linux support for namespaces, cgroups, processes, scheduling, parsing /proc, parsing /sys, signals, hyper threads, CPUS, NUMA nodes, unusual file descriptors, PCI devices and much, much more
// This file is part of linux-support. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT. No part of linux-support, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2020 The developers of linux-support. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT.


#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub(super) struct VirtioNetCoalescingStrategy;

impl CoalescingStrategy for VirtioNetCoalescingStrategy
{
	#[inline(always)]
	fn coalesce_configuration(&self, _paired_transmit_receive_queues: bool, _receive_coalescing_preference: &ReceiveCoalescingPreference, transmit_coalescing_preference: &TransmitCoalescingPreference) -> CoalesceConfiguration
	{
		CoalesceConfiguration
		{
			adaptive_coalescing: None,
			
			receive_transmit: ReceiveTransmitCoalescing
			{
				receive: CoalescePair
				{
					microseconds: None,
					
					maximum_frames: Some(new_non_zero_u32(1))
				},
				
				transmit: CoalescePair
				{
					microseconds: None,
					
					maximum_frames: if transmit_coalescing_preference.enable_napi_weight
					{
						Some(new_non_zero_u32(1))
					}
					else
					{
						None
					},
				},
			},
			
			receive_transmit_whilst_irq_is_being_serviced_by_the_host: ReceiveTransmitCoalescing::DisabledWhereMaximumFramesUnsupported,
			
			low_packet_rate_packets_per_second_threshold: None,
			
			receive_transmit_at_low_packet_rate: ReceiveTransmitCoalescing::DisabledWhereMaximumFramesUnsupported,
			
			high_packet_rate_packets_per_second_threshold: None,
			
			receive_transmit_at_high_packet_rate: ReceiveTransmitCoalescing::DisabledWhereMaximumFramesUnsupported,
			
			statistics_block_coalesce_microseconds: None
		}
	}
}