DPDK  21.02.0
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_ALLOWED,
33  RTE_DEVTYPE_BLOCKED,
34  RTE_DEVTYPE_VIRTUAL,
35 };
36 
37 /* Backwards compatibility will be removed later */
38 #define RTE_DEVTYPE_WHITELISTED_PCI \
39  RTE_DEPRECATED(RTE_DEVTYPE_WHITELISTED_PCI) RTE_DEVTYPE_ALLOWED
40 #define RTE_DEVTYPE_BLACKLISTED_PCI \
41  RTE_DEPRECATED(RTE_DEVTYPE_BLACKLISTED_PCI) RTE_DEVTYPE_BLOCKED
42 
53 struct rte_devargs {
61  char name[RTE_DEV_NAME_MAX_LEN];
63  union {
65  char *args;
66  const char *drv_str;
67  };
68  struct rte_bus *bus;
69  struct rte_class *cls;
70  const char *bus_str;
71  const char *cls_str;
72  const char *data;
73 };
74 
107 int
108 rte_devargs_parse(struct rte_devargs *da, const char *dev);
109 
143 int
145  const char *format, ...)
146 __rte_format_printf(2, 0);
147 
160 int
161 rte_devargs_insert(struct rte_devargs **da);
162 
176 int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str);
177 
191 int rte_devargs_remove(struct rte_devargs *devargs);
192 
202 unsigned int
203 rte_devargs_type_count(enum rte_devtype devtype);
204 
211 void rte_devargs_dump(FILE *f);
212 
229 struct rte_devargs *
230 rte_devargs_next(const char *busname, const struct rte_devargs *start);
231 
235 #define RTE_EAL_DEVARGS_FOREACH(busname, da) \
236  for (da = rte_devargs_next(busname, NULL); \
237  da != NULL; \
238  da = rte_devargs_next(busname, da)) \
239 
240 #ifdef __cplusplus
241 }
242 #endif
243 
244 #endif /* _RTE_DEVARGS_H_ */
rte_devtype
Definition: rte_devargs.h:31
int rte_devargs_add(enum rte_devtype devtype, const char *devargs_str)
struct rte_bus * bus
Definition: rte_devargs.h:68
const char * cls_str
Definition: rte_devargs.h:71
int rte_devargs_parsef(struct rte_devargs *da, const char *format,...) __rte_format_printf(2
struct rte_class * cls
Definition: rte_devargs.h:69
struct rte_devargs * rte_devargs_next(const char *busname, const struct rte_devargs *start)
const char * bus_str
Definition: rte_devargs.h:70
unsigned int rte_devargs_type_count(enum rte_devtype devtype)
int int rte_devargs_insert(struct rte_devargs **da)
char * args
Definition: rte_devargs.h:65
void rte_devargs_dump(FILE *f)
char name[RTE_DEV_NAME_MAX_LEN]
Definition: rte_devargs.h:61
rte_dev_policy
Definition: rte_dev.h:54
int rte_devargs_remove(struct rte_devargs *devargs)
#define __rte_format_printf(format_index, first_arg)
Definition: rte_common.h:144
#define RTE_STD_C11
Definition: rte_common.h:40
enum rte_dev_policy policy
Definition: rte_devargs.h:59
const char * data
Definition: rte_devargs.h:72
int rte_devargs_parse(struct rte_devargs *da, const char *dev)
TAILQ_ENTRY(rte_devargs) next
enum rte_devtype type
Definition: rte_devargs.h:57