| 712 | } |
| 713 | |
| 714 | static int |
| 715 | skeleton_rawdev_probe(struct rte_vdev_device *vdev) |
| 716 | { |
| 717 | const char *name; |
| 718 | int selftest = 0, ret = 0; |
| 719 | |
| 720 | |
| 721 | name = rte_vdev_device_name(vdev); |
| 722 | if (name == NULL) |
| 723 | return -EINVAL; |
| 724 | |
| 725 | /* More than one instance is not supported */ |
| 726 | if (skeldev_init_once) { |
| 727 | SKELETON_PMD_ERR("Multiple instance not supported for %s", |
| 728 | name); |
| 729 | return -EINVAL; |
| 730 | } |
| 731 | |
| 732 | SKELETON_PMD_INFO("Init %s on NUMA node %d", name, rte_socket_id()); |
| 733 | |
| 734 | selftest = skeldev_parse_vdev_args(vdev); |
| 735 | /* In case of invalid argument, selftest != 1; ignore other values */ |
| 736 | |
| 737 | ret = skeleton_rawdev_create(name, vdev, rte_socket_id()); |
| 738 | if (ret >= 0) { |
| 739 | /* In case command line argument for 'selftest' was passed; |
| 740 | * if invalid arguments were passed, execution continues but |
| 741 | * without selftest. |
| 742 | */ |
| 743 | if (selftest == 1) |
| 744 | test_rawdev_skeldev(ret); |
| 745 | } |
| 746 | |
| 747 | /* Device instance created; Second instance not possible */ |
| 748 | skeldev_init_once = 1; |
| 749 | |
| 750 | return ret < 0 ? ret : 0; |
| 751 | } |
| 752 | |
| 753 | static int |
| 754 | skeleton_rawdev_remove(struct rte_vdev_device *vdev) |
nothing calls this directly
no test coverage detected