From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8542145909; Thu, 5 Sep 2024 09:47:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 479E042E45; Thu, 5 Sep 2024 09:46:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 953AC42E15 for ; Thu, 5 Sep 2024 09:46:47 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4856JmbJ009273 for ; Thu, 5 Sep 2024 00:46:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=X ldPDcqV14EamqPSEhkaVz5WkTUN3z7xTYtXA0NDDFM=; b=AJnPomyiyh0kaS6s9 BRxVkOkfV0Jfl0SkeBLROHZvf2arDOpi1+OT/P1bpxfajyyIY4VO/XrmIlSMXFRy VDDhVfvNY2QvPRHkI3gi70OLhFhLwLwjIKFCb5WxHKx9DZeAE6k7tuHnVtzoXc/v p1sIaSirMhUXN5K1VdyPmSHaVphmbHZnOYFLDF1SnPR5NtreDd/3oC48j1BMsR/y z9GGno80BKV6fIG1GT3Je8FxK1O23Nrtmg9S+Z/YU87kixhQmxPejf8E0iFeYK1f fqBGuTgQq+IQl9OeRhBZcaCb9qqkPV1UcCnCWbYu70qNa3NWlZx/ExlfQEC5cOh+ D+nyw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 41f79dr95x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 05 Sep 2024 00:46:46 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 5 Sep 2024 00:46:45 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 5 Sep 2024 00:46:45 -0700 Received: from hyd1554.caveonetworks.com (unknown [10.29.56.32]) by maili.marvell.com (Postfix) with ESMTP id E40E65B6927; Thu, 5 Sep 2024 00:46:43 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Vidya Sagar Velumuri , Subject: [PATCH 05/11] common/cnxk: remove abort from flush API Date: Thu, 5 Sep 2024 13:16:25 +0530 Message-ID: <20240905074631.1462357-6-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240905074631.1462357-1-ktejasree@marvell.com> References: <20240905074631.1462357-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: jGrq0EMIdBRggMCKhssZiyPOOQ0Wsv3Q X-Proofpoint-GUID: jGrq0EMIdBRggMCKhssZiyPOOQ0Wsv3Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-05_04,2024-09-04_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Anoob Joseph Instead of calling abort() return error code so that the caller can handle as required. Signed-off-by: Anoob Joseph --- drivers/common/cnxk/roc_cpt.c | 2 +- drivers/crypto/cnxk/cn10k_ipsec.c | 12 ++++++++++-- drivers/crypto/cnxk/cn10k_tls.c | 12 ++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index 64fa284b9a..acbf5fa9d4 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -826,7 +826,7 @@ roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, void *cptr, bool inval) if (err.s.flush_st_flt) { plt_err("CTX flush could not complete due to store fault"); - abort(); + return -EFAULT; } return 0; diff --git a/drivers/crypto/cnxk/cn10k_ipsec.c b/drivers/crypto/cnxk/cn10k_ipsec.c index ef5f0ff4aa..7517602fa4 100644 --- a/drivers/crypto/cnxk/cn10k_ipsec.c +++ b/drivers/crypto/cnxk/cn10k_ipsec.c @@ -135,7 +135,11 @@ cn10k_ipsec_outb_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, } /* Trigger CTX flush so that data is written back to DRAM */ - roc_cpt_lf_ctx_flush(lf, out_sa, false); + ret = roc_cpt_lf_ctx_flush(lf, out_sa, false); + if (ret == -EFAULT) { + plt_err("Could not flush outbound session"); + goto sa_dptr_free; + } sec_sess->proto = RTE_SECURITY_PROTOCOL_IPSEC; plt_atomic_thread_fence(__ATOMIC_SEQ_CST); @@ -236,7 +240,11 @@ cn10k_ipsec_inb_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, } /* Trigger CTX flush so that data is written back to DRAM */ - roc_cpt_lf_ctx_flush(lf, in_sa, true); + ret = roc_cpt_lf_ctx_flush(lf, in_sa, true); + if (ret == -EFAULT) { + plt_err("Could not flush inbound session"); + goto sa_dptr_free; + } sec_sess->proto = RTE_SECURITY_PROTOCOL_IPSEC; plt_atomic_thread_fence(__ATOMIC_SEQ_CST); diff --git a/drivers/crypto/cnxk/cn10k_tls.c b/drivers/crypto/cnxk/cn10k_tls.c index 7b73a58d2a..4bd2654499 100644 --- a/drivers/crypto/cnxk/cn10k_tls.c +++ b/drivers/crypto/cnxk/cn10k_tls.c @@ -707,7 +707,11 @@ cn10k_tls_read_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, } /* Trigger CTX flush so that data is written back to DRAM */ - roc_cpt_lf_ctx_flush(lf, read_sa, true); + ret = roc_cpt_lf_ctx_flush(lf, read_sa, true); + if (ret == -EFAULT) { + plt_err("Could not flush TLS read session to hardware"); + goto sa_dptr_free; + } rte_atomic_thread_fence(rte_memory_order_seq_cst); @@ -796,7 +800,11 @@ cn10k_tls_write_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, } /* Trigger CTX flush so that data is written back to DRAM */ - roc_cpt_lf_ctx_flush(lf, write_sa, false); + ret = roc_cpt_lf_ctx_flush(lf, write_sa, false); + if (ret == -EFAULT) { + plt_err("Could not flush TLS write session to hardware"); + goto sa_dptr_free; + } rte_atomic_thread_fence(rte_memory_order_seq_cst); -- 2.25.1