From: Jin Liu <[email protected]>
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: [email protected]
Signed-off-by: Jin Liu <[email protected]>
Reviewed-by: Chaoyong He <[email protected]>
Reviewed-by: Niklas Söderlund <[email protected]>
---
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