DPDK 25.03.0-rc0
rte_rawdev.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2017 NXP
3 */
4
5#ifndef _RTE_RAWDEV_H_
6#define _RTE_RAWDEV_H_
7
17#include <rte_common.h>
18#include <rte_memory.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/* Rawdevice object - essentially a void to be typecast by implementation */
25typedef void *rte_rawdev_obj_t;
26
34uint8_t
36
47uint16_t
48rte_rawdev_get_dev_id(const char *name);
49
60int
61rte_rawdev_socket_id(uint16_t dev_id);
62
66struct rte_rawdev_info;
67
94int
95rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info,
96 size_t dev_private_size);
97
127int
128rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf,
129 size_t dev_private_size);
130
131
155int
157 uint16_t queue_id,
158 rte_rawdev_obj_t queue_conf,
159 size_t queue_conf_size);
160
181int
183 uint16_t queue_id,
184 rte_rawdev_obj_t queue_conf,
185 size_t queue_conf_size);
186
202int
203rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
204
213uint16_t
214rte_rawdev_queue_count(uint16_t dev_id);
215
231int
232rte_rawdev_start(uint16_t dev_id);
233
241void
242rte_rawdev_stop(uint16_t dev_id);
243
255int
256rte_rawdev_close(uint16_t dev_id);
257
269int
270rte_rawdev_reset(uint16_t dev_id);
271
272#define RTE_RAWDEV_NAME_MAX_LEN (64)
282struct __rte_cache_aligned rte_rawdev {
284 int socket_id;
286 uint16_t dev_id;
288 const struct rte_rawdev_ops *dev_ops;
290 struct rte_device *device;
292 const char *driver_name;
293
295 uint8_t attached : 1;
297 uint8_t started : 1;
298
300 rte_rawdev_obj_t dev_private;
302 char name[RTE_RAWDEV_NAME_MAX_LEN];
303};
304
306extern struct rte_rawdev *rte_rawdevs;
307
308
309struct rte_rawdev_info {
311 const char *driver_name;
313 struct rte_device *device;
315 int socket_id;
317 rte_rawdev_obj_t dev_private;
318};
319
320struct rte_rawdev_buf {
322 void *buf_addr;
323};
324
338int
339rte_rawdev_dump(uint16_t dev_id, FILE *f);
340
360int
361rte_rawdev_get_attr(uint16_t dev_id,
362 const char *attr_name,
363 uint64_t *attr_value);
364
379int
380rte_rawdev_set_attr(uint16_t dev_id,
381 const char *attr_name,
382 const uint64_t attr_value);
383
405int
407 struct rte_rawdev_buf **buffers,
408 unsigned int count,
409 rte_rawdev_obj_t context);
410
436int
438 struct rte_rawdev_buf **buffers,
439 unsigned int count,
440 rte_rawdev_obj_t context);
441
443#define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
444
453};
454
476int
478 struct rte_rawdev_xstats_name *xstats_names,
479 unsigned int size);
480
500int
501rte_rawdev_xstats_get(uint16_t dev_id,
502 const unsigned int ids[],
503 uint64_t values[],
504 unsigned int n);
505
522uint64_t
524 const char *name,
525 unsigned int *id);
526
542int
544 const uint32_t ids[],
545 uint32_t nb_ids);
546
561int
563 rte_rawdev_obj_t status_info);
564
579int
581 rte_rawdev_obj_t version_info);
582
596int
597rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
598
608int
610
621int
622rte_rawdev_selftest(uint16_t dev_id);
623
624#ifdef __cplusplus
625}
626#endif
627
628#endif /* _RTE_RAWDEV_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:627
int rte_rawdev_enqueue_buffers(uint16_t dev_id, struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t context)
uint16_t rte_rawdev_queue_count(uint16_t dev_id)
int rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id)
int rte_rawdev_xstats_get(uint16_t dev_id, const unsigned int ids[], uint64_t values[], unsigned int n)
int rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image)
int rte_rawdev_xstats_reset(uint16_t dev_id, const uint32_t ids[], uint32_t nb_ids)
uint64_t rte_rawdev_xstats_by_name_get(uint16_t dev_id, const char *name, unsigned int *id)
uint16_t rte_rawdev_get_dev_id(const char *name)
void rte_rawdev_stop(uint16_t dev_id)
int rte_rawdev_get_attr(uint16_t dev_id, const char *attr_name, uint64_t *attr_value)
int rte_rawdev_dump(uint16_t dev_id, FILE *f)
int rte_rawdev_socket_id(uint16_t dev_id)
int rte_rawdev_firmware_status_get(uint16_t dev_id, rte_rawdev_obj_t status_info)
int rte_rawdev_selftest(uint16_t dev_id)
uint8_t rte_rawdev_count(void)
int rte_rawdev_dequeue_buffers(uint16_t dev_id, struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t context)
int rte_rawdev_set_attr(uint16_t dev_id, const char *attr_name, const uint64_t attr_value)
int rte_rawdev_firmware_version_get(uint16_t dev_id, rte_rawdev_obj_t version_info)
int rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf, size_t dev_private_size)
int rte_rawdev_reset(uint16_t dev_id)
int rte_rawdev_firmware_unload(uint16_t dev_id)
#define RTE_RAW_DEV_XSTATS_NAME_SIZE
Definition: rte_rawdev.h:443
int rte_rawdev_close(uint16_t dev_id)
int rte_rawdev_queue_conf_get(uint16_t dev_id, uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)
int rte_rawdev_xstats_names_get(uint16_t dev_id, struct rte_rawdev_xstats_name *xstats_names, unsigned int size)
int rte_rawdev_queue_setup(uint16_t dev_id, uint16_t queue_id, rte_rawdev_obj_t queue_conf, size_t queue_conf_size)
int rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info, size_t dev_private_size)
int rte_rawdev_start(uint16_t dev_id)