From patchwork Wed Aug 18 08:32:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yu, DapengX" X-Patchwork-Id: 97034 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 56408A0C46; Wed, 18 Aug 2021 10:32:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC7004069E; Wed, 18 Aug 2021 10:32:53 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 7D06740042 for ; Wed, 18 Aug 2021 10:32:52 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10079"; a="301863039" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="301863039" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 01:32:51 -0700 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="520865690" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 01:32:49 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, Dapeng Yu Date: Wed, 18 Aug 2021 16:32:25 +0800 Message-Id: <20210818083226.795256-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/2] net/ice/base: get PF ID of VF's parent 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 Sender: "dev" From: Dapeng Yu In original implementation, when one or more VFs are created, and VF0 is used as DCF, there is no way to get the physical function ID of their parent adapter via VF0. The physical function ID is critical for initializing ACL feature, if wrong physical function ID is used, the ACL cannot be initialized successfully, and the ACL rule cannot take effect. This patch makes VF able to get its parent's physical function ID. Signed-off-by: Dapeng Yu --- drivers/net/ice/base/ice_switch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 5926635088..a1caa9c45d 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -3413,6 +3413,10 @@ ice_init_port_info(struct ice_port_info *pi, u16 vsi_port_num, u8 type, pi->dflt_tx_vsi_num = ICE_DFLT_VSI_INVAL; pi->dflt_rx_vsi_num = ICE_DFLT_VSI_INVAL; break; + case ICE_AQC_GET_SW_CONF_RESP_VSI: + pi->is_vf = is_vf; + pi->pf_vf_num = pf_vf_num; + break; default: ice_debug(pi->hw, ICE_DBG_SW, "incorrect VSI/port type received\n"); break; @@ -3487,6 +3491,14 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw) pf_vf_num, is_vf); j++; break; + case ICE_AQC_GET_SW_CONF_RESP_VSI: + /* get PF ID of VF's parent */ + if (!is_vf) + ice_init_port_info(hw->port_info, + vsi_port_num, + res_type, swid, + pf_vf_num, is_vf); + break; default: break; } From patchwork Wed Aug 18 08:32:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yu, DapengX" X-Patchwork-Id: 97035 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 F38B6A0C46; Wed, 18 Aug 2021 10:32:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E19AF411C4; Wed, 18 Aug 2021 10:32:59 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2EE48411C3 for ; Wed, 18 Aug 2021 10:32:58 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10079"; a="277306608" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="277306608" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 01:32:56 -0700 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="520865709" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 01:32:54 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, Dapeng Yu Date: Wed, 18 Aug 2021 16:32:26 +0800 Message-Id: <20210818083226.795256-2-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210818083226.795256-1-dapengx.yu@intel.com> References: <20210818083226.795256-1-dapengx.yu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/2] net/ice: get PF ID of VF's parent 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 Sender: "dev" From: Dapeng Yu In original implementation, when DCF is initialized, the physical function ID of its parent adapter is not set correctly. Its initial value is always zero, even if DCF is created on 1# physical function and, further, causes ACL to initialize wrongly. Finally, the ACL flow rule cannot take effect if it is created via VF0 of physical function 1#. This patch makes VF able to get its parent's physical function ID. Signed-off-by: Dapeng Yu --- drivers/net/ice/ice_dcf_parent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c index f461318f96..9a32fde59a 100644 --- a/drivers/net/ice/ice_dcf_parent.c +++ b/drivers/net/ice/ice_dcf_parent.c @@ -317,6 +317,9 @@ ice_dcf_init_parent_hw(struct ice_hw *hw) if (status) goto err_unroll_alloc; + if (!hw->port_info->is_vf) + hw->pf_id = hw->port_info->pf_vf_num; + pcaps = (struct ice_aqc_get_phy_caps_data *) ice_malloc(hw, sizeof(*pcaps)); if (!pcaps) {