From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 36568A034F;
	Mon,  7 Feb 2022 08:30:51 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C70D841101;
	Mon,  7 Feb 2022 08:30:19 +0100 (CET)
Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com
 [67.231.156.173])
 by mails.dpdk.org (Postfix) with ESMTP id B4020410F7
 for <dev@dpdk.org>; Mon,  7 Feb 2022 08:30:15 +0100 (CET)
Received: from pps.filterd (m0045851.ppops.net [127.0.0.1])
 by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 216MmlZt020123
 for <dev@dpdk.org>; Sun, 6 Feb 2022 23:30:15 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=from : to : cc :
 subject : date : message-id : in-reply-to : references : mime-version :
 content-type; s=pfpt0220; bh=21Unmi9t+GK5YH7b1zcwx+zsyP6rgi9WMDjfe4d3qF0=;
 b=TR29SzlrnRQ/02VAlfnSQp2KQ8saDHgpd9eJRsAVRdOSjGVu/JZaL6lU8TqpPMFnRlsF
 oA9gPz+gBApjgA5O69B1zKJbUC7b41A7+SsZ+ujnUy4EdnxLkbp6PTYF0mscudCgMn2e
 EgstEe+55wK9E52qQ1KqxlGWcqfon9WBZp/grY0cwcfW77oMi9mEcRxuU1wkefP+rxaw
 z8AbGFOn/o9yWcUMO3zTln71g3tysNN3xhSbabnX50rWj88Y/U5sVmETb8FKkq3k+Mqa
 EGO2Sh//R1d7xefeGOoT/EUDqkFslIVQLhoESbUYiScPv7dTxHtfDKQY6mkSMulROBLO nw== 
Received: from dc5-exch01.marvell.com ([199.233.59.181])
 by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3e1smr4p2e-10
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Sun, 06 Feb 2022 23:30:15 -0800
Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com
 (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;
 Sun, 6 Feb 2022 23:30:12 -0800
Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com
 (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend
 Transport; Sun, 6 Feb 2022 23:30:12 -0800
Received: from hyd1588t430.marvell.com (unknown [10.29.52.204])
 by maili.marvell.com (Postfix) with ESMTP id 4473C3F7063;
 Sun,  6 Feb 2022 23:30:10 -0800 (PST)
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, "Kiran
 Kumar K" <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,
 Satha Rao <skoteshwar@marvell.com>
CC: <dev@dpdk.org>
Subject: [PATCH 09/20] common/cnxk: allow force use of SSO pffunc for outb
 inline
Date: Mon, 7 Feb 2022 12:59:21 +0530
Message-ID: <20220207072932.22409-9-ndabilpuram@marvell.com>
X-Mailer: git-send-email 2.8.4
In-Reply-To: <20220207072932.22409-1-ndabilpuram@marvell.com>
References: <20220207072932.22409-1-ndabilpuram@marvell.com>
MIME-Version: 1.0
Content-Type: text/plain
X-Proofpoint-GUID: Hfpt0eCPqutfR16nhXokz0u9TDbW7dWl
X-Proofpoint-ORIG-GUID: Hfpt0eCPqutfR16nhXokz0u9TDbW7dWl
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513
 definitions=2022-02-07_02,2022-02-03_01,2021-12-02_01
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Allow force use of SSO pffunc even when inline dev is available
so that in case driver needs events directly delivered to
event device.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 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 0122b98..57a595f 100644
--- a/drivers/common/cnxk/roc_nix.h
+++ b/drivers/common/cnxk/roc_nix.h
@@ -386,6 +386,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 ac17e95..003f972 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.8.4