From patchwork Thu Dec 21 12:35:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 135433 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7DD6D43750; Thu, 21 Dec 2023 13:36:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22782410F9; Thu, 21 Dec 2023 13:35:59 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 120B7410F9 for ; Thu, 21 Dec 2023 13:35:57 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BLCVlnE019466 for ; Thu, 21 Dec 2023 04:35:57 -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-transfer-encoding:content-type; s= pfpt0220; bh=1k7/JdQc45c13GDhhDPO6GJGPVEtfByRsVi6rRBpVuo=; b=QG0 VxbYPCWrIGCPhyn6hwv1nGcbwlDTAYWODd7uUi/pOZXMxoJt0z1ciTmiujUJubrv HZ2XrrclG1iWYzEMwHO36w9+9PpJkn4N41voU7PGl/Ts/E8Tc0HNdW7QKcpBtogX PzleObd7183zrAtvblHBF2LNYgBd/sUfQU73c4h9SZx9LGq/xoya7t94kqATgKr/ ZFCqlfp7k0W+BnttOQKws0BvvGA7mFxYo3WnWB9chUI6HgwTowA2gNBq/y1E8wRa bgPKXWhKHe0KW63M8cnx0GCEyveVnVeyDKl4KSTgAWGUDUcvYUYxphgmF88bfNI1 QGD15StU5G0NKwNz9kw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3v4nekg0g2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 21 Dec 2023 04:35:57 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 21 Dec 2023 04:35:55 -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.48 via Frontend Transport; Thu, 21 Dec 2023 04:35:55 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.71.152]) by maili.marvell.com (Postfix) with ESMTP id C31023F707D; Thu, 21 Dec 2023 04:35:52 -0800 (PST) From: Anoob Joseph To: Akhil Goyal CC: Tejasree Kondoj , Jerin Jacob , Vidya Sagar Velumuri , Subject: [PATCH 03/24] crypto/cnxk: fallback to SG if headroom is not available Date: Thu, 21 Dec 2023 18:05:24 +0530 Message-ID: <20231221123545.510-4-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231221123545.510-1-anoobj@marvell.com> References: <20231221123545.510-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: xOM-CHyG_h3k6TzcZO8wD6nknARG_AQt X-Proofpoint-ORIG-GUID: xOM-CHyG_h3k6TzcZO8wD6nknARG_AQt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 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: Tejasree Kondoj Falling back to SG mode for cn9k lookaside IPsec if headroom is not available. Signed-off-by: Tejasree Kondoj --- drivers/crypto/cnxk/cn9k_ipsec_la_ops.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h index 85aacb803f..3d0db72775 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h +++ b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h @@ -82,19 +82,13 @@ process_outb_sa(struct cpt_qp_meta_info *m_info, struct rte_crypto_op *cop, extend_tail = rlen - dlen; pkt_len += extend_tail; - if (likely(m_src->next == NULL)) { + if (likely((m_src->next == NULL) && (hdr_len <= data_off))) { if (unlikely(extend_tail > rte_pktmbuf_tailroom(m_src))) { plt_dp_err("Not enough tail room (required: %d, available: %d)", extend_tail, rte_pktmbuf_tailroom(m_src)); return -ENOMEM; } - if (unlikely(hdr_len > data_off)) { - plt_dp_err("Not enough head room (required: %d, available: %d)", hdr_len, - rte_pktmbuf_headroom(m_src)); - return -ENOMEM; - } - m_src->data_len = pkt_len; hdr = PLT_PTR_ADD(m_src->buf_addr, data_off - hdr_len);