Data Accelerator Offload
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
dao_eth_trs.h File Reference
#include <rte_common.h>
#include <stdint.h>
#include <rte_ethdev.h>
#include <rte_mempool.h>

Go to the source code of this file.

Data Structures

struct  dao_eth_trs_hdr
 
struct  dao_eth_trs_pkt
 
struct  dao_eth_trs_dev_config
 
struct  dao_eth_trs_queue_config
 
struct  dao_eth_trs_info
 

Macros

#define dao_eth_trs_tx   rte_eth_tx_burst
 
#define dao_eth_trs_rx   rte_eth_rx_burst
 

Enumerations

enum  dao_eth_trs_op_type {
  DAO_ETH_TRS_OP_TYPE_REFLECT = 0x0 , DAO_ETH_TRS_OP_TYPE_CRYPTO_START = 0x1000 , DAO_ETH_TRS_OP_TYPE_CRYPTO_MISC , DAO_ETH_TRS_OP_TYPE_CRYPTO_SYM ,
  DAO_ETH_TRS_OP_TYPE_CRYPTO_ASYM , DAO_ETH_TRS_OP_TYPE_SYM_SESSION_CREATE , DAO_ETH_TRS_OP_TYPE_SYM_SESSION_DESTROY , DAO_ETH_TRS_OP_TYPE_CRYPTO_END = 0x1fff
}
 

Functions

int dao_eth_trs_init (void)
 
int dao_eth_trs_fini (void)
 
int dao_eth_trs_info (struct dao_eth_trs_info *info)
 
int dao_eth_trs_dev_alloc (uint8_t dev_id, struct dao_eth_trs_dev_config *config)
 
int dao_eth_trs_dev_queue_configure (uint8_t dev_id, uint16_t queue_id, struct dao_eth_trs_queue_config *conf)
 
int dao_eth_trs_dev_queue_map (uint8_t dev_id, uint16_t dev_queue_id, uint16_t *port_id, uint16_t *queue_id)
 
int dao_eth_trs_dev_start (uint8_t dev_id)
 
int dao_eth_trs_dev_stop (uint8_t dev_id)
 
int dao_eth_trs_dev_free (uint8_t dev_id)
 

Detailed Description

This file contains the API for ethernet transport library.

Ethernet transport is a mechanism to transport data over ethernet devices using a common API. It is designed to be used by protocols that need to transport data over ethernet devices without having to deal with the configuration of the underlying devices. The ethernet transport device is an encapsulation of one or more ethernet devices. Mapping of the transport device to the underlying ethernet devices is done by the ethernet transport library.

The APIs can be invoked in the following order:

  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. Get the ethernet transport device queue map using dao_eth_trs_dev_queue_map() to get 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() using port ID and queue ID got 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().

Definition in file dao_eth_trs.h.

Macro Definition Documentation

◆ dao_eth_trs_tx

#define dao_eth_trs_tx   rte_eth_tx_burst

Alias for rte_eth_tx_burst

Definition at line 105 of file dao_eth_trs.h.

◆ dao_eth_trs_rx

#define dao_eth_trs_rx   rte_eth_rx_burst

Alias for rte_eth_rx_burst

Definition at line 106 of file dao_eth_trs.h.

Enumeration Type Documentation

◆ dao_eth_trs_op_type

DAO ethernet transport op type based on the class of operation.

See also
dao_eth_trs_hdr
Enumerator
DAO_ETH_TRS_OP_TYPE_REFLECT 

Return the packet unchanged to the same queue

DAO_ETH_TRS_OP_TYPE_CRYPTO_START 

OP type crypto start

DAO_ETH_TRS_OP_TYPE_CRYPTO_MISC 

Misc crypto ops (passthrough etc)

DAO_ETH_TRS_OP_TYPE_CRYPTO_SYM 

Symmetric crypto ops (FC etc)

DAO_ETH_TRS_OP_TYPE_CRYPTO_ASYM 

