mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
octeontx2-pf: mcs: Clear stats before freeing resource
[ Upstream commit815debbbf7] 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:c54ffc7360("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c52ebecd89
commit
a8ddb974f0
@@ -150,11 +150,20 @@ static void cn10k_mcs_free_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir,
|
|||||||
enum mcs_rsrc_type type, u16 hw_rsrc_id,
|
enum mcs_rsrc_type type, u16 hw_rsrc_id,
|
||||||
bool all)
|
bool all)
|
||||||
{
|
{
|
||||||
|
struct mcs_clear_stats *clear_req;
|
||||||
struct mbox *mbox = &pfvf->mbox;
|
struct mbox *mbox = &pfvf->mbox;
|
||||||
struct mcs_free_rsrc_req *req;
|
struct mcs_free_rsrc_req *req;
|
||||||
|
|
||||||
mutex_lock(&mbox->lock);
|
mutex_lock(&mbox->lock);
|
||||||
|
|
||||||
|
clear_req = otx2_mbox_alloc_msg_mcs_clear_stats(mbox);
|
||||||
|
if (!clear_req)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
clear_req->id = hw_rsrc_id;
|
||||||
|
clear_req->type = type;
|
||||||
|
clear_req->dir = dir;
|
||||||
|
|
||||||
req = otx2_mbox_alloc_msg_mcs_free_resources(mbox);
|
req = otx2_mbox_alloc_msg_mcs_free_resources(mbox);
|
||||||
if (!req)
|
if (!req)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|||||||
Reference in New Issue
Block a user