X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fbus%2Fifpga%2Fifpga_bus.c;h=62887da2d8805403f333e3f8bcced1b651cf3603;hb=21bc183b68154e08c67e2fccf10f5301a014be1f;hp=55d3abf9fe2e093de4e183abc94ee9a26a81b1c4;hpb=fb87e55abac808bdda60e114a6817ab6e812ec16;p=dpdk.git diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index 55d3abf9fe..62887da2d8 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "rte_rawdev.h" #include "rte_rawdev_pmd.h" @@ -31,8 +32,6 @@ #include "ifpga_logs.h" #include "ifpga_common.h" -int ifpga_bus_logtype; - /* Forward declaration to access Intel FPGA bus * on which iFPGA devices are connected */ @@ -73,6 +72,19 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev, 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, @@ -150,7 +162,7 @@ ifpga_scan_one(struct rte_rawdev *rawdev, afu_dev->id.port = afu_pr_conf.afu_id.port; if (rawdev->dev_ops && rawdev->dev_ops->dev_info_get) - rawdev->dev_ops->dev_info_get(rawdev, afu_dev); + rawdev->dev_ops->dev_info_get(rawdev, afu_dev, sizeof(*afu_dev)); if (rawdev->dev_ops && rawdev->dev_ops->dev_start && @@ -460,10 +472,4 @@ static struct rte_bus rte_ifpga_bus = { }; RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus); - -RTE_INIT(ifpga_init_log) -{ - ifpga_bus_logtype = rte_log_register("bus.ifpga"); - if (ifpga_bus_logtype >= 0) - rte_log_set_level(ifpga_bus_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER_DEFAULT(ifpga_bus_logtype, NOTICE);