pub struct Simple {
pub alpha: f64,
pub delay_budget: i64,
pub intercept: u16,
pub sample_interval: i64,
pub variance_threshold: f64,
}Fields§
§alpha: f64This is used to calculate the arrival rate:
Rate_n = alpha * Sample_n + (1 - alpha) * Rate_(n-1)
The bigger this value, the more sensitive it is to the latest sample.
Must be in the range (0, 1]. Defaults to server-assigned value if zero.
delay_budget: i64Wait time budget at the driver.
This is equivalent to W in Little’s Law. More practically, this is an upper bound for the average time buffers spend waiting in the queue of the device impl before they are processed by the device interface.
Guidance for driver implementors:
- If your driver uses a interrupt coalescing timeout, then this W should just be that or slightly larger to account for the processing time.
- If your driver does not use moderation, this value can be tuned: a starting point would be to use (bit rate, MTU, Rx depth) to derive a W under maximum pressure. As a reference (1Gbps, 1500, 256) leads to a W of 3.0 ms (256 / (10**9 / 8 / 1500) seconds). It will make little sense to go any bigger than that and you can decrease it and monitor for packet drops. You can compare the value against common interrupt coalescing configurations for reference.
Defaults to server-assigned value if zero.
intercept: u16Number of Rx buffers the device holds regardless of the arrival rate.
This is the constant offset (intercept in
L = lambda * W + intercept). delay_budget only accounts for
buffers that are in flight because of queueing delay; it cannot
account for buffers a device parks for structural reasons, such as
keeping a fixed size hardware descriptor ring filled or letting
firmware hold a reserve of host buffers. Those buffers are never
returned to the device interface, no matter how slow the traffic is,
so they must be accounted for separately.
Guidance for driver implementors: set this to the number of buffers
the device can hold without completing them. Leaving it at zero
while the device parks buffers will starve the device until
min_rx_buffers covers the shortfall.
Note that this is distinct from
[fuchsia.hardware.network.driver/DeviceImplInfo.min_rx_buffers],
which is a floor applied to the final target. A floor keeps the
target flat until the rate dependent term grows past it, whereas
intercept shifts the whole curve up.
sample_interval: i64The sampling interval for estimating packet arrival rate.
Determines how frequently the arrival rate is sampled and updated.
Defaults to server-assigned value if zero.
variance_threshold: f64The multiple of variance to consider when triggering immediate buffer requests.
When the current packet arrival rate exceeds the average arrival
rate by more than variance_threshold times the variance, the
queue will immediately request additional buffers.
Must be positive. Defaults to server-assigned value if zero.
Trait Implementations§
impl Copy for Simple
Source§impl<D: ResourceDialect> Decode<Simple, D> for Simple
impl<D: ResourceDialect> Decode<Simple, D> for Simple
Source§impl<D: ResourceDialect, T0: Encode<f64, D>, T1: Encode<i64, D>, T2: Encode<u16, D>, T3: Encode<i64, D>, T4: Encode<f64, D>> Encode<Simple, D> for (T0, T1, T2, T3, T4)
impl<D: ResourceDialect, T0: Encode<f64, D>, T1: Encode<i64, D>, T2: Encode<u16, D>, T3: Encode<i64, D>, T4: Encode<f64, D>> Encode<Simple, D> for (T0, T1, T2, T3, T4)
Source§impl PartialOrd for Simple
impl PartialOrd for Simple
impl Persistable for Simple
impl StructuralPartialEq for Simple
Source§impl TypeMarker for Simple
impl TypeMarker for Simple
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.