[PATCH] net/nfp: reset profile config while modify profile

Chaoyong He chaoyong.he at corigine.com
Tue Feb 28 09:56:11 CET 2023


From: Jin Liu <jin.liu at 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 at dpdk.org

Signed-off-by: Jin Liu <jin.liu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at 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



More information about the stable mailing list