* Validate device arguments list. * It report about the first unknown parameter. * * @param[in] mkvlist * Pointer to mlx5 kvargs control. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */
| 220 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 221 | */ |
| 222 | static int |
| 223 | mlx5_kvargs_validate(struct mlx5_kvargs_ctrl *mkvlist) |
| 224 | { |
| 225 | uint32_t i; |
| 226 | |
| 227 | /* Secondary process should not handle devargs. */ |
| 228 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 229 | return 0; |
| 230 | if (mkvlist == NULL) |
| 231 | return 0; |
| 232 | for (i = 0; i < mkvlist->kvlist->count; i++) { |
| 233 | if (mkvlist->is_used[i] == 0) { |
| 234 | DRV_LOG(ERR, "Key \"%s\" " |
| 235 | "is unknown for the provided classes.", |
| 236 | mkvlist->kvlist->pairs[i].key); |
| 237 | rte_errno = EINVAL; |
| 238 | return -rte_errno; |
| 239 | } |
| 240 | } |
| 241 | return 0; |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * Verify and store value for devargs. |
no test coverage detected