X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fvdpa%2Fifc%2Fifcvf_vdpa.c;h=3f063acddb9f3fe86f0ce4a5c6bbc6b528eae3f5;hb=6f0ef237404b;hp=0418f9a07fec633ce308ccc995a4c78fd78563a0;hpb=81a6b7fe068f64d1381ea4d6fce5088a1bcc7f81;p=dpdk.git diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 0418f9a07f..3f063acddb 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #include "base/ifcvf.h" +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE); #define DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \ "IFCVF %s(): " fmt "\n", __func__, ##args) @@ -44,8 +46,6 @@ static const char * const ifcvf_valid_arguments[] = { NULL }; -static int ifcvf_vdpa_logtype; - struct ifcvf_internal { struct rte_pci_device *pdev; struct ifcvf_hw hw; @@ -839,7 +839,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal) vdpa_ifcvf_stop(internal); vdpa_disable_vfio_intr(internal); - ret = rte_vhost_host_notifier_ctrl(vid, false); + ret = rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, false); if (ret && ret != -ENOTSUP) goto error; @@ -858,7 +858,7 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal) if (ret) goto stop_vf; - rte_vhost_host_notifier_ctrl(vid, true); + rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, true); internal->sw_fallback_running = true; @@ -881,7 +881,7 @@ ifcvf_dev_config(int vid) struct internal_list *list; struct ifcvf_internal *internal; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -893,7 +893,7 @@ ifcvf_dev_config(int vid) rte_atomic32_set(&internal->dev_attached, 1); update_datapath(internal); - if (rte_vhost_host_notifier_ctrl(vid, true) != 0) + if (rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, true) != 0) DRV_LOG(NOTICE, "vDPA (%s): software relay is used.", vdev->device->name); @@ -907,7 +907,7 @@ ifcvf_dev_close(int vid) struct internal_list *list; struct ifcvf_internal *internal; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -947,7 +947,7 @@ ifcvf_set_features(int vid) struct ifcvf_internal *internal; uint64_t log_base = 0, log_size = 0; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -978,7 +978,7 @@ ifcvf_get_vfio_group_fd(int vid) struct rte_vdpa_device *vdev; struct internal_list *list; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -994,7 +994,7 @@ ifcvf_get_vfio_device_fd(int vid) struct rte_vdpa_device *vdev; struct internal_list *list; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -1013,7 +1013,7 @@ ifcvf_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size) struct vfio_region_info reg = { .argsz = sizeof(reg) }; int ret; - vdev = rte_vdpa_get_device(rte_vhost_get_vdpa_device_id(vid)); + vdev = rte_vhost_get_vdpa_device(vid); list = find_internal_resource_by_vdev(vdev); if (list == NULL) { DRV_LOG(ERR, "Invalid vDPA device: %p", vdev); @@ -1271,10 +1271,3 @@ static struct rte_pci_driver rte_ifcvf_vdpa = { RTE_PMD_REGISTER_PCI(net_ifcvf, rte_ifcvf_vdpa); RTE_PMD_REGISTER_PCI_TABLE(net_ifcvf, pci_id_ifcvf_map); RTE_PMD_REGISTER_KMOD_DEP(net_ifcvf, "* vfio-pci"); - -RTE_INIT(ifcvf_vdpa_init_log) -{ - ifcvf_vdpa_logtype = rte_log_register("pmd.net.ifcvf_vdpa"); - if (ifcvf_vdpa_logtype >= 0) - rte_log_set_level(ifcvf_vdpa_logtype, RTE_LOG_NOTICE); -}