DPDK  18.05.1
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 typecasted by implementation */
29 typedef void *rte_rawdev_obj_t;
30 
38 uint8_t __rte_experimental
39 rte_rawdev_count(void);
40 
51 uint16_t __rte_experimental
52 rte_rawdev_get_dev_id(const char *name);
53 
64 int __rte_experimental
65 rte_rawdev_socket_id(uint16_t dev_id);
66 
70 struct rte_rawdev_info;
71 
87 int __rte_experimental
88 rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info);
89 
114 int __rte_experimental
115 rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf);
116 
117 
140 int __rte_experimental
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 __rte_experimental
164 rte_rawdev_queue_setup(uint16_t dev_id,
165  uint16_t queue_id,
166  rte_rawdev_obj_t queue_conf);
167 
183 int __rte_experimental
184 rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id);
193 uint16_t __rte_experimental
194 rte_rawdev_queue_count(uint16_t dev_id);
195 
211 int __rte_experimental
212 rte_rawdev_start(uint16_t dev_id);
213 
221 void __rte_experimental
222 rte_rawdev_stop(uint16_t dev_id);
223 
235 int __rte_experimental
236 rte_rawdev_close(uint16_t dev_id);
237 
249 int __rte_experimental
250 rte_rawdev_reset(uint16_t dev_id);
251 
252 #define RTE_RAWDEV_NAME_MAX_LEN (64)
253 
262 struct rte_rawdev {
264  int socket_id;
266  uint16_t dev_id;
268  const struct rte_rawdev_ops *dev_ops;
270  struct rte_device *device;
272  const char *driver_name;
273 
276  uint8_t attached : 1;
278  uint8_t started : 1;
279 
281  rte_rawdev_obj_t dev_private;
283  char name[RTE_RAWDEV_NAME_MAX_LEN];
285 
287 extern struct rte_rawdev *rte_rawdevs;
288 
289 
290 struct rte_rawdev_info {
292  const char *driver_name;
294  struct rte_device *device;
296  int socket_id;
298  rte_rawdev_obj_t dev_private;
299 };
300 
301 struct rte_rawdev_buf {
303  void *buf_addr;
304 };
305 
319 int __rte_experimental
320 rte_rawdev_dump(uint16_t dev_id, FILE *f);
321 
341 int __rte_experimental
342 rte_rawdev_get_attr(uint16_t dev_id,
343  const char *attr_name,
344  uint64_t *attr_value);
345 
360 int __rte_experimental
361 rte_rawdev_set_attr(uint16_t dev_id,
362  const char *attr_name,
363  const uint64_t attr_value);
364 
386 int __rte_experimental
387 rte_rawdev_enqueue_buffers(uint16_t dev_id,
388  struct rte_rawdev_buf **buffers,
389  unsigned int count,
390  rte_rawdev_obj_t context);
391 
417 int __rte_experimental
418 rte_rawdev_dequeue_buffers(uint16_t dev_id,
419  struct rte_rawdev_buf **buffers,
420  unsigned int count,
421  rte_rawdev_obj_t context);
422 
424 #define RTE_RAW_DEV_XSTATS_NAME_SIZE 64
425 
433  char name[RTE_RAW_DEV_XSTATS_NAME_SIZE];
434 };
435 
457 int __rte_experimental
458 rte_rawdev_xstats_names_get(uint16_t dev_id,
459  struct rte_rawdev_xstats_name *xstats_names,
460  unsigned int size);
461 
481 int __rte_experimental
482 rte_rawdev_xstats_get(uint16_t dev_id,
483  const unsigned int ids[],
484  uint64_t values[],
485  unsigned int n);
486 
503 uint64_t __rte_experimental
504 rte_rawdev_xstats_by_name_get(uint16_t dev_id,
505  const char *name,
506  unsigned int *id);
507 
523 int __rte_experimental
524 rte_rawdev_xstats_reset(uint16_t dev_id,
525  const uint32_t ids[],
526  uint32_t nb_ids);
527 
542 int __rte_experimental
543 rte_rawdev_firmware_status_get(uint16_t dev_id,
544  rte_rawdev_obj_t status_info);
545 
560 int __rte_experimental
561 rte_rawdev_firmware_version_get(uint16_t dev_id,
562  rte_rawdev_obj_t version_info);
563 
577 int __rte_experimental
578 rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image);
579 
589 int __rte_experimental
590 rte_rawdev_firmware_unload(uint16_t dev_id);
591 
602 int __rte_experimental
603 rte_rawdev_selftest(uint16_t dev_id);
604 
605 #ifdef __cplusplus
606 }
607 #endif
608 
609 #endif /* _RTE_RAWDEV_H_ */