From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 129CFA04C1; Wed, 20 Nov 2019 04:48:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B06491BE89; Wed, 20 Nov 2019 04:48:23 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 0597D1BC25 for ; Wed, 20 Nov 2019 04:48:21 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAK3jAq2022863 for ; Tue, 19 Nov 2019 19:48: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=pfpt0818; bh=4sT1HqJ49o3ZHlEJmQsVIiuRDUGIv7Emsi7nkQac+jY=; b=GwpdqOCCaa2WxWOCcmWHkqqI9Rj8feKOZX3S5xzlGuzuUOIf2QkGIjSn/+DTXAjqK0D/ /6c0cvLTOI90zwPNCYKrJtlqcW7nBZiE7SCP6XQlQ6jIO5RWJzm2SkhxFCAvixBsUTno KGTj/PtlF8u2h40hx/avKnzem0huTfwo74X6FGCUA+ciWOmcVS0ZKq2nnRxCShDrEWro 8qlS50Fwv7xJ0FfKDkR0c9ZJ0ZO7YgMFc7nGFPKNGby9De6XFrh0NBapyK1UY8Khav5z 2Us9ajrUwqcHJNtwjNHrs8ngvqJzLolCnD0nu2joQMJ0CV9Y9ZYs/Z3gt6vN6HERn/z+ EA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2wc82vnp33-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 19 Nov 2019 19:48:21 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 19 Nov 2019 19:48:19 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 19 Nov 2019 19:48:19 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.72]) by maili.marvell.com (Postfix) with ESMTP id 03AB53F703F; Tue, 19 Nov 2019 19:48:17 -0800 (PST) From: To: CC: , Pavan Nikhilesh Date: Wed, 20 Nov 2019 09:18:04 +0530 Message-ID: <20191120034808.2760-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191120034808.2760-1-pbhagavatula@marvell.com> References: <20191120034808.2760-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-19_08:2019-11-15,2019-11-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/6] net/octeontx: cleanup redudant mbox structs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Cleanup redudant mail box structures. Signed-off-by: Pavan Nikhilesh --- drivers/net/octeontx/base/octeontx_pkivf.c | 25 +-- drivers/net/octeontx/base/octeontx_pkivf.h | 242 +++------------------ 2 files changed, 43 insertions(+), 224 deletions(-) diff --git a/drivers/net/octeontx/base/octeontx_pkivf.c b/drivers/net/octeontx/base/octeontx_pkivf.c index 783b2a2e5..8ce041955 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.c +++ b/drivers/net/octeontx/base/octeontx_pkivf.c @@ -30,9 +30,7 @@ octeontx_pki_port_open(int port) { uint16_t global_domain = octeontx_get_global_domain(); struct octeontx_mbox_hdr hdr; - mbox_pki_port_t port_type = { - .port_type = OCTTX_PORT_TYPE_NET, - }; + pki_port_type_t port_type; int i, res; /* Check if atleast one PKI vf is in application domain. */ @@ -45,11 +43,12 @@ octeontx_pki_port_open(int port) if (i == PKI_VF_MAX) return -ENODEV; + port_type.port_type = OCTTX_PORT_TYPE_NET; hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_OPEN; hdr.vfid = port; - res = octeontx_mbox_send(&hdr, &port_type, sizeof(mbox_pki_port_t), + res = octeontx_mbox_send(&hdr, &port_type, sizeof(pki_port_type_t), NULL, 0); if (res < 0) return -EACCES; @@ -62,8 +61,8 @@ octeontx_pki_port_hash_config(int port, pki_hash_cfg_t *hash_cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_hash_cfg_t h_cfg = *(mbox_pki_hash_cfg_t *)hash_cfg; - int len = sizeof(mbox_pki_hash_cfg_t); + pki_hash_cfg_t h_cfg = *(pki_hash_cfg_t *)hash_cfg; + int len = sizeof(pki_hash_cfg_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_HASH_CONFIG; @@ -82,8 +81,8 @@ octeontx_pki_port_pktbuf_config(int port, pki_pktbuf_cfg_t *buf_cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_pktbuf_cfg_t b_cfg = *(mbox_pki_pktbuf_cfg_t *)buf_cfg; - int len = sizeof(mbox_pki_pktbuf_cfg_t); + pki_pktbuf_cfg_t b_cfg = *(pki_pktbuf_cfg_t *)buf_cfg; + int len = sizeof(pki_pktbuf_cfg_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_PKTBUF_CONFIG; @@ -101,8 +100,8 @@ octeontx_pki_port_create_qos(int port, pki_qos_cfg_t *qos_cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_qos_cfg_t q_cfg = *(mbox_pki_qos_cfg_t *)qos_cfg; - int len = sizeof(mbox_pki_qos_cfg_t); + pki_qos_cfg_t q_cfg = *(pki_qos_cfg_t *)qos_cfg; + int len = sizeof(pki_qos_cfg_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_CREATE_QOS; @@ -122,9 +121,9 @@ octeontx_pki_port_errchk_config(int port, pki_errchk_cfg_t *cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_errcheck_cfg_t e_cfg; - e_cfg = *((mbox_pki_errcheck_cfg_t *)(cfg)); - int len = sizeof(mbox_pki_errcheck_cfg_t); + pki_errchk_cfg_t e_cfg; + e_cfg = *((pki_errchk_cfg_t *)(cfg)); + int len = sizeof(pki_errchk_cfg_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_ERRCHK_CONFIG; diff --git a/drivers/net/octeontx/base/octeontx_pkivf.h b/drivers/net/octeontx/base/octeontx_pkivf.h index c2a944404..d541dc3bd 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.h +++ b/drivers/net/octeontx/base/octeontx_pkivf.h @@ -39,15 +39,6 @@ #define MBOX_PKI_MAX_QOS_ENTRY 64 -/* pki pkind parse mode */ -enum { - MBOX_PKI_PARSE_LA_TO_LG = 0, - MBOX_PKI_PARSE_LB_TO_LG = 1, - MBOX_PKI_PARSE_LC_TO_LG = 3, - MBOX_PKI_PARSE_LG = 0x3f, - MBOX_PKI_PARSE_NOTHING = 0x7f -}; - /* PKI maximum constants */ #define PKI_VF_MAX (32) #define PKI_MAX_PKTLEN (32768) @@ -60,189 +51,37 @@ enum { OCTTX_PORT_TYPE_MAX }; -/* pki port config */ -typedef struct mbox_pki_port_type { - uint8_t port_type; -} mbox_pki_port_t; - -/* pki port config */ -typedef struct mbox_pki_port_cfg { - uint8_t port_type; - struct { - uint8_t fcs_pres:1; - uint8_t fcs_skip:1; - uint8_t inst_skip:1; - uint8_t parse_mode:1; - uint8_t mpls_parse:1; - uint8_t inst_hdr_parse:1; - uint8_t fulc_parse:1; - uint8_t dsa_parse:1; - uint8_t hg2_parse:1; - uint8_t hg_parse:1; - } mmask; - uint8_t fcs_pres; - uint8_t fcs_skip; - uint8_t inst_skip; - uint8_t parse_mode; - uint8_t mpls_parse; - uint8_t inst_hdr_parse; - uint8_t fulc_parse; - uint8_t dsa_parse; - uint8_t hg2_parse; - uint8_t hg_parse; -} mbox_pki_prt_cfg_t; - -/* pki Flow/style packet buffer config */ -typedef struct mbox_pki_port_pktbuf_cfg { - uint8_t port_type; - struct { - uint16_t f_mbuff_size:1; - uint16_t f_wqe_skip:1; - uint16_t f_first_skip:1; - uint16_t f_later_skip:1; - uint16_t f_pkt_outside_wqe:1; - uint16_t f_wqe_endian:1; - uint16_t f_cache_mode:1; - } mmask; - uint16_t mbuff_size; - uint16_t wqe_skip; - uint16_t first_skip; - uint16_t later_skip; - uint8_t pkt_outside_wqe; - uint8_t wqe_endian; - uint8_t cache_mode; -} mbox_pki_pktbuf_cfg_t; - -/* pki flow/style tag config */ -typedef struct mbox_pki_port_hash_cfg { - uint8_t port_type; - uint32_t tag_slf:1; - uint32_t tag_sle:1; - uint32_t tag_sld:1; - uint32_t tag_slc:1; - uint32_t tag_dlf:1; - uint32_t tag_dle:1; - uint32_t tag_dld:1; - uint32_t tag_dlc:1; - uint32_t tag_prt:1; - uint32_t tag_vlan0:1; - uint32_t tag_vlan1:1; - uint32_t tag_ip_pctl:1; - uint32_t tag_sync:1; - uint32_t tag_spi:1; - uint32_t tag_gtp:1; - uint32_t tag_vni:1; -} mbox_pki_hash_cfg_t; - -/* pki flow/style errcheck config */ -typedef struct mbox_pki_port_errcheck_cfg { - uint8_t port_type; - struct { - uint32_t f_ip6_udp_opt:1; - uint32_t f_lenerr_en:1; - uint32_t f_maxerr_en:1; - uint32_t f_minerr_en:1; - uint32_t f_fcs_chk:1; - uint32_t f_fcs_strip:1; - uint32_t f_len_lf:1; - uint32_t f_len_le:1; - uint32_t f_len_ld:1; - uint32_t f_len_lc:1; - uint32_t f_csum_lf:1; - uint32_t f_csum_le:1; - uint32_t f_csum_ld:1; - uint32_t f_csum_lc:1; - uint32_t f_min_frame_len; - uint32_t f_max_frame_len; - } mmask; - uint64_t ip6_udp_opt:1; - uint64_t lenerr_en:1; - uint64_t maxerr_en:1; - uint64_t minerr_en:1; - uint64_t fcs_chk:1; - uint64_t fcs_strip:1; - uint64_t len_lf:1; - uint64_t len_le:1; - uint64_t len_ld:1; - uint64_t len_lc:1; - uint64_t csum_lf:1; - uint64_t csum_le:1; - uint64_t csum_ld:1; - uint64_t csum_lc:1; - uint64_t min_frame_len; - uint64_t max_frame_len; -} mbox_pki_errcheck_cfg_t; +/* pki pkind parse mode */ +enum { + PKI_PARSE_LA_TO_LG = 0, + PKI_PARSE_LB_TO_LG = 1, + PKI_PARSE_LC_TO_LG = 3, + PKI_PARSE_LG = 0x3f, + PKI_PARSE_NOTHING = 0x7f +}; /* CACHE MODE*/ enum { - MBOX_PKI_OPC_MODE_STT = 0LL, - MBOX_PKI_OPC_MODE_STF = 1LL, - MBOX_PKI_OPC_MODE_STF1_STT = 2LL, - MBOX_PKI_OPC_MODE_STF2_STT = 3LL + PKI_OPC_MODE_STT = 0LL, + PKI_OPC_MODE_STF = 1LL, + PKI_OPC_MODE_STF1_STT = 2LL, + PKI_OPC_MODE_STF2_STT = 3LL }; /* PKI QPG QOS*/ enum { - MBOX_PKI_QPG_QOS_NONE = 0, - MBOX_PKI_QPG_QOS_VLAN, - MBOX_PKI_QPG_QOS_MPLS, - MBOX_PKI_QPG_QOS_DSA_SRC, - MBOX_PKI_QPG_QOS_DIFFSERV, - MBOX_PKI_QPG_QOS_HIGIG, -}; - -struct mbox_pki_qos_entry { - uint16_t port_add; - uint16_t ggrp_ok; - uint16_t ggrp_bad; - uint16_t gaura; - uint8_t grptag_ok; - uint8_t grptag_bad; - uint8_t ena_red; - uint8_t ena_drop; - uint8_t tag_type; + PKI_QPG_QOS_NONE = 0, + PKI_QPG_QOS_VLAN, + PKI_QPG_QOS_MPLS, + PKI_QPG_QOS_DSA_SRC, + PKI_QPG_QOS_DIFFSERV, + PKI_QPG_QOS_HIGIG, }; -/* pki flow/style enable qos */ -typedef struct mbox_pki_port_create_qos { - uint8_t port_type; - uint8_t qpg_qos; - uint8_t num_entry; - uint8_t tag_type; - uint8_t drop_policy; - struct mbox_pki_qos_entry qos_entry[MBOX_PKI_MAX_QOS_ENTRY]; -} mbox_pki_qos_cfg_t; - -/* pki flow/style modify qos */ -typedef struct mbox_pki_port_modify_qos_entry { - uint8_t port_type; - uint16_t index; - struct { - uint8_t f_port_add:1; - uint8_t f_grp_ok:1; - uint8_t f_grp_bad:1; - uint8_t f_gaura:1; - uint8_t f_grptag_ok:1; - uint8_t f_grptag_bad:1; - uint8_t f_tag_type:1; - } mmask; - struct mbox_pki_qos_entry qos_entry; -} mbox_pki_mod_qos_t; - -/* pki flow/style delete qos */ -typedef struct mbox_pki_port_delete_qos_entry { +/* pki port config */ +typedef struct pki_port_type { uint8_t port_type; - uint16_t index; -} mbox_pki_del_qos_t; - -/* pki pkind parse mode */ -enum { - PKI_PARSE_LA_TO_LG = 0, - PKI_PARSE_LB_TO_LG = 1, - PKI_PARSE_LC_TO_LG = 3, - PKI_PARSE_LG = 0x3f, - PKI_PARSE_NOTHING = 0x7f -}; +} pki_port_type_t; /* pki port config */ typedef struct pki_port_cfg { @@ -351,25 +190,6 @@ typedef struct pki_port_errcheck_cfg { uint64_t max_frame_len; } pki_errchk_cfg_t; - -/* CACHE MODE*/ -enum { - PKI_OPC_MODE_STT = 0LL, - PKI_OPC_MODE_STF = 1LL, - PKI_OPC_MODE_STF1_STT = 2LL, - PKI_OPC_MODE_STF2_STT = 3LL -}; - -/* PKI QPG QOS*/ -enum { - PKI_QPG_QOS_NONE = 0, - PKI_QPG_QOS_VLAN, - PKI_QPG_QOS_MPLS, - PKI_QPG_QOS_DSA_SRC, - PKI_QPG_QOS_DIFFSERV, - PKI_QPG_QOS_HIGIG, -}; - struct pki_qos_entry { uint16_t port_add; uint16_t ggrp_ok; @@ -422,8 +242,8 @@ octeontx_pki_port_modify_qos(int port, pki_mod_qos_t *qos_cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_mod_qos_t q_cfg = *(mbox_pki_mod_qos_t *)qos_cfg; - int len = sizeof(mbox_pki_mod_qos_t); + pki_mod_qos_t q_cfg = *(pki_mod_qos_t *)qos_cfg; + int len = sizeof(pki_mod_qos_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_MODIFY_QOS; @@ -442,8 +262,8 @@ octeontx_pki_port_delete_qos(int port, pki_del_qos_t *qos_cfg) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_del_qos_t q_cfg = *(mbox_pki_del_qos_t *)qos_cfg; - int len = sizeof(mbox_pki_del_qos_t); + pki_del_qos_t q_cfg = *(pki_del_qos_t *)qos_cfg; + int len = sizeof(pki_del_qos_t); hdr.coproc = OCTEONTX_PKI_COPROC; hdr.msg = MBOX_PKI_PORT_DELETE_QOS; @@ -462,8 +282,8 @@ octeontx_pki_port_close(int port) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_port_t ptype; - int len = sizeof(mbox_pki_port_t); + pki_port_type_t ptype; + int len = sizeof(pki_port_type_t); memset(&ptype, 0, len); ptype.port_type = OCTTX_PORT_TYPE_NET; @@ -484,8 +304,8 @@ octeontx_pki_port_start(int port) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_port_t ptype; - int len = sizeof(mbox_pki_port_t); + pki_port_type_t ptype; + int len = sizeof(pki_port_type_t); memset(&ptype, 0, len); ptype.port_type = OCTTX_PORT_TYPE_NET; @@ -506,8 +326,8 @@ octeontx_pki_port_stop(int port) struct octeontx_mbox_hdr hdr; int res; - mbox_pki_port_t ptype; - int len = sizeof(mbox_pki_port_t); + pki_port_type_t ptype; + int len = sizeof(pki_port_type_t); memset(&ptype, 0, len); ptype.port_type = OCTTX_PORT_TYPE_NET; -- 2.17.1