mirror of
https://github.com/ipxe/ipxe
synced 2026-01-22 20:19:08 +03:00
[neighbour] Add the ability to artificially delay outbound packets
Add a fault-injection mechanism that allows an arbitrary delay (configured via config/fault.h) to be added to any packets transmitted via the neighbour resolution mechanism, as a way of reproducing symptoms that occur only on high-latency connections such as a satellite uplink. The neighbour discovery mechanism is not a natural conceptual fit for this artficial delay, since neighbour discovery has nothing to do with transmit latency. However, the neighbour discovery mechanism happens to already include a deferred transmission queue that can be (ab)used to implement this artifical delay in a minimally intrusive way. In particular, there is zero code size impact on a standard build with no artificial delay configured. Implementing the delay only for packets transmitted via neighbour resolution has the side effect that broadcast packets (such as DHCP and ARP) are unaffected. This is likely in practice to produce a better emulation of a high-latency uplink scenario, where local network traffic such as DHCP and ARP will complete quickly and only the subsequent TCP/UDP traffic will experience delays. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -60,6 +60,12 @@ struct neighbour {
|
||||
struct list_head tx_queue;
|
||||
};
|
||||
|
||||
/** A neighbour transmission delay pseudo-header */
|
||||
struct neighbour_delay {
|
||||
/** Original transmission time (in ticks) */
|
||||
unsigned long start;
|
||||
};
|
||||
|
||||
extern struct list_head neighbours;
|
||||
|
||||
extern int neighbour_tx ( struct io_buffer *iobuf, struct net_device *netdev,
|
||||
|
||||
Reference in New Issue
Block a user