DPDK patches and discussions
 help / color / mirror / Atom feed
From: <skoteshwar@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] common/cnxk: consider adjust value for tm burst calculation
Date: Mon, 1 Nov 2021 03:28:57 -0400	[thread overview]
Message-ID: <1635751737-29259-1-git-send-email-skoteshwar@marvell.com> (raw)

From: Satha Rao <skoteshwar@marvell.com>

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>
---
 drivers/common/cnxk/roc_nix_tm_ops.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c
index eee80d5..b80c77c 100644
--- a/drivers/common/cnxk/roc_nix_tm_ops.c
+++ b/drivers/common/cnxk/roc_nix_tm_ops.c
@@ -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


             reply	other threads:[~2021-11-01  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  7:28 skoteshwar [this message]
2021-11-03 15:13 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635751737-29259-1-git-send-email-skoteshwar@marvell.com \
    --to=skoteshwar@marvell.com \
    --cc=dev@dpdk.org \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).