req->aura.fc_ena = enable;
req->aura_mask.fc_ena = 1;
- if (roc_model_is_cn9k() || roc_model_is_cn10ka_a0()) {
+ if (roc_model_is_cn9k() || roc_errata_npa_has_no_fc_stype_ststp()) {
req->aura.fc_stype = 0x0; /* STF */
req->aura_mask.fc_stype = 0x0; /* STF */
} else {
if (profile->peak.rate && min_rate > profile->peak.rate)
min_rate = profile->peak.rate;
- /* Each packet accomulate single count, whereas HW
+ /* Each packet accumulate single count, whereas HW
* considers each unit as Byte, so we need convert
* user pps to bps
*/
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;
if (commit_rate || commit_sz) {
if (commit_sz < min_burst || commit_sz > max_burst)
return NIX_ERR_TM_INVALID_COMMIT_SZ;
- else if (!nix_tm_shaper_rate_conv(commit_rate, NULL, NULL,
- NULL))
+ else if (!nix_tm_shaper_rate_conv(commit_rate, NULL, NULL, NULL,
+ profile->accuracy))
return NIX_ERR_TM_INVALID_COMMIT_RATE;
}
if (peak_sz || peak_rate) {
if (peak_sz < min_burst || peak_sz > max_burst)
return NIX_ERR_TM_INVALID_PEAK_SZ;
- else if (!nix_tm_shaper_rate_conv(peak_rate, NULL, NULL, NULL))
+ else if (!nix_tm_shaper_rate_conv(peak_rate, NULL, NULL, NULL,
+ profile->accuracy))
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);
profile->pkt_len_adj = roc_profile->pkt_len_adj;
profile->pkt_mode = roc_profile->pkt_mode;
profile->free_fn = roc_profile->free_fn;
+ profile->accuracy = roc_profile->accuracy;
return nix_tm_shaper_profile_add(roc_nix, profile, 0);
}
profile->peak.rate = roc_profile->peak_rate;
profile->commit.size = roc_profile->commit_sz;
profile->peak.size = roc_profile->peak_sz;
+ profile->pkt_len_adj = roc_profile->pkt_len_adj;
+ profile->accuracy = roc_profile->accuracy;
return nix_tm_shaper_profile_add(roc_nix, profile, 1);
}
}
}
+ /* Disable backpressure, it will be enabled back if needed on
+ * hierarchy enable
+ */
+ for (i = 0; i < sq_cnt; i++) {
+ sq = nix->sqs[i];
+ if (!sq)
+ continue;
+
+ rc = nix_tm_bp_config_set(roc_nix, sq->qid, 0, false);
+ if (rc && rc != -ENOENT) {
+ plt_err("Failed to disable backpressure, rc=%d", rc);
+ goto cleanup;
+ }
+ }
+
/* Flush all tx queues */
for (i = 0; i < sq_cnt; i++) {
sq = nix->sqs[i];