From a9207715c12659fbb1345de148535dd8b04c7bdb Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Wed, 23 Feb 2022 01:05:00 +0530 Subject: [PATCH] common/cnxk: allow force use of SSO device for outb inline Allow force use of SSO device even when inline dev is available so that in case driver needs events directly delivered to event device. Signed-off-by: Nithin Dabilpuram Acked-by: Jerin Jacob --- drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_inl.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index 0ced7fb8d0..9546315761 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -397,6 +397,7 @@ struct roc_nix { uint16_t outb_nb_crypto_qs; uint16_t ipsec_in_max_spi; uint16_t ipsec_out_max_sa; + bool ipsec_out_sso_pffunc; /* End of input parameters */ /* LMT line base for "Per Core Tx LMT line" mode*/ uintptr_t lmt_base; diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c index ac17e95cd0..003f972aeb 100644 --- a/drivers/common/cnxk/roc_nix_inl.c +++ b/drivers/common/cnxk/roc_nix_inl.c @@ -311,6 +311,10 @@ roc_nix_inl_outb_init(struct roc_nix *roc_nix) /* Retrieve inline device if present */ inl_dev = idev->nix_inl_dev; sso_pffunc = inl_dev ? inl_dev->dev.pf_func : idev_sso_pffunc_get(); + /* Use sso_pffunc if explicitly requested */ + if (roc_nix->ipsec_out_sso_pffunc) + sso_pffunc = idev_sso_pffunc_get(); + if (!sso_pffunc) { plt_err("Failed to setup inline outb, need either " "inline device or sso device"); @@ -328,7 +332,8 @@ roc_nix_inl_outb_init(struct roc_nix *roc_nix) eng_grpmask = (1ULL << ROC_CPT_DFLT_ENG_GRP_SE | 1ULL << ROC_CPT_DFLT_ENG_GRP_SE_IE | 1ULL << ROC_CPT_DFLT_ENG_GRP_AE); - rc = cpt_lfs_alloc(dev, eng_grpmask, blkaddr, true); + rc = cpt_lfs_alloc(dev, eng_grpmask, blkaddr, + !roc_nix->ipsec_out_sso_pffunc); if (rc) { plt_err("Failed to alloc CPT LF resources, rc=%d", rc); goto lf_detach; -- 2.39.5