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 A9C5A440F0; Tue, 28 May 2024 09:06:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE66240DDD; Tue, 28 May 2024 09:06:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 39A1540DCE for ; Tue, 28 May 2024 09:05:58 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44RMxVF6001836 for ; Tue, 28 May 2024 00:05:57 -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=z Xu7CmJpgobtpV1lY+Tuui/fc6oV0QzfhrkJ/gQuZb8=; b=T3CfbjDJd+Gxv5H+a jGr0KLdmsd8hYgwkJq3uhVqdKiRL/Uslqq3ACRU2fPPk/y2xGDfBWY7ZXMRta6Dc RuNgpoFNYhCYj4vazirgssXbnjQ1aV8aL6ylbEx6FJ360Muyu/uqYBz+YSk0E8Yo Sn49dYDlReJ7ESKohQaiJHVMwwmV1EXrCRlAfMZtJd7vHMfT7Fy925eKslPuWhs0 hZ5sJzxUW1aUci7AvSIFzJ8W1sZtkW3eEXfElarU+Ep6QYIReu76P28w5t7aO8ro aE89wvLg4Ywh/5MDyl7aAQ+HUfaNOJ95GHWtLKFj9vxkIrmu/f7giLX/qaq1kWlu GSUjQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ycqpykr1p-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 28 May 2024 00:05:57 -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; Tue, 28 May 2024 00:05:55 -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; Tue, 28 May 2024 00:05:55 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 09EA73F7099; Tue, 28 May 2024 00:05:52 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: , , Srujana Challa Subject: [PATCH v2 10/10] net/cnxk: define CPT HW result format for PMD API Date: Tue, 28 May 2024 12:35:22 +0530 Message-ID: <20240528070522.3857626-10-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240528070522.3857626-1-ndabilpuram@marvell.com> References: <20240517074448.3146611-1-ndabilpuram@marvell.com> <20240528070522.3857626-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: hlHbYmLruDjpyonjNyiNrsYzZG4jBbzs X-Proofpoint-ORIG-GUID: hlHbYmLruDjpyonjNyiNrsYzZG4jBbzs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-28_04,2024-05-27_01,2024-05-17_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: Srujana Challa Defines CPT HW result format for PMD API, rte_pmd_cnxk_inl_ipsec_res(). Signed-off-by: Srujana Challa --- drivers/net/cnxk/cn10k_ethdev_sec.c | 4 +-- drivers/net/cnxk/rte_pmd_cnxk.h | 40 +++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c index eed4c29218..b8b0da5ea9 100644 --- a/drivers/net/cnxk/cn10k_ethdev_sec.c +++ b/drivers/net/cnxk/cn10k_ethdev_sec.c @@ -1251,7 +1251,7 @@ rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess, return 0; } -void * +union rte_pmd_cnxk_cpt_res_s * rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf) { const union nix_rx_parse_u *rx; @@ -1265,7 +1265,7 @@ rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf) rx = (const union nix_rx_parse_u *)(wqe + 8); desc_size = (rx->desc_sizem1 + 1) * 16; - /* cpt_res_s sits after SG list at 16B aligned address */ + /* rte_pmd_cnxk_cpt_res_s sits after SG list at 16B aligned address */ return (void *)(wqe + 64 + desc_size); } diff --git a/drivers/net/cnxk/rte_pmd_cnxk.h b/drivers/net/cnxk/rte_pmd_cnxk.h index 43f2a7ed9b..88030046db 100644 --- a/drivers/net/cnxk/rte_pmd_cnxk.h +++ b/drivers/net/cnxk/rte_pmd_cnxk.h @@ -453,6 +453,42 @@ union rte_pmd_cnxk_ipsec_hw_sa { struct rte_pmd_cnxk_ipsec_outb_sa outb; }; +/** CPT HW result format */ +union rte_pmd_cnxk_cpt_res_s { + /** CN10K CPT result */ + struct rte_pmd_cpt_cn10k_res_s { + /** Completion code */ + uint64_t compcode : 7; + /** Done interrupt */ + uint64_t doneint : 1; + /** Microcode completion code */ + uint64_t uc_compcode : 8; + /** Result length */ + uint64_t rlen : 16; + /** SPI */ + uint64_t spi : 32; + + /** Extended sequence number */ + uint64_t esn; + } cn10k; + + /** CN9K CPT result */ + struct rte_pmd_cpt_cn9k_res_s { + /** Completion code */ + uint64_t compcode : 8; + /** Microcode completion code */ + uint64_t uc_compcode : 8; + /** Done interrupt */ + uint64_t doneint : 1; + uint64_t reserved_17_63 : 47; + + uint64_t reserved_64_127; + } cn9k; + + /** CPT RES */ + uint64_t u64[2]; +}; + /** * Read HW SA context from session. * @@ -501,9 +537,9 @@ int rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess, * Pointer to packet that was just received and was processed with Inline IPsec. * * @return - * - Pointer to mbuf location where CPT result info is stored on success. + * - Pointer to mbuf location where `union rte_pmd_cnxk_cpt_res_s` is stored on success. * - NULL on failure. */ __rte_experimental -void *rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf); +union rte_pmd_cnxk_cpt_res_s *rte_pmd_cnxk_inl_ipsec_res(struct rte_mbuf *mbuf); #endif /* _PMD_CNXK_H_ */ -- 2.25.1