Skip to content

Commit 76377a0

Browse files
Subbaraya Sundeepsmb49
authored andcommitted
octeontx2-pf: mcs: Clear stats before freeing resource
BugLink: https://bugs.launchpad.net/bugs/2028580 [ Upstream commit 815debb ] When freeing MCS hardware resources like SecY, SC and SA the corresponding stats needs to be cleared. Otherwise previous stats are shown in newly created macsec interfaces. Fixes: c54ffc7 ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 7cb7b6d commit 76377a0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,20 @@ static void cn10k_mcs_free_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir,
150150
enum mcs_rsrc_type type, u16 hw_rsrc_id,
151151
bool all)
152152
{
153+
struct mcs_clear_stats *clear_req;
153154
struct mbox *mbox = &pfvf->mbox;
154155
struct mcs_free_rsrc_req *req;
155156

156157
mutex_lock(&mbox->lock);
157158

159+
clear_req = otx2_mbox_alloc_msg_mcs_clear_stats(mbox);
160+
if (!clear_req)
161+
goto fail;
162+
163+
clear_req->id = hw_rsrc_id;
164+
clear_req->type = type;
165+
clear_req->dir = dir;
166+
158167
req = otx2_mbox_alloc_msg_mcs_free_resources(mbox);
159168
if (!req)
160169
goto fail;

0 commit comments

Comments
 (0)