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

Function nfp_mtr_validate

dpdk/drivers/net/nfp/nfp_mtr.c:604–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604static int
605nfp_mtr_validate(uint32_t meter_id,
606 struct rte_mtr_params *params,
607 struct rte_mtr_error *error)
608{
609 /* Params must not be NULL */
610 if (params == NULL) {
611 return -rte_mtr_error_set(error, EINVAL,
612 RTE_MTR_ERROR_TYPE_MTR_PARAMS,
613 NULL, "Meter params is null.");
614 }
615
616 /* Meter policy ID must be valid. */
617 if (meter_id >= NFP_MAX_MTR_CNT) {
618 return -rte_mtr_error_set(error, EINVAL,
619 RTE_MTR_ERROR_TYPE_MTR_ID,
620 NULL, "Meter id not valid.");
621 }
622
623 if (params->use_prev_mtr_color != 0) {
624 return -rte_mtr_error_set(error, EINVAL,
625 RTE_MTR_ERROR_TYPE_MTR_PARAMS,
626 NULL, "Feature use_prev_mtr_color not support");
627 }
628
629 return nfp_mtr_stats_mask_validate(params->stats_mask, error);
630}
631
632static void
633nfp_mtr_config(uint32_t mtr_id,

Callers 1

nfp_mtr_createFunction · 0.85

Calls 2

rte_mtr_error_setFunction · 0.85

Tested by

no test coverage detected