To support lower pps in packet mode we are changing adjust value,
same needs to be consider for burst size calculations.
When both peak and committed rates requested, then peak rate should
be larger than committed rate.
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
profile->pkt_mode_adj += adjust;
profile->commit.rate += (adjust * profile->commit.rate);
profile->peak.rate += (adjust * profile->peak.rate);
+ /* Number of tokens freed after scheduling was proportional
+ * to adjust value
+ */
+ profile->commit.size *= adjust;
+ profile->peak.size *= adjust;
}
return 0;
return NIX_ERR_TM_INVALID_PEAK_RATE;
}
+ /* If PIR and CIR are requested, PIR should always be larger than CIR */
+ if (peak_rate && commit_rate && (commit_rate > peak_rate))
+ return NIX_ERR_TM_INVALID_PEAK_RATE;
+
if (!skip_ins)
TAILQ_INSERT_TAIL(&nix->shaper_profile_list, profile, shaper);