From patchwork Wed Oct 11 11:40:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 132491 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 2413C42359; Wed, 11 Oct 2023 05:20:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 005774028A; Wed, 11 Oct 2023 05:20:07 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C6238400EF for ; Wed, 11 Oct 2023 05:20:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696994407; x=1728530407; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/d0fBl+8MOMHs3v5PU0cVFzpkhWTHoTNm1AWznlOpxk=; b=P5mz6NC3b4xURH5FD+HNdIsK0MtKOlHK2bzuyyu34qL0yow74SCx8Md1 JZatU57lOA1TYJdbMIPi++8eeJDQbZey3hUYr4vcb3U2/rWK8cw0Xl7Im rhUsriBXRlN9MO1WbddCTFUV6NLS6ygYwjRzMpUB9YvyxgD2lOahRfnKt pY8pIqMocrNKB8lbHBE86HdwEADTBTZsqdGxEn+WaTu1zTecfY1/3910y YdCVcKEt8RyUoY7k1/DSOVZdTs3YX/rNf8h3XZcaO0JI/0FlRrlqMPPkM 0v8JUA4r6zNri6/b2G/lUH/oVJec32ttycVNPEsasySaQ2b36VxOkvgaR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="364852237" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="364852237" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 20:20:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="703569893" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="703569893" Received: from dpdk-beileix-icelake.sh.intel.com ([10.67.116.231]) by orsmga003.jf.intel.com with ESMTP; 10 Oct 2023 20:20:03 -0700 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, Beilei Xing Subject: [PATCH] net/cpfl: update CP channel API Date: Wed, 11 Oct 2023 11:40:16 +0000 Message-Id: <20231011114016.399609-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.34.1 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 --- 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..667fadcac4 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_VM = 0x1, + CPCHNL2_FTYPE_LAN_PF = 0x2, + CPCHNL2_FTYPE_LAN_IMC_BMC = 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 efb0eb5251..bb53fca7c0 100644 --- a/drivers/net/cpfl/cpfl_ethdev.h +++ b/drivers/net/cpfl/cpfl_ethdev.h @@ -296,7 +296,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 de3b426727..cb253f7af4 100644 --- a/drivers/net/cpfl/cpfl_representor.c +++ b/drivers/net/cpfl/cpfl_representor.c @@ -348,12 +348,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; } @@ -455,14 +455,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; } @@ -480,12 +480,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; } @@ -506,12 +506,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; } @@ -532,11 +532,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; }