Skip to contentSkip to conversation

common/cnxk: consider adjust value for tm burst calculation

PATCH Applied [email protected] 2 participants 2 messages Nov 1, 2021 – Nov 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: consider adjust value for tm burst calculation

From: Satha Rao <[email protected]>

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.

---
 drivers/common/cnxk/roc_nix_tm_ops.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/common/cnxk/roc_nix_tm_ops.c +9 -0
index eee80d5..b80c77c 100644
@@ -124,6 +124,11 @@
 		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;
@@ -181,6 +186,10 @@
 			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);
 
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines · On Mon, Nov 1, 2021 at 12:59 PM <[email protected]> wrote:

From: Satha Rao <[email protected]>

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.

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 34 lines
---
 drivers/common/cnxk/roc_nix_tm_ops.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/common/cnxk/roc_nix_tm_ops.c +9 -1
index eee80d5..b80c77c 100644
@@ -124,6 +124,11 @@
                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;
@@ -181,6 +186,10 @@
                        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);
 
--

1.8.3.1