struct mrvl_mtr_profile *profile;
struct mrvl_mtr *mtr;
+ profile = mrvl_mtr_profile_from_id(priv, params->meter_profile_id);
+ if (!profile)
+ return -rte_mtr_error_set(error, EINVAL,
+ RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
+ NULL, "Profile id does not exist\n");
+
mtr = mrvl_mtr_from_id(priv, mtr_id);
if (mtr)
return -rte_mtr_error_set(error, EEXIST,
RTE_MTR_ERROR_TYPE_UNSPECIFIED,
NULL, NULL);
- profile = mrvl_mtr_profile_from_id(priv, params->meter_profile_id);
- if (!profile)
- return -rte_mtr_error_set(error, EINVAL,
- RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
- NULL, "Profile id does not exist\n");
-
mtr->shared = shared;
mtr->mtr_id = mtr_id;
mtr->plcr_bit = MRVL_PLCR_BIT_INVALID;