DPDK  22.11.7-rc1
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 
95 int
96 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info,
97  size_t dev_private_size);
98 
128 int
129 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf,
130  size_t dev_private_size);
131 
132 
157 int
158 rte_rawdev_queue_conf_get(uint16_t dev_id,
159  uint16_t queue_id,
160  rte_rawdev_obj_t queue_conf,
161  size_t queue_conf_size);
162 
183 int
184 rte_rawdev_queue_setup(uint16_t dev_id,
185  uint16_t queue_id,
186  rte_rawdev_obj_t queue_conf,
187  size_t queue_conf_size);
188 
204 int
205 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
206 
215 uint16_t
216 rte_rawdev_queue_count(uint16_t dev_id);
217 
233 int
234 rte_rawdev_start(uint16_t dev_id);
235 
243 void
244 rte_rawdev_stop(uint16_t dev_id);
245 
257 int
258 rte_rawdev_close(uint16_t dev_id);
259 
271 int
272 rte_rawdev_reset(uint16_t dev_id);
273 
274 #define RTE_RAWDEV_NAME_MAX_LEN (64)
275 
284 struct rte_rawdev {
286  int socket_id;
288  uint16_t dev_id;
290  const struct rte_rawdev_ops *dev_ops;
292  struct rte_device *device;
294  const char *driver_name;
295 
298  uint8_t attached : 1;
300  uint8_t started : 1;
301 
303  rte_rawdev_obj_t dev_private;
305  char name[RTE_RAWDEV_NAME_MAX_LEN];
307 
309 extern struct rte_rawdev *rte_rawdevs;
310 
311 
312 struct rte_rawdev_info {
314  const char *driver_name;
316  struct rte_device *device;
318  int socket_id;
320  rte_rawdev_obj_t dev_private;
321 };
322 
323 struct rte_rawdev_buf {
325  void *buf_addr;
326 };
327 
341 int
342 rte_rawdev_dump(uint16_t dev_id, FILE *f);
343 
363 int
364 rte_rawdev_get_attr(uint16_t dev_id,
365  const char *attr_name,
366  uint64_t *attr_value);
367 
382 int
383 rte_rawdev_set_attr(uint16_t dev_id,
384  const char *attr_name,
385  const uint64_t attr_value);
386 
408 int
409 rte_rawdev_enqueue_buffers(uint16_t dev_id,
410  struct rte_rawdev_buf **buffers,
411  unsigned int count,
412  rte_rawdev_obj_t context);
413 
439 int
440 rte_rawdev_dequeue_buffers(uint16_t dev_id,
441  struct rte_rawdev_buf **buffers,
442  unsigned int count,
443  rte_rawdev_obj_t context);
444 
446 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
447 
455  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
456 };
457 
479 int
480 rte_rawdev_xstats_names_get(uint16_t dev_id,
481  struct rte_rawdev_xstats_name *xstats_names,
482  unsigned int size);
483 
503 int
504 rte_rawdev_xstats_get(uint16_t dev_id,
505  const unsigned int ids[],
506  uint64_t values[],
507  unsigned int n);
508 
525 uint64_t
526 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
527  const char *name,
528  unsigned int *id);
529 
545 int
546 rte_rawdev_xstats_reset(uint16_t dev_id,
547  const uint32_t ids[],
548  uint32_t nb_ids);
549 
564 int
565 rte_rawdev_firmware_status_get(uint16_t dev_id,
566  rte_rawdev_obj_t status_info);
567 
582 int
583 rte_rawdev_firmware_version_get(uint16_t dev_id,
584  rte_rawdev_obj_t version_info);
585 
599 int
600 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
601 
611 int
612 rte_rawdev_firmware_unload(uint16_t dev_id);
613 
624 int
625 rte_rawdev_selftest(uint16_t dev_id);
626 
627 #ifdef __cplusplus
628 }
629 #endif
630 
631 #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:446
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)