DPDK patches and discussions
 help / color / mirror / Atom feed
From: Li Zhang <lizh@nvidia.com>
To: dekelp@nvidia.com, orika@nvidia.com, viacheslavo@nvidia.com,
	matan@nvidia.com, shahafs@nvidia.com,
	cristian.dumitrescu@intel.com, lironh@marvell.com,
	Jasvinder Singh <jasvinder.singh@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com, roniba@nvidia.com
Subject: [dpdk-dev] [PATCH 1/2] net/softnic: check meter packet mode
Date: Thu,  1 Apr 2021 09:16:16 +0300	[thread overview]
Message-ID: <20210401061618.1478961-2-lizh@nvidia.com> (raw)
In-Reply-To: <20210401061618.1478961-1-lizh@nvidia.com>

Currently meter algorithms only supports bytes per second(BPS).
Check packet_mode set to TRUE are rejected.

Signed-off-by: Li Zhang <lizh@nvidia.com>
---
 drivers/net/softnic/rte_eth_softnic_meter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c
index 0cbf94e8b0..50db74f52f 100644
--- a/drivers/net/softnic/rte_eth_softnic_meter.c
+++ b/drivers/net/softnic/rte_eth_softnic_meter.c
@@ -128,6 +128,14 @@ meter_profile_check(struct rte_eth_dev *dev,
 			NULL,
 			"Metering alg not supported");
 
+	/* Not support packet mode, just support byte mode. */
+	if (profile->packet_mode)
+		return -rte_mtr_error_set(error,
+			EINVAL,
+			RTE_MTR_ERROR_TYPE_METER_PROFILE,
+			NULL,
+			"Meter packet mode not supported");
+
 	return 0;
 }
 
-- 
2.27.0


  reply	other threads:[~2021-04-01  6:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  6:16 [dpdk-dev] [PATCH 0/2] Check meter packet mode in PMD Li Zhang
2021-04-01  6:16 ` Li Zhang [this message]
2021-04-07 20:13   ` [dpdk-dev] [PATCH 1/2] net/softnic: check meter packet mode Dumitrescu, Cristian
2021-04-08  2:31     ` Li Zhang
2021-04-01  6:16 ` [dpdk-dev] [PATCH 2/2] net/mvpp2: " Li Zhang
2021-04-07 20:13   ` Dumitrescu, Cristian
2021-04-08  2:32     ` Li Zhang
2021-04-01  6:31 ` [dpdk-dev] [PATCH 0/2] Check meter packet mode in PMD Thomas Monjalon
2021-04-01  6:52   ` Li Zhang
2021-04-01  7:04     ` Thomas Monjalon
2021-04-01  7:37       ` Li Zhang
2021-04-01  7:44         ` Thomas Monjalon
2021-04-01  8:50           ` Li Zhang

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=20210401061618.1478961-2-lizh@nvidia.com \
    --to=lizh@nvidia.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=lironh@marvell.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=roniba@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.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).