#include <rte_kvargs.h>
#include <rte_alarm.h>
#include <rte_string_fns.h>
+#include <rte_debug.h>
#include "rte_rawdev.h"
#include "rte_rawdev_pmd.h"
return NULL;
}
+struct rte_afu_device *
+rte_ifpga_find_afu_by_name(const char *name)
+{
+ struct rte_afu_device *afu_dev = NULL;
+
+ TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {
+ if (afu_dev &&
+ !strcmp(afu_dev->device.name, name))
+ return afu_dev;
+ }
+ return NULL;
+}
+
static const char * const valid_args[] = {
#define IFPGA_ARG_NAME "ifpga"
IFPGA_ARG_NAME,
IFPGA_AFU_BTS);
goto end;
}
+ afu_pr_conf.pr_enable = 1;
} else {
- IFPGA_BUS_ERR("arg %s is mandatory for ifpga bus",
- IFPGA_AFU_BTS);
- goto end;
+ afu_pr_conf.pr_enable = 0;
}
afu_pr_conf.afu_id.uuid.uuid_low = 0;
afu_pr_conf.afu_id.uuid.uuid_high = 0;
- afu_pr_conf.pr_enable = path?1:0;
if (ifpga_find_afu_dev(rawdev, &afu_pr_conf.afu_id))
goto end;
}
TAILQ_FOREACH(drv, &ifpga_afu_drv_list, next) {
- if (ifpga_probe_one_driver(drv, afu_dev)) {
- ret = -1;
- break;
- }
+ ret = ifpga_probe_one_driver(drv, afu_dev);
+ if (ret < 0)
+ /* negative value is an error */
+ return ret;
+ if (ret > 0)
+ /* positive value means driver doesn't support it */
+ continue;
+ return 0;
}
- return ret;
+ if ((ret > 0) && (afu_dev->driver == NULL))
+ return 0;
+ else
+ return ret;
}
/*