| 864 | } |
| 865 | |
| 866 | int |
| 867 | rte_cryptodev_get_dev_id(const char *name) |
| 868 | { |
| 869 | unsigned i; |
| 870 | int ret = -1; |
| 871 | |
| 872 | if (name == NULL) |
| 873 | return -1; |
| 874 | |
| 875 | for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) { |
| 876 | if (!rte_cryptodev_is_valid_device_data(i)) |
| 877 | continue; |
| 878 | if ((strcmp(cryptodev_globals.devs[i].data->name, name) |
| 879 | == 0) && |
| 880 | (cryptodev_globals.devs[i].attached == |
| 881 | RTE_CRYPTODEV_ATTACHED)) { |
| 882 | ret = (int)i; |
| 883 | break; |
| 884 | } |
| 885 | } |
| 886 | |
| 887 | rte_cryptodev_trace_get_dev_id(name, ret); |
| 888 | |
| 889 | return ret; |
| 890 | } |
| 891 | |
| 892 | uint8_t |
| 893 | rte_cryptodev_count(void) |
no test coverage detected