| 2788 | } |
| 2789 | |
| 2790 | static int |
| 2791 | cryptodev_handle_dev_info(const char *cmd __rte_unused, |
| 2792 | const char *params, struct rte_tel_data *d) |
| 2793 | { |
| 2794 | struct rte_cryptodev_info cryptodev_info; |
| 2795 | int dev_id; |
| 2796 | char *end_param; |
| 2797 | |
| 2798 | if (params == NULL || strlen(params) == 0 || !isdigit(*params)) |
| 2799 | return -EINVAL; |
| 2800 | |
| 2801 | dev_id = strtoul(params, &end_param, 0); |
| 2802 | if (*end_param != '\0') |
| 2803 | CDEV_LOG_ERR("Extra parameters passed to command, ignoring"); |
| 2804 | if (!rte_cryptodev_is_valid_dev(dev_id)) |
| 2805 | return -EINVAL; |
| 2806 | |
| 2807 | rte_cryptodev_info_get(dev_id, &cryptodev_info); |
| 2808 | |
| 2809 | rte_tel_data_start_dict(d); |
| 2810 | rte_tel_data_add_dict_string(d, "device_name", |
| 2811 | cryptodev_info.device->name); |
| 2812 | rte_tel_data_add_dict_uint(d, "max_nb_queue_pairs", |
| 2813 | cryptodev_info.max_nb_queue_pairs); |
| 2814 | |
| 2815 | return 0; |
| 2816 | } |
| 2817 | |
| 2818 | #define ADD_DICT_STAT(s) rte_tel_data_add_dict_uint(d, #s, cryptodev_stats.s) |
| 2819 |
nothing calls this directly
no test coverage detected