Skip to content

Commit d5b2e0a

Browse files
nithind1988davem330
authored andcommitted
octeontx2-af: restore rxc conf after teardown sequence
CN10K CPT coprocessor includes a component named RXC which is responsible for reassembly of inner IP packets. RXC has the feature to evict oldest entries based on age/threshold. The age/threshold is being set to minimum values to evict all entries at the time of teardown. This patch adds code to restore timeout and threshold config after teardown sequence is complete as it is global config. Signed-off-by: Nithin Dabilpuram <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9adb04f commit d5b2e0a

File tree

1 file changed

+18
-4
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+18
-4
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,21 @@ int rvu_mbox_handler_cpt_sts(struct rvu *rvu, struct cpt_sts_req *req,
812812
#define RXC_ZOMBIE_COUNT GENMASK_ULL(60, 48)
813813

814814
static void cpt_rxc_time_cfg(struct rvu *rvu, struct cpt_rxc_time_cfg_req *req,
815-
int blkaddr)
815+
int blkaddr, struct cpt_rxc_time_cfg_req *save)
816816
{
817817
u64 dfrg_reg;
818818

819+
if (save) {
820+
/* Save older config */
821+
dfrg_reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_DFRG);
822+
save->zombie_thres = FIELD_GET(RXC_ZOMBIE_THRES, dfrg_reg);
823+
save->zombie_limit = FIELD_GET(RXC_ZOMBIE_LIMIT, dfrg_reg);
824+
save->active_thres = FIELD_GET(RXC_ACTIVE_THRES, dfrg_reg);
825+
save->active_limit = FIELD_GET(RXC_ACTIVE_LIMIT, dfrg_reg);
826+
827+
save->step = rvu_read64(rvu, blkaddr, CPT_AF_RXC_TIME_CFG);
828+
}
829+
819830
dfrg_reg = FIELD_PREP(RXC_ZOMBIE_THRES, req->zombie_thres);
820831
dfrg_reg |= FIELD_PREP(RXC_ZOMBIE_LIMIT, req->zombie_limit);
821832
dfrg_reg |= FIELD_PREP(RXC_ACTIVE_THRES, req->active_thres);
@@ -840,7 +851,7 @@ int rvu_mbox_handler_cpt_rxc_time_cfg(struct rvu *rvu,
840851
!is_cpt_vf(rvu, req->hdr.pcifunc))
841852
return CPT_AF_ERR_ACCESS_DENIED;
842853

843-
cpt_rxc_time_cfg(rvu, req, blkaddr);
854+
cpt_rxc_time_cfg(rvu, req, blkaddr, NULL);
844855

845856
return 0;
846857
}
@@ -886,7 +897,7 @@ int rvu_mbox_handler_cpt_lf_reset(struct rvu *rvu, struct cpt_lf_rst_req *req,
886897

887898
static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
888899
{
889-
struct cpt_rxc_time_cfg_req req;
900+
struct cpt_rxc_time_cfg_req req, prev;
890901
int timeout = 2000;
891902
u64 reg;
892903

@@ -902,7 +913,7 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
902913
req.active_thres = 1;
903914
req.active_limit = 1;
904915

905-
cpt_rxc_time_cfg(rvu, &req, blkaddr);
916+
cpt_rxc_time_cfg(rvu, &req, blkaddr, &prev);
906917

907918
do {
908919
reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ACTIVE_STS);
@@ -928,6 +939,9 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)
928939

929940
if (timeout == 0)
930941
dev_warn(rvu->dev, "Poll for RXC zombie count hits hard loop counter\n");
942+
943+
/* Restore config */
944+
cpt_rxc_time_cfg(rvu, &prev, blkaddr, NULL);
931945
}
932946

933947
#define INFLIGHT GENMASK_ULL(8, 0)

0 commit comments

Comments
 (0)