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 75A59A0C45; Mon, 13 Sep 2021 04:40:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17B0C4014F; Mon, 13 Sep 2021 04:40:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 88D6840041; Mon, 13 Sep 2021 04:40:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10105"; a="221588508" X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="221588508" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2021 19:40:21 -0700 X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="551237628" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2021 19:40:19 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, haiyue.wang@intel.com, Dapeng Yu , stable@dpdk.org Date: Mon, 13 Sep 2021 10:40:02 +0800 Message-Id: <20210913024002.2868848-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210831070333.549371-1-dapengx.yu@intel.com> References: <20210831070333.549371-1-dapengx.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4] 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, if DCF is created on PF1, the PF ID is still 0, but not 1. Without the right PF ID, the ACL will not work. This patch makes VF to get its parent's physical function ID. Fixes: 0b02c9519432 ("net/ice: handle PF initialization by DCF") CC: stable@dpdk.org Signed-off-by: Dapeng Yu Acked-by: Haiyue Wang --- V2: * Simplify the code and commit message of V1 V3: * Fix V2 code defect V4: * Change code block position in switch statement --- drivers/net/ice/base/ice_switch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 9179f66c20..93cd79e8ef 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -3471,6 +3471,10 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw) ICE_AQC_GET_SW_CONF_RESP_TYPE_S); switch (res_type) { + case ICE_AQC_GET_SW_CONF_RESP_VSI: + if (hw->dcf_enabled && !is_vf) + hw->pf_id = pf_vf_num; + break; case ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT: case ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT: if (j == num_total_ports) { -- 2.27.0