Skip to content

Commit

Permalink
common/cnxk: fix flow deletion
Browse files Browse the repository at this point in the history
[ upstream commit 40257b8 ]

When a flow is deleted, the counters are deleted without
being cleared first. This results in counter values being
retained and shown in flows created later. Hence, counter
is cleared before being deleted.

Updated driver to clear and delete counters upon flow deletion.

Fixes: a07f7ce ("common/cnxk: add NPC init and fini")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
satheeshpaul authored and kevintraynor committed Feb 28, 2022
1 parent 450ee57 commit d918693
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/common/cnxk/roc_npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,16 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
return rc;
}

if (flow->ctr_id != NPC_COUNTER_NONE) {
rc = roc_npc_mcam_clear_counter(roc_npc, flow->ctr_id);
if (rc != 0)
return rc;

rc = npc_mcam_free_counter(npc, flow->ctr_id);
if (rc != 0)
return rc;
}

rc = npc_mcam_free_entry(npc, flow->mcam_id);
if (rc != 0)
return rc;
Expand Down

0 comments on commit d918693

Please sign in to comment.