diff mbox series

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

Message ID 20210913024002.2868848-1-dapengx.yu@intel.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series [v4] net/ice/base: get PF ID of VF's parent | expand

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Yu, DapengX Sept. 13, 2021, 2:40 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>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
---
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(+)

Comments

Zhang, Qi Z Sept. 13, 2021, 2:46 a.m. UTC | #1
> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Monday, September 13, 2021 10:40 AM
> 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 v4] 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>
> Acked-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

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