DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/ice/base: get PF ID of VF's parent
@ 2021-08-18  8:32 dapengx.yu
  2021-08-18  8:32 ` [dpdk-dev] [PATCH 2/2] net/ice: " dapengx.yu
  2021-08-31  6:54 ` [dpdk-dev] [PATCH v2] net/ice/base: " dapengx.yu
  0 siblings, 2 replies; 8+ messages in thread
From: dapengx.yu @ 2021-08-18  8:32 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, Dapeng Yu

From: Dapeng Yu <dapengx.yu@intel.com>

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 <dapengx.yu@intel.com>
---
 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;
 			}
-- 
2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/ice: get PF ID of VF's parent
  2021-08-18  8:32 [dpdk-dev] [PATCH 1/2] net/ice/base: get PF ID of VF's parent dapengx.yu
@ 2021-08-18  8:32 ` dapengx.yu
  2021-08-31  6:54 ` [dpdk-dev] [PATCH v2] net/ice/base: " dapengx.yu
  1 sibling, 0 replies; 8+ messages in thread
From: dapengx.yu @ 2021-08-18  8:32 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, Dapeng Yu

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(+)

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v2] net/ice/base: get PF ID of VF's parent
  2021-08-18  8:32 [dpdk-dev] [PATCH 1/2] net/ice/base: get PF ID of VF's parent dapengx.yu
  2021-08-18  8:32 ` [dpdk-dev] [PATCH 2/2] net/ice: " dapengx.yu
@ 2021-08-31  6:54 ` dapengx.yu
  2021-08-31  7:03   ` [dpdk-dev] [PATCH v3] " dapengx.yu
  2021-08-31  7:04   ` [dpdk-dev] [PATCH v2] " Wang, Haiyue
  1 sibling, 2 replies; 8+ messages in thread
From: dapengx.yu @ 2021-08-31  6:54 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, haiyue.wang, Dapeng Yu, stable

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
---
 drivers/net/ice/base/ice_switch.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 9179f66c20..4afd1e80c1 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -3483,6 +3483,9 @@ 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;
 			default:
 				break;
 			}
-- 
2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v3] net/ice/base: get PF ID of VF's parent
  2021-08-31  6:54 ` [dpdk-dev] [PATCH v2] net/ice/base: " dapengx.yu
@ 2021-08-31  7:03   ` dapengx.yu
  2021-08-31  7:09     ` Wang, Haiyue
  2021-09-13  2:40     ` [dpdk-dev] [PATCH v4] " dapengx.yu
  2021-08-31  7:04   ` [dpdk-dev] [PATCH v2] " Wang, Haiyue
  1 sibling, 2 replies; 8+ messages in thread
From: dapengx.yu @ 2021-08-31  7:03 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, haiyue.wang, Dapeng Yu, stable

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(+)

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;
 			}
-- 
2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice/base: get PF ID of VF's parent
  2021-08-31  6:54 ` [dpdk-dev] [PATCH v2] net/ice/base: " dapengx.yu
  2021-08-31  7:03   ` [dpdk-dev] [PATCH v3] " dapengx.yu
@ 2021-08-31  7:04   ` Wang, Haiyue
  1 sibling, 0 replies; 8+ messages in thread
From: Wang, Haiyue @ 2021-08-31  7:04 UTC (permalink / raw)
  To: Yu, DapengX, Yang, Qiming, Zhang, Qi Z; +Cc: dev, stable

> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Tuesday, August 31, 2021 14:54
> 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 v2] 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
> ---
>  drivers/net/ice/base/ice_switch.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

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

> --
> 2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ice/base: get PF ID of VF's parent
  2021-08-31  7:03   ` [dpdk-dev] [PATCH v3] " dapengx.yu
@ 2021-08-31  7:09     ` Wang, Haiyue
  2021-09-13  2:40     ` [dpdk-dev] [PATCH v4] " dapengx.yu
  1 sibling, 0 replies; 8+ messages in thread
From: Wang, Haiyue @ 2021-08-31  7:09 UTC (permalink / raw)
  To: Yu, DapengX, Yang, Qiming, Zhang, Qi Z; +Cc: dev, stable

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v4] net/ice/base: get PF ID of VF's parent
  2021-08-31  7:03   ` [dpdk-dev] [PATCH v3] " dapengx.yu
  2021-08-31  7:09     ` Wang, Haiyue
@ 2021-09-13  2:40     ` dapengx.yu
  2021-09-13  2:46       ` Zhang, Qi Z
  1 sibling, 1 reply; 8+ messages in thread
From: dapengx.yu @ 2021-09-13  2:40 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, haiyue.wang, Dapeng Yu, stable

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(+)

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/ice/base: get PF ID of VF's parent
  2021-09-13  2:40     ` [dpdk-dev] [PATCH v4] " dapengx.yu
@ 2021-09-13  2:46       ` Zhang, Qi Z
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2021-09-13  2:46 UTC (permalink / raw)
  To: Yu, DapengX, Yang, Qiming; +Cc: dev, Wang, Haiyue, stable



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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-13  2:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  8:32 [dpdk-dev] [PATCH 1/2] net/ice/base: get PF ID of VF's parent dapengx.yu
2021-08-18  8:32 ` [dpdk-dev] [PATCH 2/2] net/ice: " dapengx.yu
2021-08-31  6:54 ` [dpdk-dev] [PATCH v2] net/ice/base: " dapengx.yu
2021-08-31  7:03   ` [dpdk-dev] [PATCH v3] " dapengx.yu
2021-08-31  7:09     ` Wang, Haiyue
2021-09-13  2:40     ` [dpdk-dev] [PATCH v4] " dapengx.yu
2021-09-13  2:46       ` Zhang, Qi Z
2021-08-31  7:04   ` [dpdk-dev] [PATCH v2] " Wang, Haiyue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).