DPDK  23.07.0
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 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <rte_common.h>
22 #include <rte_memory.h>
23 
24 /* Rawdevice object - essentially a void to be typecast by implementation */
25 typedef void *rte_rawdev_obj_t;
26 
34 uint8_t
35 rte_rawdev_count(void);
36 
47 uint16_t
48 rte_rawdev_get_dev_id(const char *name);
49 
60 int
61 rte_rawdev_socket_id(uint16_t dev_id);
62 
66 struct rte_rawdev_info;
67 
94 int
95 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info,
96  size_t dev_private_size);
97 
127 int
128 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf,
129  size_t dev_private_size);
130 
131 
155 int
156 rte_rawdev_queue_conf_get(uint16_t dev_id,
157  uint16_t queue_id,
158  rte_rawdev_obj_t queue_conf,
159  size_t queue_conf_size);
160 
181 int
182 rte_rawdev_queue_setup(uint16_t dev_id,
183  uint16_t queue_id,
184  rte_rawdev_obj_t queue_conf,
185  size_t queue_conf_size);
186 
202 int
203 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
204 
213 uint16_t
214 rte_rawdev_queue_count(uint16_t dev_id);
215 
231 int
232 rte_rawdev_start(uint16_t dev_id);
233 
241 void
242 rte_rawdev_stop(uint16_t dev_id);
243 
255 int
256 rte_rawdev_close(uint16_t dev_id);
257 
269 int
270 rte_rawdev_reset(uint16_t dev_id);
271 
272 #define RTE_RAWDEV_NAME_MAX_LEN (64)
273 
282 struct 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 
296  uint8_t attached : 1;
298  uint8_t started : 1;
299 
301  rte_rawdev_obj_t dev_private;
303  char name[RTE_RAWDEV_NAME_MAX_LEN];
305 
307 extern struct rte_rawdev *rte_rawdevs;
308 
309 
310 struct rte_rawdev_info {
312  const char *driver_name;
314  struct rte_device *device;
316  int socket_id;
318  rte_rawdev_obj_t dev_private;
319 };
320 
321 struct rte_rawdev_buf {
323  void *buf_addr;
324 };
325 
339 int
340 rte_rawdev_dump(uint16_t dev_id, FILE *f);
341 
361 int
362 rte_rawdev_get_attr(uint16_t dev_id,
363  const char *attr_name,
364  uint64_t *attr_value);
365 
380 int
381 rte_rawdev_set_attr(uint16_t dev_id,
382  const char *attr_name,
383  const uint64_t attr_value);
384 
406 int
407 rte_rawdev_enqueue_buffers(uint16_t dev_id,
408  struct rte_rawdev_buf **buffers,
409  unsigned int count,
410  rte_rawdev_obj_t context);
411 
437 int
438 rte_rawdev_dequeue_buffers(uint16_t dev_id,
439  struct rte_rawdev_buf **buffers,
440  unsigned int count,
441  rte_rawdev_obj_t context);
442 
444 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
445 
453  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
454 };
455 
477 int
478 rte_rawdev_xstats_names_get(uint16_t dev_id,
479  struct rte_rawdev_xstats_name *xstats_names,
480  unsigned int size);
481 
501 int
502 rte_rawdev_xstats_get(uint16_t dev_id,
503  const unsigned int ids[],
504  uint64_t values[],
505  unsigned int n);
506 
523 uint64_t
524 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
525  const char *name,
526  unsigned int *id);
527 
543 int
544 rte_rawdev_xstats_reset(uint16_t dev_id,
545  const uint32_t ids[],
546  uint32_t nb_ids);
547 
562 int
563 rte_rawdev_firmware_status_get(uint16_t dev_id,
564  rte_rawdev_obj_t status_info);
565 
580 int
581 rte_rawdev_firmware_version_get(uint16_t dev_id,
582  rte_rawdev_obj_t version_info);
583 
597 int
598 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
599 
609 int
610 rte_rawdev_firmware_unload(uint16_t dev_id);
611 
622 int
623 rte_rawdev_selftest(uint16_t dev_id);
624 
625 #ifdef __cplusplus
626 }
627 #endif
628 
629 #endif /* _RTE_RAWDEV_H_ */
int rte_rawdev_socket_id(uint16_t dev_id)
int rte_rawdev_selftest(uint16_t dev_id)
int rte_rawdev_get_attr(uint16_t dev_id, const char *attr_name, uint64_t *attr_value)
int rte_rawdev_firmware_unload(uint16_t dev_id)
int rte_rawdev_dump(uint16_t dev_id, FILE *f)
int rte_rawdev_reset(uint16_t dev_id)
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_firmware_status_get(uint16_t dev_id, rte_rawdev_obj_t status_info)
int rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf, size_t dev_private_size)
int rte_rawdev_start(uint16_t dev_id)
uint8_t rte_rawdev_count(void)
int rte_rawdev_close(uint16_t dev_id)
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_xstats_reset(uint16_t dev_id, const uint32_t ids[], uint32_t nb_ids)
void * dev_private
#define RTE_RAW_DEV_XSTATS_NAME_SIZE
Definition: rte_rawdev.h:444
void rte_rawdev_stop(uint16_t dev_id)
int rte_rawdev_xstats_names_get(uint16_t dev_id, struct rte_rawdev_xstats_name *xstats_names, unsigned int size)
uint16_t rte_rawdev_get_dev_id(const char *name)
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_queue_release(uint16_t dev_id, uint16_t queue_id)
int rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image)
int rte_rawdev_xstats_get(uint16_t dev_id, const unsigned int ids[], uint64_t values[], unsigned int n)
int rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info, size_t dev_private_size)
#define __rte_cache_aligned
Definition: rte_common.h:440
#define RTE_STD_C11
Definition: rte_common.h:39
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)
uint16_t rte_rawdev_queue_count(uint16_t dev_id)
uint64_t rte_rawdev_xstats_by_name_get(uint16_t dev_id, const char *name, unsigned int *id)
int rte_rawdev_enqueue_buffers(uint16_t dev_id, struct rte_rawdev_buf **buffers, unsigned int count, rte_rawdev_obj_t context)