| 178 | } |
| 179 | |
| 180 | static int |
| 181 | validate_action_name(const char *name) |
| 182 | { |
| 183 | if (name == NULL) { |
| 184 | RTE_LOG(ERR, EAL, "Action name cannot be NULL\n"); |
| 185 | rte_errno = EINVAL; |
| 186 | return -1; |
| 187 | } |
| 188 | if (strnlen(name, RTE_MP_MAX_NAME_LEN) == 0) { |
| 189 | RTE_LOG(ERR, EAL, "Length of action name is zero\n"); |
| 190 | rte_errno = EINVAL; |
| 191 | return -1; |
| 192 | } |
| 193 | if (strnlen(name, RTE_MP_MAX_NAME_LEN) == RTE_MP_MAX_NAME_LEN) { |
| 194 | rte_errno = E2BIG; |
| 195 | return -1; |
| 196 | } |
| 197 | return 0; |
| 198 | } |
| 199 | |
| 200 | int |
| 201 | rte_mp_action_register(const char *name, rte_mp_t action) |
no test coverage detected