[2/2] net/ice: get PF ID of VF's parent

Message ID 20210818083226.795256-2-dapengx.yu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [1/2] net/ice/base: get PF ID of VF's parent |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-unit-testing fail Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing fail Testing issues

Commit Message

Yu, DapengX Aug. 18, 2021, 8:32 a.m. UTC
  From: Dapeng Yu <dapengx.yu@intel.com>

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 <dapengx.yu@intel.com>
---
 drivers/net/ice/ice_dcf_parent.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

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) {