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 B8D8741D5F; Fri, 24 Feb 2023 10:40:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BAF741148; Fri, 24 Feb 2023 10:40:29 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4F50A40693 for ; Fri, 24 Feb 2023 10:40:25 +0100 (CET) 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 31O71t04027270 for ; Fri, 24 Feb 2023 01:40:24 -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=rDhkIMBgh+V8et+aFhW7QU9HwGUk0tE3KZpS1JC43OI=; b=lI+B9IYarTk22OHF8P4abIRb+ln/8gGAJFStagKEAJERA0mFYBMv/lpdfDw1RqiatmO1 /2IeGttyYYr+vCdRrHUda6spLwy96v1hra9zGTlj0hBXSh32v8gsISxrBq1Ti8prEuHj sMWnc2z5K3uGKnAXWkQaRulGQcHKIvgcqE4zLarDCV3rnzwK2oXnGBPgtBHUGdsXXGwe zTHyhYst6MuS+MGujYBMCju0gIOQaRKN3sRr4UIWBoa/Cr8RzRhUazppBSyxGzX09V1+ CGINZbs2UA1uxrXwiw11nYI1LKK34YLXHMHM5JxYKDwKh6mZes/1HJkZRCHceeHc8MGJ Fw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwb2ga-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 24 Feb 2023 01:40:24 -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.42; Fri, 24 Feb 2023 01:40:22 -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.42 via Frontend Transport; Fri, 24 Feb 2023 01:40:22 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 48AE65B6936; Fri, 24 Feb 2023 01:40:21 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH v2 03/11] crypto/cnxk: use version field directly Date: Fri, 24 Feb 2023 15:10:06 +0530 Message-ID: <20230224094014.3246764-4-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230224094014.3246764-1-ktejasree@marvell.com> References: <20230224094014.3246764-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: dWxmM2HJsivoPJvoP_UuUkq8JB176LaD X-Proofpoint-ORIG-GUID: dWxmM2HJsivoPJvoP_UuUkq8JB176LaD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-24_05,2023-02-23_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 From: Anoob Joseph As version field is available in rte_ip_hdr, use it directly instead of masking version_ihl. Signed-off-by: Anoob Joseph --- drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 4 ++-- drivers/crypto/cnxk/cn9k_ipsec_la_ops.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c index 3a07842e4b..11541b6ab9 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c @@ -546,10 +546,10 @@ cn9k_cpt_sec_post_process(struct rte_crypto_op *cop, } } - if (((ip->version_ihl & 0xf0) >> RTE_IPV4_IHL_MULTIPLIER) == IPVERSION) { + if (ip->version == IPVERSION) { m_len = rte_be_to_cpu_16(ip->total_length); } else { - PLT_ASSERT(((ip->version_ihl & 0xf0) >> RTE_IPV4_IHL_MULTIPLIER) == 6); + PLT_ASSERT((ip->version == 6)); ip6 = (struct rte_ipv6_hdr *)ip; m_len = rte_be_to_cpu_16(ip6->payload_len) + sizeof(struct rte_ipv6_hdr); } diff --git a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h index 9df41bf65d..85aacb803f 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h +++ b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h @@ -28,13 +28,13 @@ ipsec_po_out_rlen_get(struct cn9k_sec_session *sess, uint32_t plen, struct rte_m uintptr_t data = (uintptr_t)m_src->buf_addr + m_src->data_off; struct rte_ipv4_hdr *ip = (struct rte_ipv4_hdr *)data; - if (unlikely(((ip->version_ihl & 0xf0) >> RTE_IPV4_IHL_MULTIPLIER) != IPVERSION)) { + if (unlikely(ip->version != IPVERSION)) { struct rte_ipv6_hdr *ip6 = (struct rte_ipv6_hdr *)ip; uint8_t *nxt_hdr = (uint8_t *)ip6; uint8_t dest_op_cnt = 0; int nh = ip6->proto; - PLT_ASSERT(((ip->version_ihl & 0xf0) >> RTE_IPV4_IHL_MULTIPLIER) == 6); + PLT_ASSERT(ip->version == 6); adj_len = ROC_CPT_TUNNEL_IPV6_HDR_LEN; nxt_hdr += ROC_CPT_TUNNEL_IPV6_HDR_LEN; -- 2.25.1