| 844 | }; |
| 845 | |
| 846 | static int |
| 847 | ssovf_vdev_probe(struct rte_vdev_device *vdev) |
| 848 | { |
| 849 | struct ssovf_info oinfo; |
| 850 | struct ssovf_mbox_dev_info info; |
| 851 | struct ssovf_evdev *edev; |
| 852 | struct rte_eventdev *eventdev; |
| 853 | static int ssovf_init_once; |
| 854 | const char *name; |
| 855 | const char *params; |
| 856 | int ret; |
| 857 | |
| 858 | static const char *const args[] = { |
| 859 | TIMVF_ENABLE_STATS_ARG, |
| 860 | NULL |
| 861 | }; |
| 862 | |
| 863 | name = rte_vdev_device_name(vdev); |
| 864 | /* More than one instance is not supported */ |
| 865 | if (ssovf_init_once) { |
| 866 | ssovf_log_err("Request to create >1 %s instance", name); |
| 867 | return -EINVAL; |
| 868 | } |
| 869 | |
| 870 | params = rte_vdev_device_args(vdev); |
| 871 | if (params != NULL && params[0] != '\0') { |
| 872 | struct rte_kvargs *kvlist = rte_kvargs_parse(params, args); |
| 873 | |
| 874 | if (!kvlist) { |
| 875 | ssovf_log_info( |
| 876 | "Ignoring unsupported params supplied '%s'", |
| 877 | name); |
| 878 | } else { |
| 879 | ret = rte_kvargs_process(kvlist, TIMVF_ENABLE_STATS_ARG, |
| 880 | ssovf_parsekv, |
| 881 | &timvf_enable_stats); |
| 882 | if (ret != 0) { |
| 883 | ssovf_log_err("%s: Error in timvf stats", name); |
| 884 | rte_kvargs_free(kvlist); |
| 885 | return ret; |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | rte_kvargs_free(kvlist); |
| 890 | } |
| 891 | |
| 892 | eventdev = rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev), |
| 893 | rte_socket_id(), vdev); |
| 894 | if (eventdev == NULL) { |
| 895 | ssovf_log_err("Failed to create eventdev vdev %s", name); |
| 896 | return -ENOMEM; |
| 897 | } |
| 898 | eventdev->dev_ops = &ssovf_ops; |
| 899 | |
| 900 | timvf_set_eventdevice(eventdev); |
| 901 | |
| 902 | /* For secondary processes, the primary has done all the work */ |
| 903 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) { |
nothing calls this directly
no test coverage detected