patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Jin Liu <jin.liu@corigine.com>,
	stable@dpdk.org, Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH] net/nfp: reset profile config while modify profile
Date: Tue, 28 Feb 2023 16:56:11 +0800	[thread overview]
Message-ID: <20230228085611.498197-1-chaoyong.he@corigine.com> (raw)

From: Jin Liu <jin.liu@corigine.com>

While changing meter profile from pps rate limit mode to bps,
the profile configuration was not reset, leaving the profile
in pps mode. This lead to incorrect operation.

Fix this by clearing the profile before configuring it.

Fixes: 434c66e7e55c ("net/nfp: add meter profile options")
Cc: stable@dpdk.org

Signed-off-by: Jin Liu <jin.liu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_mtr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index 356bcdb370..5f85106f9d 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -241,6 +241,8 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
 	/* Get the old profile config */
 	rte_memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
 
+	memset(&mtr_profile->conf, 0, sizeof(struct nfp_profile_conf));
+
 	ret = nfp_mtr_profile_conf_mod(mtr_profile->profile_id,
 			profile, &mtr_profile->conf);
 	if (ret != 0) {
-- 
2.39.1


             reply	other threads:[~2023-02-28  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  8:56 Chaoyong He [this message]
2023-03-07 14:26 ` Ferruh Yigit

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=20230228085611.498197-1-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=jin.liu@corigine.com \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=stable@dpdk.org \
    /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).