Asymmetric crypto ops (RSA etc)

DAO_ETH_TRS_OP_TYPE_SYM_SESSION_CREATE 

Session create

DAO_ETH_TRS_OP_TYPE_SYM_SESSION_DESTROY 

Session destroy

DAO_ETH_TRS_OP_TYPE_CRYPTO_END 

OP type crypto end

Definition at line 49 of file dao_eth_trs.h.

Function Documentation

◆ dao_eth_trs_init()

int dao_eth_trs_init ( void  )

Initialize ethernet transport.

This function initializes the ethernet transport library and sets up the necessary resources. It must be called after EAL initialization and before any other ethernet transport API is invoked. If no supported ethernet devices are found, this function returns an error.

Returns
0 on success, negative on error.

◆ dao_eth_trs_fini()

int dao_eth_trs_fini ( void  )

Finalize ethernet transport.

This function finalizes the ethernet transport library and frees the resources allocated during initialization.

Returns
0 on success, negative on error.

◆ dao_eth_trs_info()

int dao_eth_trs_info ( struct dao_eth_trs_info info)

Get information about the ethernet transport devices.

This function retrieves information about the ethernet transport devices.

Parameters
infoPointer to the structure to store the information.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_alloc()

int dao_eth_trs_dev_alloc ( uint8_t  dev_id,
struct dao_eth_trs_dev_config config 
)

Allocate an ethernet transport device.

This function initializes the necessary resources for the ethernet transport device for a given device ID and configuration. The device is an encapsulation of one or more ethernet devices.

Parameters
dev_idDevice ID of the ethernet transport device to allocate.
configConfiguration parameters for the ethernet transport device.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_queue_configure()

int dao_eth_trs_dev_queue_configure ( uint8_t  dev_id,
uint16_t  queue_id,
struct dao_eth_trs_queue_config conf 
)

Configure an ethernet transport device queue.

This function configures the RX/TX queue of the ethernet transport device with the configuration parameters provided by the caller.

Parameters
dev_idDevice ID of the ethernet transport device.
queue_idQueue ID of the RX/TX queue.
confConfiguration parameters for the RX/TX queue.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_queue_map()

int dao_eth_trs_dev_queue_map ( uint8_t  dev_id,
uint16_t  dev_queue_id,
uint16_t *  port_id,
uint16_t *  queue_id 
)

Get ethernet port ID and queue ID for a transport device ID and queue ID.

This function retrieves the ethernet port ID and queue ID corresponding to the transport device ID and queue ID. It can be used to transmit/receive packets using the APIs dao_eth_trs_tx() and dao_eth_trs_rx().

Parameters
dev_idDevice ID of the ethernet transport device.
dev_queue_idQueue ID of the ethernet transport device.
port_id[out] Pointer to store the ethernet port ID.
queue_id[out] Pointer to store the queue ID of the ethernet port.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_start()

int dao_eth_trs_dev_start ( uint8_t  dev_id)

Start ethernet transport device.

This function starts the ethernet transport device and sets it up for data transfer. The device must be configured before starting it using dao_eth_trs_dev_alloc() and dao_eth_trs_dev_queue_conf().

Parameters
dev_idDevice ID of the ethernet transport device.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_stop()

int dao_eth_trs_dev_stop ( uint8_t  dev_id)

Stop ethernet transport device.

This function stops the ethernet transport device and marks it as inactive.

Parameters
dev_idDevice ID of the ethernet transport device.
Returns
0 on success, negative on error.

◆ dao_eth_trs_dev_free()

int dao_eth_trs_dev_free ( uint8_t  dev_id)

Close the ethernet transport device.

This function closes the ethernet transport device and frees the resources allocated during allocation. The device must be stopped before closing it using dao_eth_trs_dev_stop().

Parameters
dev_idDevice ID of the ethernet transport device.
Returns
0 on success, negative on error.