DPDK  21.11.8
rte_devargs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2014 6WIND S.A.
3  */
4 
5 #ifndef _RTE_DEVARGS_H_
6 #define _RTE_DEVARGS_H_
7 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <stdio.h>
24 #include <rte_compat.h>
25 #include <rte_bus.h>
26 
33 #define RTE_DEVARGS_KEY_BUS "bus"
34 
41 #define RTE_DEVARGS_KEY_CLASS "class"
42 
49 #define RTE_DEVARGS_KEY_DRIVER "driver"
50 
55  RTE_DEVTYPE_ALLOWED,
56  RTE_DEVTYPE_BLOCKED,
57  RTE_DEVTYPE_VIRTUAL,
58 };
59 
70 struct rte_devargs {
78  char name[RTE_DEV_NAME_MAX_LEN];
80  union {
81  const char *args;
82  const char *drv_str;
83  };
84  struct rte_bus *bus;
85  struct rte_class *cls;
86  const char *bus_str;
87  const char *cls_str;
88  char *data;
89 };
90 
123 int
124 rte_devargs_parse(struct rte_devargs *da, const char *dev);
125 
159 int
161  const char *format, ...)
162 __rte_format_printf(2, 0);
163 
170 __rte_experimental
171 void
172 rte_devargs_reset(struct rte_devargs *da);
173 
186 int
187 rte_devargs_insert(struct rte_devargs **da);
188 
202 int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str);
203 
217 int rte_devargs_remove(struct rte_devargs *devargs);
218 
228 unsigned int
229 rte_devargs_type_count(enum rte_devtype devtype);
230 
237 void rte_devargs_dump(FILE *f);
238 
255 struct rte_devargs *
256 rte_devargs_next(const char *busname, const struct rte_devargs *start);
257 
261 #define RTE_EAL_DEVARGS_FOREACH(busname, da) \
262  for (da = rte_devargs_next(busname, NULL); \
263  da != NULL; \
264  da = rte_devargs_next(busname, da)) \
265 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif /* _RTE_DEVARGS_H_ */
rte_devtype
Definition: rte_devargs.h:54
int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str)
struct rte_bus * bus
Definition: rte_devargs.h:84
const char * args
Definition: rte_devargs.h:81
const char * cls_str
Definition: rte_devargs.h:87
int rte_devargs_parsef(struct rte_devargs *da, const char *format,...) __rte_format_printf(2
struct rte_class * cls
Definition: rte_devargs.h:85
struct rte_devargs * rte_devargs_next(const char *busname, const struct rte_devargs *start)
const char * bus_str
Definition: rte_devargs.h:86
int __rte_experimental void rte_devargs_reset(struct rte_devargs *da)
unsigned int rte_devargs_type_count(enum rte_devtype devtype)
int rte_devargs_insert(struct rte_devargs **da)
void rte_devargs_dump(FILE *f)
char name[RTE_DEV_NAME_MAX_LEN]
Definition: rte_devargs.h:78
rte_dev_policy
Definition: rte_dev.h:53
int rte_devargs_remove(struct rte_devargs *devargs)
#define __rte_format_printf(format_index, first_arg)
Definition: rte_common.h:151
const char * drv_str
Definition: rte_devargs.h:82
#define RTE_STD_C11
Definition: rte_common.h:42
enum rte_dev_policy policy
Definition: rte_devargs.h:76
char * data
Definition: rte_devargs.h:88
RTE_TAILQ_ENTRY(rte_devargs) next
int rte_devargs_parse(struct rte_devargs *da, const char *dev)
enum rte_devtype type
Definition: rte_devargs.h:74