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 6E7EE42CA8; Tue, 13 Jun 2023 12:21:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B945A42D5D; Tue, 13 Jun 2023 12:20:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7014642D5E for ; Tue, 13 Jun 2023 12:20:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35D567AW005545; Tue, 13 Jun 2023 03:20:45 -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=EHubSkL5GHzj55CLAOHAfEPlHtPoiUDP0djFeNpsBfc=; b=fyte9UfdD/sHcLzdEcca1p8u2XOIzG06lSUndWsbuKgVgyQR8JSPzwsgv7ykUGS2Ak7d TVPRJZhwuCQ23VsYo4iAmUzV7hTgqKoygzml6Ikb82MKRDYE5wyXcAx5HNhF2qwdZhyV NBbUkwYIm99oRJQRyWTtaS6FyZpwOIF9h5+ERmu+NYrS0+lsy/qzmMVcl3lhGArZZvT6 QAT7i14GE2HCxwTWlyfIRDN0W4FGVfFG9KzFv4yEgtkml/NhbkYyyUpV3zwD2c9JLXOs EPySfdnwndW/QdR4E2GK2o0O7hZDaQf1S89bNa2n0w2DE0iD6oz1zZOzLZbsKpKr4JeP sQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3r65023qsh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 03:20:45 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 13 Jun 2023 03:20:44 -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; Tue, 13 Jun 2023 03:20:44 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 918133F708F; Tue, 13 Jun 2023 03:20:41 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , Akhil Goyal Subject: [PATCH v4 10/15] common/cnxk: add MACsec FIPS mbox Date: Tue, 13 Jun 2023 15:50:04 +0530 Message-ID: <20230613102009.2390568-11-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230613102009.2390568-1-gakhil@marvell.com> References: <20230613071614.2259604-1-gakhil@marvell.com> <20230613102009.2390568-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Me9xWcTSpDW2veKcdixdVeoikUicZfc8 X-Proofpoint-GUID: Me9xWcTSpDW2veKcdixdVeoikUicZfc8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-13_04,2023-06-12_02,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 Added MACsec FIPS configuration mbox Signed-off-by: Ankur Dwivedi Signed-off-by: Vamsi Attunuru Signed-off-by: Akhil Goyal --- drivers/common/cnxk/roc_mbox.h | 74 ++++++++++++++++++++++++++++++++++ drivers/common/cnxk/roc_mcs.h | 69 +++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h index 446f49aeaf..2f85b2f755 100644 --- a/drivers/common/cnxk/roc_mbox.h +++ b/drivers/common/cnxk/roc_mbox.h @@ -330,6 +330,15 @@ struct mbox_msghdr { M(MCS_PORT_CFG_GET, 0xa020, mcs_port_cfg_get, mcs_port_cfg_get_req, mcs_port_cfg_get_rsp) \ M(MCS_CUSTOM_TAG_CFG_GET, 0xa021, mcs_custom_tag_cfg_get, mcs_custom_tag_cfg_get_req, \ mcs_custom_tag_cfg_get_rsp) \ + M(MCS_FIPS_RESET, 0xa040, mcs_fips_reset, mcs_fips_req, msg_rsp) \ + M(MCS_FIPS_MODE_SET, 0xa041, mcs_fips_mode_set, mcs_fips_mode_req, msg_rsp) \ + M(MCS_FIPS_CTL_SET, 0xa042, mcs_fips_ctl_set, mcs_fips_ctl_req, msg_rsp) \ + M(MCS_FIPS_IV_SET, 0xa043, mcs_fips_iv_set, mcs_fips_iv_req, msg_rsp) \ + M(MCS_FIPS_CTR_SET, 0xa044, mcs_fips_ctr_set, mcs_fips_ctr_req, msg_rsp) \ + M(MCS_FIPS_KEY_SET, 0xa045, mcs_fips_key_set, mcs_fips_key_req, msg_rsp) \ + M(MCS_FIPS_BLOCK_SET, 0xa046, mcs_fips_block_set, mcs_fips_block_req, msg_rsp) \ + M(MCS_FIPS_START, 0xa047, mcs_fips_start, mcs_fips_req, msg_rsp) \ + M(MCS_FIPS_RESULT_GET, 0xa048, mcs_fips_result_get, mcs_fips_req, mcs_fips_result_rsp) /* Messages initiated by AF (range 0xC00 - 0xDFF) */ #define MBOX_UP_CGX_MESSAGES \ @@ -1119,6 +1128,71 @@ struct mcs_clear_stats { uint8_t __io all; /* All resources stats mapped to PF are cleared */ }; +struct mcs_fips_req { + struct mbox_msghdr hdr; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_mode_req { + struct mbox_msghdr hdr; + uint64_t __io mode; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_ctl_req { + struct mbox_msghdr hdr; + uint64_t __io ctl; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_iv_req { + struct mbox_msghdr hdr; + uint32_t __io iv_bits95_64; + uint64_t __io iv_bits63_0; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_ctr_req { + struct mbox_msghdr hdr; + uint32_t __io fips_ctr; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_key_req { + struct mbox_msghdr hdr; + uint64_t __io sak_bits255_192; + uint64_t __io sak_bits191_128; + uint64_t __io sak_bits127_64; + uint64_t __io sak_bits63_0; + uint64_t __io hashkey_bits127_64; + uint64_t __io hashkey_bits63_0; + uint8_t __io sak_len; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_block_req { + struct mbox_msghdr hdr; + uint64_t __io blk_bits127_64; + uint64_t __io blk_bits63_0; + uint8_t __io mcs_id; + uint8_t __io dir; +}; + +struct mcs_fips_result_rsp { + struct mbox_msghdr hdr; + uint64_t __io blk_bits127_64; + uint64_t __io blk_bits63_0; + uint64_t __io icv_bits127_64; + uint64_t __io icv_bits63_0; + uint8_t __io result_pass; +}; + /* NPA mbox message formats */ /* NPA mailbox error codes diff --git a/drivers/common/cnxk/roc_mcs.h b/drivers/common/cnxk/roc_mcs.h index e8d6b070db..5b1423ac8f 100644 --- a/drivers/common/cnxk/roc_mcs.h +++ b/drivers/common/cnxk/roc_mcs.h @@ -426,6 +426,56 @@ struct roc_mcs_event_desc { union roc_mcs_event_data metadata; }; +struct roc_mcs_fips_req { + uint8_t dir; +}; + +struct roc_mcs_fips_mode { + uint64_t mode; + uint8_t dir; +}; + +struct roc_mcs_fips_ctl { + uint64_t ctl; + uint8_t dir; +}; + +struct roc_mcs_fips_iv { + uint32_t iv_bits95_64; + uint64_t iv_bits63_0; + uint8_t dir; +}; + +struct roc_mcs_fips_ctr { + uint32_t fips_ctr; + uint8_t dir; +}; + +struct roc_mcs_fips_key { + uint64_t sak_bits255_192; + uint64_t sak_bits191_128; + uint64_t sak_bits127_64; + uint64_t sak_bits63_0; + uint64_t hashkey_bits127_64; + uint64_t hashkey_bits63_0; + uint8_t sak_len; + uint8_t dir; +}; + +struct roc_mcs_fips_block { + uint64_t blk_bits127_64; + uint64_t blk_bits63_0; + uint8_t dir; +}; + +struct roc_mcs_fips_result_rsp { + uint64_t blk_bits127_64; + uint64_t blk_bits63_0; + uint64_t icv_bits127_64; + uint64_t icv_bits63_0; + uint8_t result_pass; +}; + /** User application callback to be registered for any notifications from driver. */ typedef int (*roc_mcs_dev_cb_fn)(void *userdata, struct roc_mcs_event_desc *desc, void *cb_arg); @@ -549,4 +599,23 @@ __roc_api int roc_mcs_intr_configure(struct roc_mcs *mcs, struct roc_mcs_intr_cf __roc_api int roc_mcs_port_recovery(struct roc_mcs *mcs, union roc_mcs_event_data *mdata, uint8_t port_id); +/* FIPS reset */ +__roc_api int roc_mcs_fips_reset(struct roc_mcs *mcs, struct roc_mcs_fips_req *req); +/* FIPS mode set */ +__roc_api int roc_mcs_fips_mode_set(struct roc_mcs *mcs, struct roc_mcs_fips_mode *req); +/* FIPS ctl set */ +__roc_api int roc_mcs_fips_ctl_set(struct roc_mcs *mcs, struct roc_mcs_fips_ctl *req); +/* FIPS iv set */ +__roc_api int roc_mcs_fips_iv_set(struct roc_mcs *mcs, struct roc_mcs_fips_iv *req); +/* FIPS ctr set */ +__roc_api int roc_mcs_fips_ctr_set(struct roc_mcs *mcs, struct roc_mcs_fips_ctr *req); +/* FIPS key set */ +__roc_api int roc_mcs_fips_key_set(struct roc_mcs *mcs, struct roc_mcs_fips_key *req); +/* FIPS block set */ +__roc_api int roc_mcs_fips_block_set(struct roc_mcs *mcs, struct roc_mcs_fips_block *req); +/* FIPS start */ +__roc_api int roc_mcs_fips_start(struct roc_mcs *mcs, struct roc_mcs_fips_req *req); +/* FIPS result */ +__roc_api int roc_mcs_fips_result_get(struct roc_mcs *mcs, struct roc_mcs_fips_req *req, + struct roc_mcs_fips_result_rsp *rsp); #endif /* _ROC_MCS_H_ */ -- 2.25.1