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 418C3A0C5A; Mon, 29 Nov 2021 20:49:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0132F4115B; Mon, 29 Nov 2021 20:49:26 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 8F99B41157 for ; Mon, 29 Nov 2021 20:49:22 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1ATG7Ns3025977 for ; Mon, 29 Nov 2021 11:49:21 -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=VouFOIOnMJr0IZOl3dDDtI4k1VPgW7PI6KFDpxb+dTQ=; b=UNEKhGiKUo1b37Dr/5WdVkLkm/uso736qq+LQoqkhjt/JpHILwtD0PihqHn5F20bRdtG niLVG5t2WxuTzkGK1nIKqpXQbFgoC8TwUUa9g4g3NJgHgfyz838V5KYDHF33i+S0Ix8t fb57qBedvcmRp5sUwJjgiOSSsuzvQmNl8hdEu7CB/IUSVZPxPTVZc2e1WCd3gxoi46vC CzWqSm6eEHgRWiRoZTxk4gaSvgtZueojLwSjRh9ASQPExayhqQLMYkZQshnguOM8EDxz A7herN0ZE7MiVNqShlmZexj/Tqo1TEOYM2MFympXfQ+kg4/hPDws4RMsGK2Sjmog8y8D 9g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cn23ws2au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 29 Nov 2021 11:49:21 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 29 Nov 2021 11:49:19 -0800 Received: from pt-lxl0023.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 29 Nov 2021 11:49:18 -0800 From: To: CC: , Liron Himi Subject: [PATCH v3 2/5] common/cnxk: add REE mbox definitions Date: Mon, 29 Nov 2021 21:49:09 +0200 Message-ID: <20211129194912.14584-3-lironh@marvell.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20211129194912.14584-1-lironh@marvell.com> References: <20211123191348.31239-1-lironh@marvell.com> <20211129194912.14584-1-lironh@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 3b4xN6D_Yl_BmZsQkVAyufnYLlg4dRxe X-Proofpoint-GUID: 3b4xN6D_Yl_BmZsQkVAyufnYLlg4dRxe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-29_11,2021-11-28_01,2020-04-07_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: Liron Himi add REE mbox definitions Signed-off-by: Liron Himi --- drivers/common/cnxk/roc_mbox.h | 100 +++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h index b63fe108c9..e97d93e261 100644 --- a/drivers/common/cnxk/roc_mbox.h +++ b/drivers/common/cnxk/roc_mbox.h @@ -151,6 +151,16 @@ struct mbox_msghdr { M(CPT_GET_CAPS, 0xBFD, cpt_caps_get, msg_req, cpt_caps_rsp_msg) \ M(CPT_GET_ENG_GRP, 0xBFF, cpt_eng_grp_get, cpt_eng_grp_req, \ cpt_eng_grp_rsp) \ + /* REE mbox IDs (range 0xE00 - 0xFFF) */ \ + M(REE_CONFIG_LF, 0xE01, ree_config_lf, ree_lf_req_msg, msg_rsp) \ + M(REE_RD_WR_REGISTER, 0xE02, ree_rd_wr_register, ree_rd_wr_reg_msg, \ + ree_rd_wr_reg_msg) \ + M(REE_RULE_DB_PROG, 0xE03, ree_rule_db_prog, ree_rule_db_prog_req_msg, \ + msg_rsp) \ + M(REE_RULE_DB_LEN_GET, 0xE04, ree_rule_db_len_get, ree_req_msg, \ + ree_rule_db_len_rsp_msg) \ + M(REE_RULE_DB_GET, 0xE05, ree_rule_db_get, ree_rule_db_get_req_msg, \ + ree_rule_db_get_rsp_msg) \ /* SDP mbox IDs (range 0x1000 - 0x11FF) */ \ M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, \ msg_rsp) \ @@ -1452,6 +1462,96 @@ struct cpt_eng_grp_rsp { uint8_t __io eng_grp_num; }; +/* REE mailbox error codes + * Range 1001 - 1100. + */ +enum ree_af_status { + REE_AF_ERR_RULE_UNKNOWN_VALUE = -1001, + REE_AF_ERR_LF_NO_MORE_RESOURCES = -1002, + REE_AF_ERR_LF_INVALID = -1003, + REE_AF_ERR_ACCESS_DENIED = -1004, + REE_AF_ERR_RULE_DB_PARTIAL = -1005, + REE_AF_ERR_RULE_DB_EQ_BAD_VALUE = -1006, + REE_AF_ERR_RULE_DB_BLOCK_ALLOC_FAILED = -1007, + REE_AF_ERR_BLOCK_NOT_IMPLEMENTED = -1008, + REE_AF_ERR_RULE_DB_INC_OFFSET_TOO_BIG = -1009, + REE_AF_ERR_RULE_DB_OFFSET_TOO_BIG = -1010, + REE_AF_ERR_Q_IS_GRACEFUL_DIS = -1011, + REE_AF_ERR_Q_NOT_GRACEFUL_DIS = -1012, + REE_AF_ERR_RULE_DB_ALLOC_FAILED = -1013, + REE_AF_ERR_RULE_DB_TOO_BIG = -1014, + REE_AF_ERR_RULE_DB_GEQ_BAD_VALUE = -1015, + REE_AF_ERR_RULE_DB_LEQ_BAD_VALUE = -1016, + REE_AF_ERR_RULE_DB_WRONG_LENGTH = -1017, + REE_AF_ERR_RULE_DB_WRONG_OFFSET = -1018, + REE_AF_ERR_RULE_DB_BLOCK_TOO_BIG = -1019, + REE_AF_ERR_RULE_DB_SHOULD_FILL_REQUEST = -1020, + REE_AF_ERR_RULE_DBI_ALLOC_FAILED = -1021, + REE_AF_ERR_LF_WRONG_PRIORITY = -1022, + REE_AF_ERR_LF_SIZE_TOO_BIG = -1023, +}; + +/* REE mbox message formats */ + +struct ree_req_msg { + struct mbox_msghdr hdr; + uint32_t __io blkaddr; +}; + +struct ree_lf_req_msg { + struct mbox_msghdr hdr; + uint32_t __io blkaddr; + uint32_t __io size; + uint8_t __io lf; + uint8_t __io pri; +}; + +struct ree_rule_db_prog_req_msg { + struct mbox_msghdr hdr; +#define REE_RULE_DB_REQ_BLOCK_SIZE ((64ULL * 1024ULL) >> 1) + uint8_t __io rule_db[REE_RULE_DB_REQ_BLOCK_SIZE]; + uint32_t __io blkaddr; /* REE0 or REE1 */ + uint32_t __io total_len; /* total len of rule db */ + uint32_t __io offset; /* offset of current rule db block */ + uint16_t __io len; /* length of rule db block */ + uint8_t __io is_last; /* is this the last block */ + uint8_t __io is_incremental; /* is incremental flow */ + uint8_t __io is_dbi; /* is rule db incremental */ +}; + +struct ree_rule_db_get_req_msg { + struct mbox_msghdr hdr; + uint32_t __io blkaddr; + uint32_t __io offset; /* retrieve db from this offset */ + uint8_t __io is_dbi; /* is request for rule db incremental */ +}; + +struct ree_rd_wr_reg_msg { + struct mbox_msghdr hdr; + uint64_t __io reg_offset; + uint64_t __io *ret_val; + uint64_t __io val; + uint32_t __io blkaddr; + uint8_t __io is_write; +}; + +struct ree_rule_db_len_rsp_msg { + struct mbox_msghdr hdr; + uint32_t __io blkaddr; + uint32_t __io len; + uint32_t __io inc_len; +}; + +struct ree_rule_db_get_rsp_msg { + struct mbox_msghdr hdr; +#define REE_RULE_DB_RSP_BLOCK_SIZE (15ULL * 1024ULL) + uint8_t __io rule_db[REE_RULE_DB_RSP_BLOCK_SIZE]; + uint32_t __io total_len; /* total len of rule db */ + uint32_t __io offset; /* offset of current rule db block */ + uint16_t __io len; /* length of rule db block */ + uint8_t __io is_last; /* is this the last block */ +}; + /* NPC mbox message structs */ #define NPC_MCAM_ENTRY_INVALID 0xFFFF -- 2.28.0