onload_delegated_send_prepare

Onload User Guide (UG1586)

Document ID
UG1586
Release Date
2023-07-31
Revision
1.2 English

Description

Prepare to send up to size bytes. Allocate TCP headers and prepare them with Ethernet IP/TCP header data - including current sequence number and acknowledgment number.

Definition

enum onload_delegated_send_prepare (
int fd,
int size,
uint flags,
struct onload_delegated_send* )

Formal Parameters

fd
File descriptor to send on.
size
Size of payload data.
flags
See below.
struct onload_delegated_send*
See struct onload_delegated_send.

Return Value

Refer to onload_delegated_send_rc above.

Notes

This function can be called speculatively so that the packet buffer is prepared in advance, headers are added so that the packet payload data can be added immediately before the send is required.

This function assumes the packet length is equal to MSS in which case there is no need to call onload_delegated_send_tcp_update().

Flags are used for ARP resolution:

  • default flags = 0
  • ONLOAD_DELEGATED_SEND_FLAG_IGNORE_ARP - do not do ARP lookup, the caller will provide destination MAC address.
  • ONLOAD_DELEGATED_SEND_FLAG_RESOLVE_ARP - if ARP information is not available, send a speculative TCP_ACK to provoke kernel into ARP resolution, and wait up to 1 ms for ARP information to appear.
Note: TCP send window/congestion windows must be respected during delegated sends.

See extensions.h for flags and return code values.