User could config Port or TC's peak rate by TM ops, but hardware does
not support peak rate which lower than 1Mbps. So we constraint TM
peak rate must be at least 1Mbps.
Fixes:
c09c7847d892 ("net/hns3: support traffic management")
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
return -EINVAL;
}
+ if (profile->peak.rate < hns3_tm_rate_convert_firmware2tm(1)) {
+ error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE;
+ error->message = "peak rate must be at least 1Mbps";
+ return -EINVAL;
+ }
+
if (profile->peak.size) {
error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE;
error->message = "peak bucket size not supported";