DPDK  18.11.11
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 <sys/queue.h>
25 #include <rte_compat.h>
26 #include <rte_bus.h>
27 
32  RTE_DEVTYPE_WHITELISTED_PCI,
33  RTE_DEVTYPE_BLACKLISTED_PCI,
34  RTE_DEVTYPE_VIRTUAL,
35 };
36 
47 struct rte_devargs {
55  char name[RTE_DEV_NAME_MAX_LEN];
57  union {
59  char *args;
60  const char *drv_str;
61  };
62  struct rte_bus *bus;
63  struct rte_class *cls;
64  const char *bus_str;
65  const char *cls_str;
66  const char *data;
67 };
68 
101 __rte_experimental
102 int
103 rte_devargs_parse(struct rte_devargs *da, const char *dev);
104 
138 __rte_experimental
139 int
141  const char *format, ...)
142 __attribute__((format(printf, 2, 0)));
143 
156 __rte_experimental
157 int
158 rte_devargs_insert(struct rte_devargs **da);
159 
173 __rte_experimental
174 int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str);
175 
189 __rte_experimental
190 int rte_devargs_remove(struct rte_devargs *devargs);
191 
201 __rte_experimental
202 unsigned int
203 rte_devargs_type_count(enum rte_devtype devtype);
204 
211 __rte_experimental
212 void rte_devargs_dump(FILE *f);
213 
230 __rte_experimental
231 struct rte_devargs *
232 rte_devargs_next(const char *busname, const struct rte_devargs *start);
233 
237 #define RTE_EAL_DEVARGS_FOREACH(busname, da) \
238  for (da = rte_devargs_next(busname, NULL); \
239  da != NULL; \
240  da = rte_devargs_next(busname, da)) \
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #endif /* _RTE_DEVARGS_H_ */
rte_devtype
Definition: rte_devargs.h:31
__rte_experimental int rte_devargs_parsef(struct rte_devargs *da, const char *format,...)
struct rte_bus * bus
Definition: rte_devargs.h:62
__rte_experimental void rte_devargs_dump(FILE *f)
const char * cls_str
Definition: rte_devargs.h:65
__rte_experimental int rte_devargs_remove(struct rte_devargs *devargs)
__rte_experimental int rte_devargs_parse(struct rte_devargs *da, const char *dev)
struct rte_class * cls
Definition: rte_devargs.h:63
const char * bus_str
Definition: rte_devargs.h:64
__rte_experimental int rte_devargs_insert(struct rte_devargs **da)
__rte_experimental struct rte_devargs * rte_devargs_next(const char *busname, const struct rte_devargs *start)
__rte_experimental int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str)
char * args
Definition: rte_devargs.h:59
char name[RTE_DEV_NAME_MAX_LEN]
Definition: rte_devargs.h:55
rte_dev_policy
Definition: rte_dev.h:72
#define RTE_STD_C11
Definition: rte_common.h:37
enum rte_dev_policy policy
Definition: rte_devargs.h:53
const char * data
Definition: rte_devargs.h:66
__rte_experimental unsigned int rte_devargs_type_count(enum rte_devtype devtype)
TAILQ_ENTRY(rte_devargs) next
enum rte_devtype type
Definition: rte_devargs.h:51