DPDK  22.03.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 #include <rte_errno.h>
24 
25 /* Rawdevice object - essentially a void to be typecast by implementation */
26 typedef void *rte_rawdev_obj_t;
27 
35 uint8_t
36 rte_rawdev_count(void);
37 
48 uint16_t
49 rte_rawdev_get_dev_id(const char *name);
50 
61 int
62 rte_rawdev_socket_id(uint16_t dev_id);
63 
67 struct rte_rawdev_info;
68 
96 int
97 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info,
98  size_t dev_private_size);
99 
129 int
130 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf,
131  size_t dev_private_size);
132 
133 
158 int
159 rte_rawdev_queue_conf_get(uint16_t dev_id,
160  uint16_t queue_id,
161  rte_rawdev_obj_t queue_conf,
162  size_t queue_conf_size);
163 
184 int
185 rte_rawdev_queue_setup(uint16_t dev_id,
186  uint16_t queue_id,
187  rte_rawdev_obj_t queue_conf,
188  size_t queue_conf_size);
189 
205 int
206 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
207 
216 uint16_t
217 rte_rawdev_queue_count(uint16_t dev_id);
218 
234 int
235 rte_rawdev_start(uint16_t dev_id);
236 
244 void
245 rte_rawdev_stop(uint16_t dev_id);
246 
258 int
259 rte_rawdev_close(uint16_t dev_id);
260 
272 int
273 rte_rawdev_reset(uint16_t dev_id);
274 
275 #define RTE_RAWDEV_NAME_MAX_LEN (64)
276 
285 struct rte_rawdev {
287  int socket_id;
289  uint16_t dev_id;
291  const struct rte_rawdev_ops *dev_ops;
293  struct rte_device *device;
295  const char *driver_name;
296 
299  uint8_t attached : 1;
301  uint8_t started : 1;
302 
304  rte_rawdev_obj_t dev_private;
306  char name[RTE_RAWDEV_NAME_MAX_LEN];
308 
310 extern struct rte_rawdev *rte_rawdevs;
311 
312 
313 struct rte_rawdev_info {
315  const char *driver_name;
317  struct rte_device *device;
319  int socket_id;
321  rte_rawdev_obj_t dev_private;
322 };
323 
324 struct rte_rawdev_buf {
326  void *buf_addr;
327 };
328 
342 int
343 rte_rawdev_dump(uint16_t dev_id, FILE *f);
344 
364 int
365 rte_rawdev_get_attr(uint16_t dev_id,
366  const char *attr_name,
367  uint64_t *attr_value);
368 
383 int
384 rte_rawdev_set_attr(uint16_t dev_id,
385  const char *attr_name,
386  const uint64_t attr_value);
387 
409 int
410 rte_rawdev_enqueue_buffers(uint16_t dev_id,
411  struct rte_rawdev_buf **buffers,
412  unsigned int count,
413  rte_rawdev_obj_t context);
414 
440 int
441 rte_rawdev_dequeue_buffers(uint16_t dev_id,
442  struct rte_rawdev_buf **buffers,
443  unsigned int count,
444  rte_rawdev_obj_t context);
445 
447 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
448 
456  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
457 };
458 
480 int
481 rte_rawdev_xstats_names_get(uint16_t dev_id,
482  struct rte_rawdev_xstats_name *xstats_names,
483  unsigned int size);
484 
504 int
505 rte_rawdev_xstats_get(uint16_t dev_id,
506  const unsigned int ids[],
507  uint64_t values[],
508  unsigned int n);
509 
526 uint64_t
527 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
528  const char *name,
529  unsigned int *id);
530 
546 int
547 rte_rawdev_xstats_reset(uint16_t dev_id,
548  const uint32_t ids[],
549  uint32_t nb_ids);
550 
565 int
566 rte_rawdev_firmware_status_get(uint16_t dev_id,
567  rte_rawdev_obj_t status_info);
568 
583 int
584 rte_rawdev_firmware_version_get(uint16_t dev_id,
585  rte_rawdev_obj_t version_info);
586 
600 int
601 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
602 
612 int
613 rte_rawdev_firmware_unload(uint16_t dev_id);
614 
625 int
626 rte_rawdev_selftest(uint16_t dev_id);
627 
628 #ifdef __cplusplus
629 }
630 #endif
631 
632 #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:447
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:402
#define RTE_STD_C11
Definition: rte_common.h:42
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)
const char * name
Definition: rte_dev.h:87
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)