From patchwork Thu Oct 19 10:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 132932 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B3FB431A3; Thu, 19 Oct 2023 04:38:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD7914029E; Thu, 19 Oct 2023 04:38:13 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 020F140291 for ; Thu, 19 Oct 2023 04:38:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697683092; x=1729219092; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eO0bWtTmenMUP5XfHeXf/fs7oltffBE7sK2W4FslGWc=; b=FvDBIegUpOWrrmSg1Av37G0WsM11IZR01zddfjqHFDKzmOuNjYqlcmKn 9aAGqbi9pg04rFXDhy3UnOs55z+qXBdO8Zap2im6J5A+z0qBfxtcYFCXq 2Lo76n54jOZcaLhh9hN0nzNNw8LHJ1rL9lmM77s3QuaTLiJAITQkqoQFx tXm5TTM/BacEvn5l4IDjmj1x/ux3u8Sx/spRrIzQKIbFnLBaV43dnyfCy XPlAZaxwQkSWnAWHlTdgy6V8WoNNtfVELRZOZFT7C86izPrLyN/Y0Xfmi kWCexFWC6zBxLjpNm8p4XCUiNJE5PIhWlAJXGWYDiiH3Jk3sKG1Je1AGz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="472390664" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="472390664" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 19:38:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="1004057435" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="1004057435" Received: from dpdk-beileix-icelake.sh.intel.com ([10.67.116.231]) by fmsmga006.fm.intel.com with ESMTP; 18 Oct 2023 19:38:08 -0700 From: beilei.xing@intel.com To: jingjing.wu@intel.com, yuying.zhang@intel.com Cc: dev@dpdk.org, Beilei Xing Subject: [PATCH v2] net/cpfl: update CP channel API Date: Thu, 19 Oct 2023 10:58:03 +0000 Message-Id: <20231019105803.887662-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011114016.399609-1-beilei.xing@intel.com> References: <20231011114016.399609-1-beilei.xing@intel.com> MIME-Version: 1.0 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: Beilei Xing Update the cpchnl2 function type according to the definition in MEV 1.0 release. Signed-off-by: Beilei Xing Acked-by: Jingjing Wu --- v2 change: - rename unused enum drivers/net/cpfl/cpfl_cpchnl.h | 19 ++++++++++--------- drivers/net/cpfl/cpfl_ethdev.h | 2 +- drivers/net/cpfl/cpfl_representor.c | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/net/cpfl/cpfl_cpchnl.h b/drivers/net/cpfl/cpfl_cpchnl.h index 2eefcbcc10..0c9dfcdbf1 100644 --- a/drivers/net/cpfl/cpfl_cpchnl.h +++ b/drivers/net/cpfl/cpfl_cpchnl.h @@ -22,9 +22,6 @@ enum cpchnl2_ops { #define CPCHNL2_ETH_LENGTH_OF_ADDRESS 6 -#define CPCHNL2_FUNC_TYPE_PF 0 -#define CPCHNL2_FUNC_TYPE_SRIOV 1 - /* vport statuses - must match the DB ones - see enum cp_vport_status*/ #define CPCHNL2_VPORT_STATUS_CREATED 0 #define CPCHNL2_VPORT_STATUS_ENABLED 1 @@ -136,8 +133,10 @@ CPCHNL2_CHECK_STRUCT_LEN(3792, cpchnl2_queue_groups); * @brief function types */ enum cpchnl2_func_type { - CPCHNL2_FTYPE_LAN_PF = 0, - CPCHNL2_FTYPE_LAN_VF = 1, + CPCHNL2_FTYPE_LAN_VF = 0x0, + CPCHNL2_FTYPE_LAN_RSV1 = 0x1, + CPCHNL2_FTYPE_LAN_PF = 0x2, + CPCHNL2_FTYPE_LAN_RSV2 = 0x3, CPCHNL2_FTYPE_LAN_MAX }; @@ -176,7 +175,7 @@ struct cpchnl2_vport_info { */ u16 vsi_id; u8 vport_status; /* enum cpchnl2_vport_status */ - /* 0 - LAN PF, 1 - LAN VF. Rest - reserved. Can be later expanded to other PEs */ + /* 0 - LAN VF, 2 - LAN PF. Rest - reserved. Can be later expanded to other PEs */ u8 func_type; /* Valid only if "type" above is VF, indexing is relative to PF specified above. */ u16 vf_id; @@ -216,7 +215,9 @@ struct cpchnl2_vport_info { u16 default_rx_qid; /* Default LAN RX Queue ID */ u16 vport_flags; /* see: VPORT_FLAGS */ u8 egress_port; - u8 pad_reserved[5]; + /* Host LAN APF: 0; ACC LAN APF: 4; IMC LAN APF: 5; ACC LAN CPF: 4; IMC LAN CPF: 5 */ + u8 host_id; + u8 pad_reserved[4]; }; CPCHNL2_CHECK_STRUCT_LEN(96, cpchnl2_vport_info); @@ -226,7 +227,7 @@ CPCHNL2_CHECK_STRUCT_LEN(96, cpchnl2_vport_info); /** * @brief Used for CPCHNL2_OP_GET_VPORT_LIST opcode request - * @param func_type Func type: 0 - LAN_PF, 1 - LAN_VF. Rest - reserved (see enum cpchnl2_func_type) + * @param func_type Func type: 0 - LAN_VF, 2 - LAN_PF. Rest - reserved (see enum cpchnl2_func_type) * @param pf_id Always relevant, indexing is according to LAN PE 0-15, while only 0-4 APFs and 8-12 * CPFs are valid * @param vf_id Valid only if "type" above is VF, indexing is relative to PF specified above @@ -241,7 +242,7 @@ CPCHNL2_CHECK_STRUCT_LEN(8, cpchnl2_get_vport_list_request); /** * @brief Used for CPCHNL2_OP_GET_VPORT_LIST opcode response - * @param func_type Func type: 0 - LAN_PF, 1 - LAN_VF. Rest - reserved. Can be later extended to + * @param func_type Func type: 0 - LAN_VF, 2 - LAN_PF. Rest - reserved. Can be later extended to * other PE types * @param pf_id Always relevant, indexing is according to LAN PE 0-15, while only 0-4 APFs and 8-12 * CPFs are valid diff --git a/drivers/net/cpfl/cpfl_ethdev.h b/drivers/net/cpfl/cpfl_ethdev.h index a21701a81d..7a31a376b6 100644 --- a/drivers/net/cpfl/cpfl_ethdev.h +++ b/drivers/net/cpfl/cpfl_ethdev.h @@ -295,7 +295,7 @@ cpfl_get_vsi_id(struct cpfl_itf *itf) } else if (itf->type == CPFL_ITF_TYPE_VPORT) { vport_id = ((struct cpfl_vport *)itf)->base.vport_id; - vport_identity.func_type = CPCHNL2_FUNC_TYPE_PF; + vport_identity.func_type = CPCHNL2_FTYPE_LAN_PF; /* host: CPFL_HOST0_CPF_ID, acc: CPFL_ACC_CPF_ID */ vport_identity.pf_id = CPFL_ACC_CPF_ID; vport_identity.vf_id = 0; diff --git a/drivers/net/cpfl/cpfl_representor.c b/drivers/net/cpfl/cpfl_representor.c index f9954efcb9..e2ed9eda04 100644 --- a/drivers/net/cpfl/cpfl_representor.c +++ b/drivers/net/cpfl/cpfl_representor.c @@ -347,12 +347,12 @@ cpfl_repr_link_update(struct rte_eth_dev *ethdev, if (wait_to_complete) { if (repr->repr_id.type == RTE_ETH_REPRESENTOR_PF) { /* PF */ - vi.func_type = CPCHNL2_FUNC_TYPE_PF; + vi.func_type = CPCHNL2_FTYPE_LAN_PF; vi.pf_id = cpfl_func_id_get(repr->repr_id.host_id, repr->repr_id.pf_id); vi.vf_id = 0; } else { /* VF */ - vi.func_type = CPCHNL2_FUNC_TYPE_SRIOV; + vi.func_type = CPCHNL2_FTYPE_LAN_VF; vi.pf_id = CPFL_HOST0_APF; vi.vf_id = repr->repr_id.vf_id; } @@ -454,14 +454,14 @@ cpfl_match_repr_with_vport(const struct cpfl_repr_id *repr_id, int func_id; if (repr_id->type == RTE_ETH_REPRESENTOR_PF && - info->func_type == CPFL_VPORT_LAN_PF) { + info->func_type == CPCHNL2_FTYPE_LAN_PF) { func_id = cpfl_func_id_get(repr_id->host_id, repr_id->pf_id); if (func_id < 0 || func_id != info->pf_id) return false; else return true; } else if (repr_id->type == RTE_ETH_REPRESENTOR_VF && - info->func_type == CPFL_VPORT_LAN_VF) { + info->func_type == CPCHNL2_FTYPE_LAN_VF) { if (repr_id->vf_id == info->vf_id) return true; } @@ -479,12 +479,12 @@ cpfl_repr_vport_list_query(struct cpfl_adapter_ext *adapter, if (repr_id->type == RTE_ETH_REPRESENTOR_PF) { /* PF */ - vi.func_type = CPCHNL2_FUNC_TYPE_PF; + vi.func_type = CPCHNL2_FTYPE_LAN_PF; vi.pf_id = cpfl_func_id_get(repr_id->host_id, repr_id->pf_id); vi.vf_id = 0; } else { /* VF */ - vi.func_type = CPCHNL2_FUNC_TYPE_SRIOV; + vi.func_type = CPCHNL2_FTYPE_LAN_VF; vi.pf_id = CPFL_HOST0_APF; vi.vf_id = repr_id->vf_id; } @@ -505,12 +505,12 @@ cpfl_repr_vport_info_query(struct cpfl_adapter_ext *adapter, if (repr_id->type == RTE_ETH_REPRESENTOR_PF) { /* PF */ - vi.func_type = CPCHNL2_FUNC_TYPE_PF; + vi.func_type = CPCHNL2_FTYPE_LAN_PF; vi.pf_id = cpfl_func_id_get(repr_id->host_id, repr_id->pf_id); vi.vf_id = 0; } else { /* VF */ - vi.func_type = CPCHNL2_FUNC_TYPE_SRIOV; + vi.func_type = CPCHNL2_FTYPE_LAN_VF; vi.pf_id = CPFL_HOST0_APF; vi.vf_id = repr_id->vf_id; } @@ -531,11 +531,11 @@ cpfl_repr_vport_map_update(struct cpfl_adapter_ext *adapter, vi.vport_id = vport_id; if (repr_id->type == RTE_ETH_REPRESENTOR_PF) { /* PF */ - vi.func_type = CPCHNL2_FUNC_TYPE_PF; + vi.func_type = CPCHNL2_FTYPE_LAN_VF; vi.pf_id = cpfl_func_id_get(repr_id->host_id, repr_id->pf_id); } else { /* VF */ - vi.func_type = CPCHNL2_FUNC_TYPE_SRIOV; + vi.func_type = CPCHNL2_FTYPE_LAN_VF; vi.pf_id = CPFL_HOST0_APF; vi.vf_id = repr_id->vf_id; }