X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fbus%2Fifpga%2Fifpga_bus.c;h=cbc680928486fd9f52df5bb6a31c69b62da47aa4;hb=369ce46248c0605d31bd29ebaa4474309a875176;hp=addbc3e86bf697d955fbf9ed0ccbe87d7a976e42;hpb=61669ecb921fff821db11d81557fa0449a7eb79c;p=dpdk.git diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index addbc3e86b..cbc6809284 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -32,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 */ @@ -163,8 +161,16 @@ ifpga_scan_one(struct rte_rawdev *rawdev, afu_dev->id.uuid.uuid_high = 0; afu_dev->id.port = afu_pr_conf.afu_id.port; + /* Allocate interrupt instance */ + afu_dev->intr_handle = + rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE); + if (afu_dev->intr_handle == NULL) { + IFPGA_BUS_ERR("Failed to allocate intr handle"); + goto end; + } + 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 && @@ -191,8 +197,10 @@ end: rte_kvargs_free(kvlist); if (path) free(path); - if (afu_dev) + if (afu_dev) { + rte_intr_instance_free(afu_dev->intr_handle); free(afu_dev); + } return NULL; } @@ -398,6 +406,7 @@ ifpga_unplug(struct rte_device *dev) TAILQ_REMOVE(&ifpga_afu_dev_list, afu_dev, next); rte_devargs_remove(dev->devargs); + rte_intr_instance_free(afu_dev->intr_handle); free(afu_dev); return 0; @@ -474,10 +483,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);