DPDK  20.05.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 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <rte_common.h>
25 #include <rte_memory.h>
26 #include <rte_errno.h>
27 
28 /* Rawdevice object - essentially a void to be typecast by implementation */
29 typedef void *rte_rawdev_obj_t;
30 
38 uint8_t
39 rte_rawdev_count(void);
40 
51 uint16_t
52 rte_rawdev_get_dev_id(const char *name);
53 
64 int
65 rte_rawdev_socket_id(uint16_t dev_id);
66 
70 struct rte_rawdev_info;
71 
87 int
88 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info);
89 
114 int
115 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf);
116 
117 
140 int
141 rte_rawdev_queue_conf_get(uint16_t dev_id,
142  uint16_t queue_id,
143  rte_rawdev_obj_t queue_conf);
144 
163 int
164 rte_rawdev_queue_setup(uint16_t dev_id,
165  uint16_t queue_id,
166  rte_rawdev_obj_t queue_conf);
167 
183 int
184 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
185 
194 uint16_t
195 rte_rawdev_queue_count(uint16_t dev_id);
196 
212 int
213 rte_rawdev_start(uint16_t dev_id);
214 
222 void
223 rte_rawdev_stop(uint16_t dev_id);
224 
236 int
237 rte_rawdev_close(uint16_t dev_id);
238 
250 int
251 rte_rawdev_reset(uint16_t dev_id);
252 
253 #define RTE_RAWDEV_NAME_MAX_LEN (64)
254 
263 struct rte_rawdev {
265  int socket_id;
267  uint16_t dev_id;
269  const struct rte_rawdev_ops *dev_ops;
271  struct rte_device *device;
273  const char *driver_name;
274 
277  uint8_t attached : 1;
279  uint8_t started : 1;
280 
282  rte_rawdev_obj_t dev_private;
284  char name[RTE_RAWDEV_NAME_MAX_LEN];
286 
288 extern struct rte_rawdev *rte_rawdevs;
289 
290 
291 struct rte_rawdev_info {
293  const char *driver_name;
295  struct rte_device *device;
297  int socket_id;
299  rte_rawdev_obj_t dev_private;
300 };
301 
302 struct rte_rawdev_buf {
304  void *buf_addr;
305 };
306 
320 int
321 rte_rawdev_dump(uint16_t dev_id, FILE *f);
322 
342 int
343 rte_rawdev_get_attr(uint16_t dev_id,
344  const char *attr_name,
345  uint64_t *attr_value);
346 
361 int
362 rte_rawdev_set_attr(uint16_t dev_id,
363  const char *attr_name,
364  const uint64_t attr_value);
365 
387 int
388 rte_rawdev_enqueue_buffers(uint16_t dev_id,
389  struct rte_rawdev_buf **buffers,
390  unsigned int count,
391  rte_rawdev_obj_t context);
392 
418 int
419 rte_rawdev_dequeue_buffers(uint16_t dev_id,
420  struct rte_rawdev_buf **buffers,
421  unsigned int count,
422  rte_rawdev_obj_t context);
423 
425 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
426 
434  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
435 };
436 
458 int
459 rte_rawdev_xstats_names_get(uint16_t dev_id,
460  struct rte_rawdev_xstats_name *xstats_names,
461  unsigned int size);
462 
482 int
483 rte_rawdev_xstats_get(uint16_t dev_id,
484  const unsigned int ids[],
485  uint64_t values[],
486  unsigned int n);
487 
504 uint64_t
505 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
506  const char *name,
507  unsigned int *id);
508 
524 int
525 rte_rawdev_xstats_reset(uint16_t dev_id,
526  const uint32_t ids[],
527  uint32_t nb_ids);
528 
543 int
544 rte_rawdev_firmware_status_get(uint16_t dev_id,
545  rte_rawdev_obj_t status_info);
546 
561 int
562 rte_rawdev_firmware_version_get(uint16_t dev_id,
563  rte_rawdev_obj_t version_info);
564 
578 int
579 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
580 
590 int
591 rte_rawdev_firmware_unload(uint16_t dev_id);
592 
603 int
604 rte_rawdev_selftest(uint16_t dev_id);
605 
606 #ifdef __cplusplus
607 }
608 #endif
609 
610 #endif /* _RTE_RAWDEV_H_ */
int rte_rawdev_queue_conf_get(uint16_t dev_id, uint16_t queue_id, rte_rawdev_obj_t queue_conf)
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_start(uint16_t dev_id)
int rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info)
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)
int rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf)
#define RTE_RAW_DEV_XSTATS_NAME_SIZE
Definition: rte_rawdev.h:425
int rte_rawdev_queue_setup(uint16_t dev_id, uint16_t queue_id, rte_rawdev_obj_t queue_conf)
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_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)
#define RTE_STD_C11
Definition: rte_common.h:40
#define __rte_cache_aligned
Definition: rte_common.h:367
uint16_t rte_rawdev_queue_count(uint16_t dev_id)
const char * name
Definition: rte_dev.h:106
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)