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 0F094429D9; Mon, 24 Apr 2023 11:19:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5176410EC; Mon, 24 Apr 2023 11:19:23 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id ECC40410DE for ; Mon, 24 Apr 2023 11:19:22 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33O99Xt8014900; Mon, 24 Apr 2023 02:19:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=MfBPmc93uxQ+tt3FuNF6cBi7XN0Q6vxiH8Ua6rv+jxE=; b=T6YX7HKFLkr6df42IyHEQTVTMjyQCsw8mt7uCnc+2tCXLxGNAgftdOsu79CmmKPW3DPI vlg/28vdzzGI1oqSyS70KVeg/bCFShttaqtY1Q2/3L87rHA8Zg7UMXWyiAVmF8lNnnWh YS1+P1WohQehLS21UuCqImrhIY9bcCNLqXMB6GwZFSdyCOZ+VC32rVZ+HL/p383MdKAD jGB+dbwaCA07OMRUqUPRTcar3Z5nFOqP8BVP0SV5Z6nn/iXN4bUlUOAPGOlFYc0ymqUt uxaXlyDNGyUVeR6Z8ekaW2c2y0go7DhEmTKb+MfvZq2aMaMwwL/Icfd01mgOBbS2srsb cg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3p5hkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 24 Apr 2023 02:19:22 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 24 Apr 2023 02:19:20 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 24 Apr 2023 02:19:19 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.78.137]) by maili.marvell.com (Postfix) with ESMTP id 319CF3F70B3; Mon, 24 Apr 2023 02:19:17 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Fan Zhang CC: Jerin Jacob , Subject: [PATCH] cryptodev: clarify error codes returned Date: Mon, 24 Apr 2023 14:49:20 +0530 Message-ID: <20230424091920.660-1-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 1S5quMDXPwCR6Ec8UgOvyk82xvhVXjVW X-Proofpoint-GUID: 1S5quMDXPwCR6Ec8UgOvyk82xvhVXjVW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-24_06,2023-04-21_01,2023-02-09_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 When symmetric sessions are created, it may fail due to non-critical errors. When PMD doesn't support the specific combination that application requested, it can return -ENOTSUP which can be handled so in application. The API is already setting rte_errno according to the reason of the failure. Clarifying this in the spec to list down possible error codes. Fixes: bdce2564dbf7 ("cryptodev: rework session framework") Signed-off-by: Anoob Joseph --- lib/cryptodev/rte_cryptodev.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 3a9ad13660..4e3a7db0fe 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -1048,11 +1048,14 @@ rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts, * @param dev_id ID of device that we want the session to be used on * @param xforms Symmetric crypto transform operations to apply on flow * processed with this session - * @param mp Mempool where the private data is allocated. + * @param mp Mempool to allocate symmetric session objects from * * @return * - On success return pointer to sym-session. - * - On failure returns NULL. + * - On failure returns NULL and rte_errno is set to the error code. + * EINVAL on invalid arguments. + * ENOMEM on memory error for session allocation. + * ENOTSUP if device doesn't support session configuration. */ void * rte_cryptodev_sym_session_create(uint8_t dev_id, -- 2.25.1