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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
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/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues

Commit Message

Yu, DapengX Aug. 31, 2021, 7:03 a.m. UTC
  From: Dapeng Yu <dapengx.yu@intel.com>

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 <dapengx.yu@intel.com>
---
V2:
* Simplify the code and commit message of V1
V3:
* Fix V2 code defect
---
 drivers/net/ice/base/ice_switch.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Wang, Haiyue Aug. 31, 2021, 7:09 a.m. UTC | #1
> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Tuesday, August 31, 2021 15:04
> To: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; Yu, DapengX <dapengx.yu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v3] net/ice/base: get PF ID of VF's parent
> 
> From: Dapeng Yu <dapengx.yu@intel.com>
> 
> 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 <dapengx.yu@intel.com>
> ---
> V2:
> * Simplify the code and commit message of V1
> V3:
> * Fix V2 code defect
> ---
>  drivers/net/ice/base/ice_switch.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> --
> 2.27.0
  

Patch

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 9179f66c20..ac5c09945f 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -3483,6 +3483,10 @@  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:
+				if (hw->dcf_enabled && !is_vf)
+					hw->pf_id = pf_vf_num;
+				break;
 			default:
 				break;
 			}