DPDK  20.08.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 
90 int
91 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info);
92 
117 int
118 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf);
119 
120 
143 int
144 rte_rawdev_queue_conf_get(uint16_t dev_id,
145  uint16_t queue_id,
146  rte_rawdev_obj_t queue_conf);
147 
166 int
167 rte_rawdev_queue_setup(uint16_t dev_id,
168  uint16_t queue_id,
169  rte_rawdev_obj_t queue_conf);
170 
186 int
187 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
188 
197 uint16_t
198 rte_rawdev_queue_count(uint16_t dev_id);
199 
215 int
216 rte_rawdev_start(uint16_t dev_id);
217 
225 void
226 rte_rawdev_stop(uint16_t dev_id);
227 
239 int
240 rte_rawdev_close(uint16_t dev_id);
241 
253 int
254 rte_rawdev_reset(uint16_t dev_id);
255 
256 #define RTE_RAWDEV_NAME_MAX_LEN (64)
257 
266 struct rte_rawdev {
268  int socket_id;
270  uint16_t dev_id;
272  const struct rte_rawdev_ops *dev_ops;
274  struct rte_device *device;
276  const char *driver_name;
277 
280  uint8_t attached : 1;
282  uint8_t started : 1;
283 
285  rte_rawdev_obj_t dev_private;
287  char name[RTE_RAWDEV_NAME_MAX_LEN];
289 
291 extern struct rte_rawdev *rte_rawdevs;
292 
293 
294 struct rte_rawdev_info {
296  const char *driver_name;
298  struct rte_device *device;
300  int socket_id;
302  rte_rawdev_obj_t dev_private;
303 };
304 
305 struct rte_rawdev_buf {
307  void *buf_addr;
308 };
309 
323 int
324 rte_rawdev_dump(uint16_t dev_id, FILE *f);
325 
345 int
346 rte_rawdev_get_attr(uint16_t dev_id,
347  const char *attr_name,
348  uint64_t *attr_value);
349 
364 int
365 rte_rawdev_set_attr(uint16_t dev_id,
366  const char *attr_name,
367  const uint64_t attr_value);
368 
390 int
391 rte_rawdev_enqueue_buffers(uint16_t dev_id,
392  struct rte_rawdev_buf **buffers,
393  unsigned int count,
394  rte_rawdev_obj_t context);
395 
421 int
422 rte_rawdev_dequeue_buffers(uint16_t dev_id,
423  struct rte_rawdev_buf **buffers,
424  unsigned int count,
425  rte_rawdev_obj_t context);
426 
428 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
429 
437  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
438 };
439 
461 int
462 rte_rawdev_xstats_names_get(uint16_t dev_id,
463  struct rte_rawdev_xstats_name *xstats_names,
464  unsigned int size);
465 
485 int
486 rte_rawdev_xstats_get(uint16_t dev_id,
487  const unsigned int ids[],
488  uint64_t values[],
489  unsigned int n);
490 
507 uint64_t
508 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
509  const char *name,
510  unsigned int *id);
511 
527 int
528 rte_rawdev_xstats_reset(uint16_t dev_id,
529  const uint32_t ids[],
530  uint32_t nb_ids);
531 
546 int
547 rte_rawdev_firmware_status_get(uint16_t dev_id,
548  rte_rawdev_obj_t status_info);
549 
564 int
565 rte_rawdev_firmware_version_get(uint16_t dev_id,
566  rte_rawdev_obj_t version_info);
567 
581 int
582 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
583 
593 int
594 rte_rawdev_firmware_unload(uint16_t dev_id);
595 
606 int
607 rte_rawdev_selftest(uint16_t dev_id);
608 
609 #ifdef __cplusplus
610 }
611 #endif
612 
613 #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:428
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_cache_aligned
Definition: rte_common.h:376
#define RTE_STD_C11
Definition: rte_common.h:40
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)