3. Ethernet Transport Library

Ethernet transport library provides a set of APIs for managing hardware network accelerators and pushing network packets to the hardware accelerators using DPDK. The library provides common APIs which could be used by DAO libraries that uses ethernet as transport layer.

3.1. Architecture Overview

The ethernet transport library abstracts ‘rte_ethdev’ library from DPDK and exposes only the necessary functionality to the user.

3.2. API Usage

  1. Initialize the ethernet transport library using dao_eth_trs_init().

  2. Retrieve information about the ethernet transport devices using dao_eth_trs_info().

  3. Allocate the ethernet transport device using dao_eth_trs_dev_alloc().

  4. Configure the ethernet transport device queues using dao_eth_trs_dev_queue_configure().

  5. Map queues using dao_eth_trs_dev_queue_map() to get the actual ethernet port ID and queue ID corresponding to the transport device ID and queue ID.

  6. Start the ethernet transport device using dao_eth_trs_dev_start().

  7. Transmit/Receive data using dao_eth_trs_tx() and dao_eth_trs_rx() with the port ID and queue ID obtained from dao_eth_trs_dev_queue_map().

  8. Stop the ethernet transport device using dao_eth_trs_dev_stop().

  9. Close the ethernet transport device using dao_eth_trs_dev_free().

  10. Finalize the ethernet transport library using dao_eth_trs_fini().

3.3. Transport Protocol

The ethernet transport library uses the DPDK ethernet interface. To minimize the overhead of transport, the library uses the following format for the packet.

3.3.1. TRS header format

struct __rte_packed dao_eth_trs_hdr {
	/** Packet op type. @see dao_eth_trs_op_type */
	uint16_t op_type;
	/** Packet length */
	uint16_t op_len;
};

3.3.2. TRS packet format

struct __rte_packed dao_eth_trs_pkt {
	/** Packet header */
	struct dao_eth_trs_hdr hdr;
	/** Packet data */
	uint8_t data[];
};

3.4. Usage Restrictions

  • The ethernet transport library’s datapath APIs are intended for single-threaded environments. Concurrent access from multiple threads is not supported.

  • Multi-segment packets are not supported by the library.

  • Packet fragmentation and reassembly are not handled by the ethernet transport library.

  • Features such as packet filtering and classification are not provided.

  • Advanced offloading features, including checksum offloading and TCP segmentation offloading, are not supported.

  • Flow control checks are not performed by the library. Users must ensure that hardware network accelerators are not overloaded.