From patchwork Thu Mar 14 08:38:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar Velumuri X-Patchwork-Id: 138357 X-Patchwork-Delegate: gakhil@marvell.com 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 020EA43CAE; Thu, 14 Mar 2024 09:39:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D69F442E61; Thu, 14 Mar 2024 09:39:23 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2BD7B42E0F for ; Thu, 14 Mar 2024 09:39:16 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42DN4rCT016398 for ; Thu, 14 Mar 2024 01:39:15 -0700 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=SqBBJXvWJDUBiRPegMFST9LtVd+H9gcji1w5LepsODQ=; b=M7Z VC+L+RqIJIGzD3pQZGiPe0GX67Lvgjwnams5OoFghy5RVLtpj6LYcaZa2hvSjX4s nTY6mphDRlWM7zGC/sn8hzt18/j9+6xZUnc6xM9XuaM6BbJZnDWJCn38tq28CiPL ue9Yw5WXTNU9hlIxbzTf7VNu9ppxJTu/oIxXdPrV66ACcLKaC50KTJy09Nz+rPFp XqF7hMW/DyRzMDW4qTtgZy9kSzH8JeZwGXXOz35FpC4QftbsGSDqoson25XiFoaR yjZzWM2kELeIZtno6/+qThhLl6v/Dx08e3VMylQo5kvyEZm8gf4suHLNv4I7z1Rc COqXNMdxfRzGqpn/tUA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wucg2uwt8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Mar 2024 01:39:15 -0700 (PDT) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Thu, 14 Mar 2024 01:39:14 -0700 Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 14 Mar 2024 01:39:14 -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.1258.12 via Frontend Transport; Thu, 14 Mar 2024 01:39:14 -0700 Received: from localhost.localdomain (unknown [10.28.36.179]) by maili.marvell.com (Postfix) with ESMTP id 94AB45B692D; Thu, 14 Mar 2024 01:39:11 -0700 (PDT) From: Vidya Sagar Velumuri To: Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj CC: , , , , Subject: [PATCH 04/12] crypto/cnxk: avoid branches in datapath Date: Thu, 14 Mar 2024 01:38:36 -0700 Message-ID: <20240314083844.3319506-5-vvelumuri@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240314083844.3319506-1-vvelumuri@marvell.com> References: <20240314083844.3319506-1-vvelumuri@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: xfNzHcoWVa9kEswzl24nbH2A9DrvNmnu X-Proofpoint-GUID: xfNzHcoWVa9kEswzl24nbH2A9DrvNmnu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-14_07,2024-03-13_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: Anoob Joseph Avoid branches in datapath. Signed-off-by: Anoob Joseph --- drivers/crypto/cnxk/cn10k_ipsec_la_ops.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h index a30b8e413d..4e95fbb6eb 100644 --- a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h +++ b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h @@ -73,12 +73,10 @@ process_outb_sa(struct roc_cpt_lf *lf, struct rte_crypto_op *cop, struct cn10k_s roc_cpt_lf_ctx_reload(lf, &sess->sa.out_sa); rte_delay_ms(1); #endif + const uint64_t ol_flags = m_src->ol_flags; - if (m_src->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) - inst_w4_u64 &= ~BIT_ULL(33); - - if (m_src->ol_flags & RTE_MBUF_F_TX_L4_MASK) - inst_w4_u64 &= ~BIT_ULL(32); + inst_w4_u64 &= ~(((uint64_t)(!!(ol_flags & RTE_MBUF_F_TX_IP_CKSUM)) << 33) | + ((uint64_t)(!!(ol_flags & RTE_MBUF_F_TX_L4_MASK)) << 32)); if (likely(m_src->next == NULL)) { if (unlikely(rte_pktmbuf_tailroom(m_src) < sess->max_extended_len)) {