MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_kvargs_validate

Function mlx5_kvargs_validate

dpdk/drivers/common/mlx5/mlx5_common.c:222–242  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

220 * 0 on success, a negative errno value otherwise and rte_errno is set.
221 */
222static int
223mlx5_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.

Callers 1

mlx5_common_dev_probeFunction · 0.85

Calls 1

rte_eal_process_typeFunction · 0.85

Tested by

no test coverage detected