rte_rawdev_pmd.h(3)
okay bestie, welcome to rte_rawdev_pmd.h(3) from the Library Functions Manual π this is the driver-facing raw PMD API page, and we are keeping every single include, struct, typedef, and function signature exactly as it is. no cap, not one detail is getting left behind.
πΈ NAME πΈ
rte_rawdev_pmd.h β that's the header name, periodt.
β¨ SYNOPSIS β¨
the vibe check says include these exactly:
#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β the data structure listed in the synopsis, sitting pretty and staying exact.
π·οΈ Typedefs
here come the typedefs, and yes every single one is staying. this is literal signature territory, bestie:
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
and here are the functions, exact signatures only, no edits, no guesses:
static struct rte_rawdev * rte_rawdev_pmd_get_named_dev (const char
*name)
static struct rte_rawdev * rte_rawdev_pmd_get_dev (uint8_t dev_id)
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 β that's the zone we're in, bestie.
Note β Driver facing APIs for a raw device. These are not to be called directly by any application.
Definition in file rte_rawdev_pmd.h.
π Typedef Documentation π
β¨ rawdev_info_get_t β¨
typedef int(* rawdev_info_get_t) (struct rte_rawdev *dev, rte_rawdev_obj_t
dev_info, size_t dev_private_size)
Okay so this is the big βdefinitions of all functions exported by a driverβ situation, bestie. Itβs the generic structure of type rawdev_ops supplied in the rte_rawdev structure associated with a device. Its job? Get device information of a device. Slay.
Parameters
devβ Raw device pointerdev_infoβ Raw device information structuredev_private_sizeβ The size of the structure pointed to bydev_info->dev_private
Returns
Returns 0 on success, negative error code on failure.
Definition at line 172 of file rte_rawdev_pmd.h.
π rawdev_configure_t π
typedef int(* rawdev_configure_t) (const struct rte_rawdev *dev,
rte_rawdev_obj_t config, size_t config_size)
Configure a device. Thatβs it, thatβs the vibe.
Parameters
devβ Raw device pointerconfigβ Void object containing device specific configurationconfig_sizeβ Size of the memory allocated for the configuration
Returns
Returns 0 on success.
Definition at line 189 of file rte_rawdev_pmd.h.
πΈ rawdev_start_t πΈ
typedef int(* rawdev_start_t) (struct rte_rawdev *dev)
Start a configured device. Iconic behavior, honestly.
Parameters
devβ Raw device pointer
Returns
Returns 0 on success.
Definition at line 202 of file rte_rawdev_pmd.h.
π¦ rawdev_stop_t π¦
typedef void(* rawdev_stop_t) (struct rte_rawdev *dev)
Stop a configured device. No return value, just main character exit energy.
Parameters
devβ Raw device pointer
Definition at line 210 of file rte_rawdev_pmd.h.
π
rawdev_close_t π
typedef int(* rawdev_close_t) (struct rte_rawdev *dev)
Close a configured device. Bye bestie.
Parameters
devβ Raw device pointer
Returns
0on success(-EAGAIN)if canβt close as device is busy
Definition at line 222 of file rte_rawdev_pmd.h.
β rawdev_reset_t β
typedef int(* rawdev_reset_t) (struct rte_rawdev *dev)
Reset a configured device. Fresh start era.
Parameters
devβ Raw device pointer
Returns
0 for success, !0 for failure.
Definition at line 233 of file rte_rawdev_pmd.h.
π rawdev_queue_conf_get_t π
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. Lowkey important.
Parameters
devβ Raw device pointerqueue_idβ Raw device queue indexqueue_confβ Raw device queue configuration structurequeue_conf_sizeβ Size of the memory allocated for the configuration
Returns
Returns 0 on success, negative errno on failure.
Definition at line 250 of file rte_rawdev_pmd.h.
π rawdev_queue_setup_t π
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. Yes, the original says βan raw queue,β and we are respecting the lore.
Parameters
devβ Raw device pointerqueue_idβ Rawqueue indexqueue_confβ Rawqueue configuration structurequeue_conf_sizeβ Size of the memory allocated for the configuration
Returns
Returns 0 on success.
Definition at line 270 of file rte_rawdev_pmd.h.
π§ rawdev_queue_release_t π§
typedef int(* rawdev_queue_release_t) (struct rte_rawdev *dev, uint16_t
queue_id)
Release resources allocated by given raw queue. Give the queue its release funds, periodt.
Parameters
devβ Raw device pointerqueue_idβ Raw queue index
Definition at line 283 of file rte_rawdev_pmd.h.
π rawdev_queue_count_t π
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
devβ Raw device pointer
Returns
Number of queues; 0 is assumed to be a valid response.
Definition at line 301 of file rte_rawdev_pmd.h.
π₯ rawdev_enqueue_bufs_t π₯
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
devβ Raw device pointerbuffersβ array of bufferscountβ number of buffers passedcontextβ 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
>=0β Count of buffers successfully enqueued (0: no buffers enqueued)<0β Error count in case of error
Definition at line 325 of file rte_rawdev_pmd.h.
π rawdev_dequeue_bufs_t π
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
devβ Raw device pointerbuffersβ array of bufferscountβ Max buffers expected to be dequeuedcontextβ 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
>0, ~0: Count of buffers returned<0: Error
Whether short dequeue is success or failure is decided between app and driver.
Definition at line 350 of file rte_rawdev_pmd.h.
π rawdev_dump_t π
typedef int(* rawdev_dump_t) (struct rte_rawdev *dev, FILE *f)
Dump internal information. Spill the tea, but into a file.
Parameters
devβ Raw device pointerfβ A pointer to a file for output
Returns
0 for success, !0 Error.
Definition at line 366 of file rte_rawdev_pmd.h.
π«Ά rawdev_get_attr_t π«Ά
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
devβ Raw device pointerattr_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
0 for success, !0 Error; attr_value remains untouched in case of error.
Definition at line 383 of file rte_rawdev_pmd.h.
π rawdev_set_attr_t π
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
devβ Raw device pointerattr_nameβ Opaque object representing an attribute in implementation.attr_valueβ Value of the attribute represented byattr_name
Returns
0 for success, !0 Error.
Definition at line 401 of file rte_rawdev_pmd.h.
πΈ rawdev_xstats_get_t πΈ
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
devβ Raw device pointeridsβ The stat ids to retrievevaluesβ The returned stat valuesnβ The number of id values and entries in the values array
Returns
The number of stat values successfully filled into the values array.
Definition at line 421 of file rte_rawdev_pmd.h.
π rawdev_xstats_reset_t π
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. Clean slate, bestie.
Definition at line 427 of file rte_rawdev_pmd.h.
π rawdev_xstats_get_names_t π
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. Again: βan raw deviceβ is canon here.
Parameters
devβ Raw device pointerxstats_namesβ Array of name values to be filled insizeβ Number of values in thexstats_namesarray
Returns
When size >= the number of stats, return the number of stat values filled into the array. When size < the number of available stats, return the number of stats values, and do not fill in any data into xstats_names.
Definition at line 446 of file rte_rawdev_pmd.h.
π rawdev_xstats_get_by_name_t π
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
devβ Raw device pointernameβ The name of the stat to retrieveidβ Pointer to an unsigned int where we store the stat-id. This pointer may be null if the id is not required.
Returns
The value of the stat, or (uint64_t)-1 if the stat is not found. If the stat is not found, the id value will be returned as (unsigned)-1, if id pointer is non-NULL.
Definition at line 465 of file rte_rawdev_pmd.h.
π§ rawdev_firmware_status_get_t π§
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
devβ Raw device pointerstatus_infoβ void block containing device specific status information
Returns
0 for success, !0 for failure, with undefined value in status_info.
Definition at line 481 of file rte_rawdev_pmd.h.
π rawdev_firmware_version_get_t π
typedef int(* rawdev_firmware_version_get_t) (struct rte_rawdev *dev,
rte_rawdev_obj_t version_info)
Get firmware version information.
Parameters
devβ Raw device pointerversion_infoβ void pointer to version information returned by device
Returns
0 for success, !0 for failure, with undefined value in version_info.
Definition at line 495 of file rte_rawdev_pmd.h.
π₯ rawdev_firmware_load_t π₯
typedef int(* rawdev_firmware_load_t) (struct rte_rawdev *dev,
rte_rawdev_obj_t firmware_buf)
Load firmware from a buffer (DMAβable). Very demure, very DMA.
Parameters
devβ Raw device pointerfirmware_bufβ Pointer to firmware image
Returns
>0, ~0: for successful load<0: for failure
See also
Application may use firmware_version_get for ascertaining successful load.
Definition at line 512 of file rte_rawdev_pmd.h.
π rawdev_firmware_unload_t π
typedef int(* rawdev_firmware_unload_t) (struct rte_rawdev *dev)
Unload firmware.
Parameters
devβ Raw device pointer
Returns
>0, ~0for successful unloading<0for failure in unloading
Note: Application can use thefirmware_status_getorfirmware_version_getto get result of unload.
Definition at line 527 of file rte_rawdev_pmd.h.
β rawdev_selftest_t β
typedef int(* rawdev_selftest_t) (uint16_t dev_id)
Start rawdev selftest.
Returns
Return 0 on success.
Definition at line 535 of file rte_rawdev_pmd.h.
π Function Documentation π
These are the actual functions, and every parameter, return value, and line number is staying. No skipping, no cap. π
struct rte_rawdev *rte_rawdev_pmd_get_named_dev(const char *name) β [inline], [static]
struct rte_rawdev *rte_rawdev_pmd_get_named_dev(const char *name)
Context: the pool of rte_rawdev structures. This one grabs the rte_rawdev structure device pointer for the named device. π
Parameters
nameβ device name to select the device structure.
Returns
- The
rte_rawdevstructure pointer for the given device ID.
Definition at line 87 of file rte_rawdev_pmd.h.
struct rte_rawdev *rte_rawdev_pmd_get_dev(uint8_t dev_id) β [inline], [static]
struct rte_rawdev *rte_rawdev_pmd_get_dev(uint8_t dev_id)
Same mission, different lookup key: get the rte_rawdev structure device pointer for the given device ID. π¦
Parameters
dev_idβ raw device index.
Returns
- The
rte_rawdevstructure pointer for the given device ID.
Definition at line 115 of file rte_rawdev_pmd.h.
unsigned rte_rawdev_pmd_is_valid_dev(uint8_t dev_id) β [inline], [static]
unsigned rte_rawdev_pmd_is_valid_dev(uint8_t dev_id)
Vibe check for a raw device index: validate if it's a valid attached raw device. β
Parameters
dev_idβ raw device index.
Returns
- If the device index is valid (
1) or not (0).
Definition at line 139 of file rte_rawdev_pmd.h.
struct rte_rawdev *rte_rawdev_pmd_allocate(const char *name, size_t dev_private_size, int socket_id)
struct rte_rawdev *rte_rawdev_pmd_allocate(const char *name, size_t dev_private_size, int socket_id)
This one allocates a new rawdev slot for an raw device and returns the pointer to that slot so the driver can use it. Main character allocation energy. π
Parameters
nameβ Unique identifier name for each device.dev_private_sizeβ Size of private data memory allocated withinrte_rawdevobject. Set to0to disable internal memory allocation and allow for self-allocation.socket_idβ Socket to allocate resources on.
Returns
- Slot in the
rte_dev_devicesarray for a new device;
int rte_rawdev_pmd_release(struct rte_rawdev *rawdev)
int rte_rawdev_pmd_release(struct rte_rawdev *rawdev)
Release the specified rawdev device. Say bye to it properly. π«Ά
Parameters
rawdevβ The rawdev pointer is the address of therte_rawdevstructure.
Returns
0on success, negative on error.
struct rte_rawdev *rte_rawdev_pmd_init(const char *name, size_t dev_private_size, int socket_id)
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. It's giving fresh device, fresh start. πΈ
Parameters
nameβ Pointer to a character array containing name of the device.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.
NULLif device cannot be created.
int rte_rawdev_pmd_uninit(const char *name)
int rte_rawdev_pmd_uninit(const char *name)
Destroy a raw device π
Parameters
nameβ Name of the device.
Returns
0on success, negative on error.
β¨ Author β¨
Generated automatically by Doxygen for DPDK from the source code.
Okay bestie, that's the whole page. Footer deets but make it cute: this is DPDK, version 26.03.0, for rte_rawdev_pmd.h(3), and the date is the one Doxygen stamped in your footer. π«Άβ¨
π¦ where this page comes from
- nixos 26.05: dpdk 26.03
- nixpkgs unstable: dpdk 26.03
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms