common/cnxk: add CPT LF flush
authorAakash Sasidharan <asasidharan@marvell.com>
Fri, 25 Jun 2021 05:36:40 +0000 (11:06 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 7 Jul 2021 19:15:08 +0000 (21:15 +0200)
Add routine to flush context from CPT context processor cache.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
drivers/common/cnxk/roc_cpt.c
drivers/common/cnxk/roc_cpt.h
drivers/common/cnxk/version.map

index 21c7704..fd92de3 100644 (file)
@@ -599,6 +599,24 @@ fail:
        return rc;
 }
 
+int
+roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, uint64_t cptr)
+{
+       union cpt_lf_ctx_flush reg;
+
+       if (lf == NULL)
+               return -ENOTSUP;
+
+       reg.u = 0;
+       reg.s.pf_func = lf->pf_func;
+       reg.s.inval = 1;
+       reg.s.cptr = cptr;
+
+       plt_write64(reg.u, lf->rbase + CPT_LF_CTX_FLUSH);
+
+       return 0;
+}
+
 void
 cpt_lf_fini(struct roc_cpt_lf *lf)
 {
index 73ecb4e..022c8ad 100644 (file)
@@ -63,6 +63,7 @@ int __roc_api roc_cpt_dev_configure(struct roc_cpt *roc_cpt, int nb_lf);
 void __roc_api roc_cpt_dev_clear(struct roc_cpt *roc_cpt);
 int __roc_api roc_cpt_lf_init(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf);
 void __roc_api roc_cpt_lf_fini(struct roc_cpt_lf *lf);
+int __roc_api roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, uint64_t cptr);
 int __roc_api roc_cpt_afs_print(struct roc_cpt *roc_cpt);
 int __roc_api roc_cpt_lfs_print(struct roc_cpt *roc_cpt);
 void __roc_api roc_cpt_iq_disable(struct roc_cpt_lf *lf);
index 1be5995..4fae325 100644 (file)
@@ -40,6 +40,7 @@ INTERNAL {
        roc_cpt_dev_init;
        roc_cpt_eng_grp_add;
        roc_cpt_iq_disable;
+       roc_cpt_lf_ctx_flush;
        roc_cpt_lf_init;
        roc_cpt_lf_fini;
        roc_cpt_lfs_print;