From: <skori@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: [PATCH] net/cnxk: add threshold validation for RED config
Date: Mon, 2 Jan 2023 22:13:53 +0530 [thread overview]
Message-ID: <20230102164353.110683-1-skori@marvell.com> (raw)
From: Sunil Kumar Kori <skori@marvell.com>
Validation is added to check minimum and maximum RED
threshold values, passed by user.
Fixes: b7d3a0fe71eb ("net/cnxk: support congestion management operations")
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
drivers/net/cnxk/cnxk_ethdev_cman.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/cnxk/cnxk_ethdev_cman.c b/drivers/net/cnxk/cnxk_ethdev_cman.c
index d5e647c64d..a7ccdfb756 100644
--- a/drivers/net/cnxk/cnxk_ethdev_cman.c
+++ b/drivers/net/cnxk/cnxk_ethdev_cman.c
@@ -68,6 +68,11 @@ nix_cman_config_validate(struct rte_eth_dev *eth_dev, const struct rte_eth_cman_
return -EINVAL;
}
+ if (config->mode_param.red.min_th > config->mode_param.red.max_th) {
+ plt_err("RED minimum threshold must be less or equal to maximum threshold");
+ return -EINVAL;
+ }
+
return 0;
}
--
2.25.1
next reply other threads:[~2023-01-02 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-02 16:43 skori [this message]
2023-01-17 12:05 ` 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=20230102164353.110683-1-skori@marvell.com \
--to=skori@marvell.com \
--cc=dev@dpdk.org \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=skoteshwar@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).