| 2875 | } |
| 2876 | |
| 2877 | static int |
| 2878 | cryptodev_handle_dev_caps(const char *cmd __rte_unused, const char *params, |
| 2879 | struct rte_tel_data *d) |
| 2880 | { |
| 2881 | struct rte_cryptodev_info dev_info; |
| 2882 | struct rte_tel_data *crypto_caps; |
| 2883 | int crypto_caps_n; |
| 2884 | char *end_param; |
| 2885 | int dev_id; |
| 2886 | |
| 2887 | if (!params || strlen(params) == 0 || !isdigit(*params)) |
| 2888 | return -EINVAL; |
| 2889 | |
| 2890 | dev_id = strtoul(params, &end_param, 0); |
| 2891 | if (*end_param != '\0') |
| 2892 | CDEV_LOG_ERR("Extra parameters passed to command, ignoring"); |
| 2893 | if (!rte_cryptodev_is_valid_dev(dev_id)) |
| 2894 | return -EINVAL; |
| 2895 | |
| 2896 | rte_tel_data_start_dict(d); |
| 2897 | crypto_caps = rte_tel_data_alloc(); |
| 2898 | if (!crypto_caps) |
| 2899 | return -ENOMEM; |
| 2900 | |
| 2901 | rte_cryptodev_info_get(dev_id, &dev_info); |
| 2902 | crypto_caps_n = crypto_caps_array(crypto_caps, dev_info.capabilities); |
| 2903 | rte_tel_data_add_dict_container(d, "crypto_caps", crypto_caps, 0); |
| 2904 | rte_tel_data_add_dict_int(d, "crypto_caps_n", crypto_caps_n); |
| 2905 | |
| 2906 | return 0; |
| 2907 | } |
| 2908 | |
| 2909 | RTE_INIT(cryptodev_init_telemetry) |
| 2910 | { |
nothing calls this directly
no test coverage detected