MSG Allocation

Onload User Guide (UG1586)

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

Description

Populated from an array of iovecs to specify the initial packet data. This function is called once to allocate the packet template and populate the template with the bulk of the payload data.

Definition

extern int onload_msg_template_alloc(
int fd,
struct iovec* initial_msg,
int iovlen,
onload_template_handle* handle,
unsigned flags);

Formal Parameters

fd
File descriptor to send on.
initial_msg
Array of iovecs which are the bulk of the payload.
iovlen
Length of initial msg.
handle
Template handle, used to refer to this template.
flags
See notes below. Can also be set to zero.

Return Value

0 on success.

Non-zero otherwise.

Notes

The initial iovec array passed to onload_msg_template_alloc() must have at least one element having a valid address and non-zero length.

If PIO allocation fails, then onload_msg_template_alloc() will fail. Setting the flags to ONLOAD_TEMPLATE_FLAGS_PIO_RETRY will force allocation without PIO while attempting to allocate the PIO in later calls to onload_msg_template_update().