dma/hisilicon: use common PCI device naming
[dpdk.git] / examples / vhost_blk / vhost_blk.c
index 5c64071..2cab1e6 100644 (file)
@@ -685,7 +685,8 @@ new_device(int vid)
        /* start polling vring */
        worker_thread_status = WORKER_STATE_START;
        fprintf(stdout, "New Device %s, Device ID %d\n", path, vid);
-       if (pthread_create(&tid, NULL, &ctrlr_worker, ctrlr) < 0) {
+       if (rte_ctrl_thread_create(&tid, "vhostblk-ctrlr", NULL,
+                                  &ctrlr_worker, ctrlr) != 0) {
                fprintf(stderr, "Worker Thread Started Failed\n");
                return -1;
        }
@@ -752,7 +753,7 @@ new_connection(int vid)
        return 0;
 }
 
-struct vhost_device_ops vhost_blk_device_ops = {
+struct rte_vhost_device_ops vhost_blk_device_ops = {
        .new_device =  new_device,
        .destroy_device = destroy_device,
        .new_connection = new_connection,
@@ -848,8 +849,7 @@ static void
 vhost_blk_ctrlr_destroy(struct vhost_blk_ctrlr *ctrlr)
 {
        if (ctrlr->bdev != NULL) {
-               if (ctrlr->bdev->data != NULL)
-                       rte_free(ctrlr->bdev->data);
+               rte_free(ctrlr->bdev->data);
 
                rte_free(ctrlr->bdev);
        }
@@ -906,5 +906,8 @@ int main(int argc, char *argv[])
        while (1)
                sleep(1);
 
+       /* clean up the EAL */
+       rte_eal_cleanup();
+
        return 0;
 }