drivers: remove direct access to interrupt handle
[dpdk.git] / drivers / net / thunderx / nicvf_ethdev.c
index 762647e..fc334cf 100644 (file)
@@ -1858,6 +1858,8 @@ nicvf_dev_close(struct rte_eth_dev *dev)
                nicvf_periodic_alarm_stop(nicvf_vf_interrupt, nic->snicvf[i]);
        }
 
+       rte_intr_instance_free(nic->intr_handle);
+
        return 0;
 }
 
@@ -2157,6 +2159,14 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
                goto fail;
        }
 
+       /* Allocate interrupt instance */
+       nic->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
+       if (nic->intr_handle == NULL) {
+               PMD_INIT_LOG(ERR, "Failed to allocate intr handle");
+               ret = -ENODEV;
+               goto fail;
+       }
+
        nicvf_disable_all_interrupts(nic);
 
        ret = nicvf_periodic_alarm_start(nicvf_interrupt, eth_dev);