Skip to contentSkip to conversation

net/ice: fix flow redirector issue

PATCH Applied Beilei Xing 5 participants 6 messages Apr 22, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix flow redirector issue

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")
---
 drivers/net/ice/ice_dcf.c        | 2 +-
 drivers/net/ice/ice_dcf_parent.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -1
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 48 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, April 22, 2020 20:23
To: [email protected]; Wang, Haiyue <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH] net/ice: fix flow redirector issue

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")
---
 drivers/net/ice/ice_dcf.c        | 2 +-
 drivers/net/ice/ice_dcf_parent.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -2
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
--
Quoted 1 line

2.7.4

Applied
#2 lore raw
In reply to Beilei Xing
Quoted 44 lines · Beilei Xing

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")

---
drivers/net/ice/ice_dcf.c | 2 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -1
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
Signature · 1 line
2.7.4

Applied to dpdk-next-net-intel, Thanks.

#3 lore raw
Quoted 10 lines · Ye Xiaolong
Quoted 9 lines · Beilei Xing

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")

I think these commit-id's will need some fix up before reaching master

Quoted 38 lines
Quoted 35 lines

---
drivers/net/ice/ice_dcf.c | 2 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -1
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
Signature · 1 line
2.7.4

Applied to dpdk-next-net-intel, Thanks.

#4 lore raw
Quoted 8 lines · Kevin Traynor
Quoted 7 lines · Ye Xiaolong
Quoted 6 lines · Beilei Xing

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")

I think these commit-id's will need some fix up before reaching master

We are aware of it, but these fixes are in the next-net and next-net keeps rebasing on the main repo, so commit ids keeps changes there. These should be fixed while next-net merged to main repo.
I tend to squash fixes in this case whenever reasonable, but not always. Frequently pulling from next-net to main solves this issue too.

Quoted 40 lines
Quoted 39 lines
Quoted 36 lines

---
drivers/net/ice/ice_dcf.c | 2 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -1
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
Signature · 1 line
2.7.4

Applied to dpdk-next-net-intel, Thanks.

#5 lore raw
Quoted 13 lines · Ferruh Yigit
Quoted 12 lines · Kevin Traynor
Quoted 10 lines · Ye Xiaolong
Quoted 9 lines · Beilei Xing

If there's VF reset, the kernel PF will remove rules associated with the reset VF no matter the HW VSI ID is changed or not. So DCF should redirector all rules associated with the reset VF no matter the HW VSI ID is changed or not.

Fixes f10cde8e8478 ("net/ice: get VF hardware index in DCF")
Fixes dc0f06849e50 ("net/ice: redirect switch rule to new VSI")
Quoted 8 lines
Quoted 1 line

I think these commit-id's will need some fix up before reaching master

We are aware of it, but these fixes are in the next-net and next-net keeps rebasing on the main repo, so commit ids keeps changes there. These should be fixed while next-net merged to main repo.
I tend to squash fixes in this case whenever reasonable, but not always. Frequently pulling from next-net to main solves this issue too.

Thanks Ferruh - I know you do a good job on this. Was just flagging as I noticed while checking if it needed a stable tag (it doesn't).

Quoted 41 lines
Quoted 40 lines
Quoted 39 lines
Quoted 36 lines

---
drivers/net/ice/ice_dcf.c | 2 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c30f0e..0cd5d1b 100644
@@ -536,7 +536,7 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	rte_intr_disable(&pci_dev->intr_handle);
 	ice_dcf_disable_irq0(hw);
 
-	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw))
+	if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
 		err = -1;
 
 	rte_intr_enable(&pci_dev->intr_handle);
drivers/net/ice/ice_dcf_parent.c +1 -1
index d4b4ede..bdfc7d4 100644
@@ -45,7 +45,7 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_handle,
 			VIRTCHNL_DCF_VF_VSI_ID_S;
 
 		/* Redirect rules if vsi mapping table changes. */
-		if (!first_update && vsi_ctx->vsi_num != new_vsi_num) {
+		if (!first_update) {
 			struct ice_flow_redirect rd;
 
 			memset(&rd, 0, sizeof(struct ice_flow_redirect));
Signature · 1 line
2.7.4

Applied to dpdk-next-net-intel, Thanks.