table of contents
rte_rawdev_pmd.h(3) | DPDK | rte_rawdev_pmd.h(3) |
NAME¶
rte_rawdev_pmd.h
SYNOPSIS¶
#include <string.h>
#include <dev_driver.h>
#include <rte_malloc.h>
#include <rte_log.h>
#include <rte_common.h>
#include 'rte_rawdev.h'
Data Structures¶
struct rte_rawdev_ops
Typedefs¶
typedef int(* rawdev_info_get_t) (struct rte_rawdev
*dev, rte_rawdev_obj_t dev_info, size_t dev_private_size)
typedef int(* rawdev_configure_t) (const struct rte_rawdev *dev,
rte_rawdev_obj_t config, size_t config_size)
typedef int(* rawdev_start_t) (struct rte_rawdev *dev)
typedef void(* rawdev_stop_t) (struct rte_rawdev *dev)
typedef int(* rawdev_close_t) (struct rte_rawdev *dev)
typedef int(* rawdev_reset_t) (struct rte_rawdev *dev)
typedef int(* rawdev_queue_conf_get_t) (struct rte_rawdev *dev,
uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)
typedef int(* rawdev_queue_setup_t) (struct rte_rawdev *dev,
uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)
typedef int(* rawdev_queue_release_t) (struct rte_rawdev *dev,
uint16_t queue_id)
typedef uint16_t(* rawdev_queue_count_t) (struct rte_rawdev
*dev)
typedef int(* rawdev_enqueue_bufs_t) (struct rte_rawdev *dev,
struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t
context)
typedef int(* rawdev_dequeue_bufs_t) (struct rte_rawdev *dev,
struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t
context)
typedef int(* rawdev_dump_t) (struct rte_rawdev *dev, FILE *f)
typedef int(* rawdev_get_attr_t) (struct rte_rawdev *dev, const
char *attr_name, uint64_t *attr_value)
typedef int(* rawdev_set_attr_t) (struct rte_rawdev *dev, const
char *attr_name, const uint64_t attr_value)
typedef int(* rawdev_xstats_get_t) (const struct rte_rawdev
*dev, const unsigned int ids[], uint64_t values[], unsigned int n)
typedef int(* rawdev_xstats_reset_t) (struct rte_rawdev *dev,
const uint32_t ids[], uint32_t nb_ids)
typedef int(* rawdev_xstats_get_names_t) (const struct
rte_rawdev *dev, struct rte_rawdev_xstats_name *xstats_names,
unsigned int size)
typedef uint64_t(* rawdev_xstats_get_by_name_t) (const struct
rte_rawdev *dev, const char *name, unsigned int *id)
typedef int(* rawdev_firmware_status_get_t) (struct rte_rawdev
*dev, rte_rawdev_obj_t status_info)
typedef int(* rawdev_firmware_version_get_t) (struct rte_rawdev
*dev, rte_rawdev_obj_t version_info)
typedef int(* rawdev_firmware_load_t) (struct rte_rawdev *dev,
rte_rawdev_obj_t firmware_buf)
typedef int(* rawdev_firmware_unload_t) (struct rte_rawdev *dev)
typedef int(* rawdev_selftest_t) (uint16_t dev_id)
Functions¶
static struct rte_rawdev * rte_rawdev_pmd_get_named_dev
(const char *name)
static unsigned rte_rawdev_pmd_is_valid_dev (uint8_t dev_id)
struct rte_rawdev * rte_rawdev_pmd_allocate (const char *name, size_t
dev_private_size, int socket_id)
int rte_rawdev_pmd_release (struct rte_rawdev *rawdev)
struct rte_rawdev * rte_rawdev_pmd_init (const char *name, size_t
dev_private_size, int socket_id)
int rte_rawdev_pmd_uninit (const char *name)
Detailed Description¶
RTE RAW PMD APIs
Note:
Definition in file rte_rawdev_pmd.h.
Typedef Documentation¶
typedef int(* rawdev_info_get_t) (struct rte_rawdev *dev, rte_rawdev_obj_t dev_info, size_t dev_private_size)¶
Definitions of all functions exported by a driver through the generic structure of type rawdev_ops supplied in the rte_rawdev structure associated with a device. Get device information of a device.
Parameters:
dev_info Raw device information structure
dev_private_size The size of the structure pointed to by dev_info->dev_private
Returns:
Definition at line 147 of file rte_rawdev_pmd.h.
typedef int(* rawdev_configure_t) (const struct rte_rawdev *dev, rte_rawdev_obj_t config, size_t config_size)¶
Configure a device.
Parameters:
config Void object containing device specific configuration
config_size Size of the memory allocated for the configuration
Returns:
Definition at line 164 of file rte_rawdev_pmd.h.
typedef int(* rawdev_start_t) (struct rte_rawdev *dev)¶
Start a configured device.
Parameters:
Returns:
Definition at line 177 of file rte_rawdev_pmd.h.
typedef void(* rawdev_stop_t) (struct rte_rawdev *dev)¶
Stop a configured device.
Parameters:
Definition at line 185 of file rte_rawdev_pmd.h.
typedef int(* rawdev_close_t) (struct rte_rawdev *dev)¶
Close a configured device.
Parameters:
Returns:
- 0 on success
- (-EAGAIN) if can't close as device is busy
Definition at line 197 of file rte_rawdev_pmd.h.
typedef int(* rawdev_reset_t) (struct rte_rawdev *dev)¶
Reset a configured device.
Parameters:
Returns:
Definition at line 208 of file rte_rawdev_pmd.h.
typedef int(* rawdev_queue_conf_get_t) (struct rte_rawdev *dev, uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)¶
Retrieve the current raw queue configuration.
Parameters:
queue_id Raw device queue index
queue_conf Raw device queue configuration structure
queue_conf_size Size of the memory allocated for the configuration
Returns:
Definition at line 225 of file rte_rawdev_pmd.h.
typedef int(* rawdev_queue_setup_t) (struct rte_rawdev *dev, uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)¶
Setup an raw queue.
Parameters:
queue_id Rawqueue index
queue_conf Rawqueue configuration structure
queue_conf_size Size of the memory allocated for the configuration
Returns:
Definition at line 245 of file rte_rawdev_pmd.h.
typedef int(* rawdev_queue_release_t) (struct rte_rawdev *dev, uint16_t queue_id)¶
Release resources allocated by given raw queue.
Parameters:
queue_id Raw queue index
Definition at line 258 of file rte_rawdev_pmd.h.
typedef uint16_t(* rawdev_queue_count_t) (struct rte_rawdev *dev)¶
Get the count of number of queues configured on this device.
Another way to fetch this information is to fetch the device configuration. But, that assumes that the device configuration managed by the driver has that kind of information.
This function helps in getting queue count supported, independently. It can help in cases where iterator needs to be implemented.
Parameters:
Returns:
Definition at line 276 of file rte_rawdev_pmd.h.
typedef int(* rawdev_enqueue_bufs_t) (struct rte_rawdev *dev, struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t context)¶
Enqueue an array of raw buffers to the device.
Buffer being used is opaque - it can be obtained from mempool or from any other source. Interpretation of buffer is responsibility of driver.
Parameters:
buffers array of buffers
count number of buffers passed
context an opaque object representing context of the call; for example, an application can pass information about the queues on which enqueue needs to be done. Or, the enqueue operation might be passed reference to an object containing a callback (agreed upon between application and driver).
Returns:
Definition at line 300 of file rte_rawdev_pmd.h.
typedef int(* rawdev_dequeue_bufs_t) (struct rte_rawdev *dev, struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t context)¶
Dequeue an array of raw buffers from the device.
Parameters:
buffers array of buffers
count Max buffers expected to be dequeued
context an opaque object representing context of the call. Based on this object, the application and driver can coordinate for dequeue operation involving agreed upon semantics. For example, queue information/id on which Dequeue needs to be performed.
Returns:
Definition at line 325 of file rte_rawdev_pmd.h.
typedef int(* rawdev_dump_t) (struct rte_rawdev *dev, FILE *f)¶
Dump internal information
Parameters:
f A pointer to a file for output
Returns:
Definition at line 341 of file rte_rawdev_pmd.h.
typedef int(* rawdev_get_attr_t) (struct rte_rawdev *dev, const char *attr_name, uint64_t *attr_value)¶
Get an attribute value from implementation. Attribute is an opaque handle agreed upon between application and PMD.
Parameters:
attr_name Opaque object representing an attribute in implementation.
attr_value [out] Opaque response to the attribute value. In case of error, this remains untouched. This is double pointer of void type.
Returns:
Definition at line 358 of file rte_rawdev_pmd.h.
typedef int(* rawdev_set_attr_t) (struct rte_rawdev *dev, const char *attr_name, const uint64_t attr_value)¶
Set an attribute value. Attribute is an opaque handle agreed upon between application and PMD.
Parameters:
attr_name Opaque object representing an attribute in implementation.
attr_value Value of the attribute represented by attr_name
Returns:
Definition at line 376 of file rte_rawdev_pmd.h.
typedef int(* rawdev_xstats_get_t) (const struct rte_rawdev *dev, const unsigned int ids[], uint64_t values[], unsigned int n)¶
Retrieve a set of statistics from device. Note: Being a raw device, the stats are specific to the device being implemented thus represented as xstats.
Parameters:
ids The stat ids to retrieve
values The returned stat values
n The number of id values and entries in the values array
Returns:
Definition at line 396 of file rte_rawdev_pmd.h.
typedef int(* rawdev_xstats_reset_t) (struct rte_rawdev *dev, const uint32_t ids[], uint32_t nb_ids)¶
Resets the statistic values in xstats for the device.
Definition at line 402 of file rte_rawdev_pmd.h.
typedef int(* rawdev_xstats_get_names_t) (const struct rte_rawdev *dev, struct rte_rawdev_xstats_name *xstats_names, unsigned int size)¶
Get names of extended stats of an raw device
Parameters:
xstats_names Array of name values to be filled in
size Number of values in the xstats_names array
Returns:
Definition at line 421 of file rte_rawdev_pmd.h.
typedef uint64_t(* rawdev_xstats_get_by_name_t) (const struct rte_rawdev *dev, const char *name, unsigned int *id)¶
Get value of one stats and optionally return its id
Parameters:
name The name of the stat to retrieve
id Pointer to an unsigned int where we store the stat-id. This pointer may be null if the id is not required.
Returns:
Definition at line 440 of file rte_rawdev_pmd.h.
typedef int(* rawdev_firmware_status_get_t) (struct rte_rawdev *dev, rte_rawdev_obj_t status_info)¶
Get firmware/device-stack status. Implementation to allocate buffer for returning information.
Parameters:
status_info void block containing device specific status information
Returns:
Definition at line 456 of file rte_rawdev_pmd.h.
typedef int(* rawdev_firmware_version_get_t) (struct rte_rawdev *dev, rte_rawdev_obj_t version_info)¶
Get firmware version information
Parameters:
version_info void pointer to version information returned by device
Returns:
Definition at line 470 of file rte_rawdev_pmd.h.
typedef int(* rawdev_firmware_load_t) (struct rte_rawdev *dev, rte_rawdev_obj_t firmware_buf)¶
Load firmware from a buffer (DMA'able)
Parameters:
firmware_buf Pointer to firmware image
Returns:
See also:
Definition at line 487 of file rte_rawdev_pmd.h.
typedef int(* rawdev_firmware_unload_t) (struct rte_rawdev *dev)¶
Unload firmware
Parameters:
Returns:
Note: Application can use the firmware_status_get or firmware_version_get to get result of unload.
Definition at line 502 of file rte_rawdev_pmd.h.
typedef int(* rawdev_selftest_t) (uint16_t dev_id)¶
Start rawdev selftest
Returns:
Definition at line 510 of file rte_rawdev_pmd.h.
Function Documentation¶
static struct rte_rawdev* rte_rawdev_pmd_get_named_dev (const char * name) [inline], [static]¶
The pool of rte_rawdev structures.
Get the rte_rawdev structure device pointer for the named device.
Parameters:
Returns:
- •
- The rte_rawdev structure pointer for the given device ID.
Definition at line 86 of file rte_rawdev_pmd.h.
static unsigned rte_rawdev_pmd_is_valid_dev (uint8_t dev_id) [inline], [static]¶
Validate if the raw device index is a valid attached raw device.
Parameters:
Returns:
- •
- If the device index is valid (1) or not (0).
Definition at line 114 of file rte_rawdev_pmd.h.
struct rte_rawdev* rte_rawdev_pmd_allocate (const char * name, size_t dev_private_size, int socket_id)¶
Allocates a new rawdev slot for an raw device and returns the pointer to that slot for the driver to use.
Parameters:
dev_private_size Size of private data memory allocated within rte_rawdev object. Set to 0 to disable internal memory allocation and allow for self-allocation.
socket_id Socket to allocate resources on.
Returns:
- •
- Slot in the rte_dev_devices array for a new device;
int rte_rawdev_pmd_release (struct rte_rawdev * rawdev)¶
Release the specified rawdev device.
Parameters:
Returns:
- •
- 0 on success, negative on error
struct rte_rawdev* rte_rawdev_pmd_init (const char * name, size_t dev_private_size, int socket_id)¶
Creates a new raw device and returns the pointer to that device.
Parameters:
dev_private_size Size of raw PMDs private data
socket_id Socket to allocate resources on.
Returns:
- Raw device pointer if device is successfully created.
- NULL if device cannot be created.
int rte_rawdev_pmd_uninit (const char * name)¶
Destroy a raw device
Parameters:
Returns:
- •
- 0 on success, negative on error
Author¶
Generated automatically by Doxygen for DPDK from the source code.
Thu May 23 2024 | Version 23.11.0 |