Using CTPIO with ef_vi

Onload User Guide (UG1586)

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

The OpenOnload 201805 distribution includes an example application using CTPIO with ef_vi:

onload/src/tests/rtt/rtt_efvi.c.

When OpenOnload is installed the test application is found at the following location:

/onload-201805/build/gnu_x86_64/tests/rtt

The following sequence is required to send via CTPIO:

  1. When allocating a VI, ef_vi_alloc_from_pd(), set the EF_VI_TX_CTPIO flag. Also set the TX timestamping flag if required.
  2. To initiate a send, form a complete Ethernet frame (excluding FCS) in host memory. Initiate the send with ef_vi_transmit_ctpio() or ef_vi_transmitv_ctpio().
  3. Post a fall-back descriptor using ef_vi_transmit_ctpio_fallback() or ef_vi_transmitv_ctpio_fallback(). These calls are used just like the standard DMA send calls (ef_vi_transmit() etc.), and so must be provided with a copy of the frame in registered memory.
  4. A TX completion event is returned to the host application regardless of whether the frame is sent via CTPIO or the legacy DMA send method.

The posting of a fall-back descriptor is not on the latency critical path, provided the CTPIO operation succeeds, however it should be posted before posting any further sends on the same VI.

For further details, refer to the ef_vi User Guide (SF-114063-CD).