@@ -219,6 +219,10 @@ rte_devargs_parse(struct rte_devargs *da, const char *dev)
if (da == NULL)
return -EINVAL;
+ if (strncmp(dev, "bus=", 4) == 0 ||
+ strncmp(dev, "class=", 6) == 0)
+ return rte_devargs_layers_parse(da, dev);
+
/* Retrieve eventual bus info */
do {
devname = dev;
@@ -54,6 +54,7 @@ const struct option
eal_long_options[] = {
{OPT_BASE_VIRTADDR, 1, NULL, OPT_BASE_VIRTADDR_NUM },
{OPT_CREATE_UIO_DEV, 0, NULL, OPT_CREATE_UIO_DEV_NUM },
+ {OPT_DEV, 1, NULL, OPT_DEV_NUM },
{OPT_FILE_PREFIX, 1, NULL, OPT_FILE_PREFIX_NUM },
{OPT_HELP, 0, NULL, OPT_HELP_NUM },
{OPT_HUGE_DIR, 1, NULL, OPT_HUGE_DIR_NUM },
@@ -111,6 +112,7 @@ TAILQ_HEAD(device_option_list, device_option);
struct device_option {
TAILQ_ENTRY(device_option) next;
+ int new;
enum rte_devtype type;
char arg[];
};
@@ -123,7 +125,8 @@ static int mem_parsed;
static int core_parsed;
static int
-eal_option_device_add(enum rte_devtype type, const char *optarg)
+eal_option_device_add(enum rte_devtype type, const char *optarg,
+ int new)
{
struct device_option *devopt;
size_t optlen;
@@ -137,6 +140,7 @@ eal_option_device_add(enum rte_devtype type, const char *optarg)
}
devopt->type = type;
+ devopt->new = new;
ret = snprintf(devopt->arg, optlen, "%s", optarg);
if (ret < 0) {
RTE_LOG(ERR, EAL, "Unable to copy device option\n");
@@ -156,7 +160,22 @@ eal_option_device_parse(void)
TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
if (ret == 0) {
- ret = rte_devargs_add(devopt->type, devopt->arg);
+ if (devopt->new) {
+ struct rte_devargs *da;
+
+ da = calloc(1, sizeof(*da));
+ ret = rte_devargs_parse(da, devopt->arg);
+ if (ret) {
+ free(da);
+ } else {
+ ret = rte_devargs_insert(da);
+ if (ret)
+ free(da);
+ }
+ } else {
+ ret = rte_devargs_add(devopt->type,
+ devopt->arg);
+ }
if (ret)
RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n",
devopt->arg);
@@ -1088,7 +1107,7 @@ eal_parse_common_option(int opt, const char *optarg,
if (w_used)
goto bw_used;
if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
- optarg) < 0) {
+ optarg, 0) < 0) {
return -1;
}
b_used = 1;
@@ -1098,7 +1117,7 @@ eal_parse_common_option(int opt, const char *optarg,
if (b_used)
goto bw_used;
if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
- optarg) < 0) {
+ optarg, 0) < 0) {
return -1;
}
w_used = 1;
@@ -1234,9 +1253,16 @@ eal_parse_common_option(int opt, const char *optarg,
}
break;
+ case OPT_DEV_NUM:
+ /* devtype is meaningless in the new format. */
+ if (eal_option_device_add(0, optarg, 1) < 0) {
+ return -1;
+ }
+ break;
+
case OPT_VDEV_NUM:
if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
- optarg) < 0) {
+ optarg, 0) < 0) {
return -1;
}
break;
@@ -21,6 +21,8 @@ enum {
OPT_BASE_VIRTADDR_NUM,
#define OPT_CREATE_UIO_DEV "create-uio-dev"
OPT_CREATE_UIO_DEV_NUM,
+#define OPT_DEV "dev"
+ OPT_DEV_NUM,
#define OPT_FILE_PREFIX "file-prefix"
OPT_FILE_PREFIX_NUM,
#define OPT_HUGE_DIR "huge-dir"