Skip to contentSkip to conversation

net/ixgbe: delete MAC control frame fwd in struct adapter

PATCH In review Guinan Sun 5 participants 12 messages May 22, 2020 – Jul 20, 2020 Network drivers

lore
Share & tools
lore

Guinan Sun

author
#0 lore raw

PATCH 1/1 net/ixgbe: delete MAC control frame fwd in struct adapter

If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of

testpmd> start
testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0
testpmd> stop
testpmd> port stop 0
testpmd> port start 0
testpmd> start

Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop.

In addition, add a value to mac_ctrl_frame_fwd in
the ixgbe_flow_ctrl_get () function.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index f8a84c565..dd4023f01 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
 
-	adapter->mac_ctrl_frame_fwd = 0;
-
 	hw->adapter_stopped = true;
 }
 
@@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	fc_conf->mac_ctrl_frame_fwd = mflcn_reg;
+
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;
 	else
Signature · 1 line
2.17.1
#1 lore raw

Hi, Guinan
I don't make sense for this commit log. Don't write like a test case. Please use technical expression.

Qiming

Quoted 56 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Guinan Sun
Sent: Friday, May 22, 2020 14:12
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter

If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of

testpmd> start
testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0 stop port stop 0 port testpmd> start 0 start

Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop.

In addition, add a value to mac_ctrl_frame_fwd in the ixgbe_flow_ctrl_get () function.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index f8a84c565..dd4023f01 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
 
-	adapter->mac_ctrl_frame_fwd = 0;
-
 	hw->adapter_stopped = true;
 }
 
@@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev,
 struct rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	fc_conf->mac_ctrl_frame_fwd = mflcn_reg;
+
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;

else
--
2.17.1

#2 lore raw
In reply to Guinan Sun

Hi, Guinan

Quoted 8 lines

-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Friday, May 22, 2020 2:12 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter

Quoted 6 lines

If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of

testpmd> start
testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0 stop port stop 0 port testpmd> start 0 start

This test step seems confused.

Quoted 41 lines

Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop.

In addition, add a value to mac_ctrl_frame_fwd in the ixgbe_flow_ctrl_get () function.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index f8a84c565..dd4023f01 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
 
-	adapter->mac_ctrl_frame_fwd = 0;
-
 	hw->adapter_stopped = true;
 }
 
@@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct
 rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	fc_conf->mac_ctrl_frame_fwd = mflcn_reg;
+
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;

else
--
2.17.1

#3 lore raw
In reply to Guinan Sun

Hi,

Quoted 44 lines

-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Friday, May 22, 2020 2:12 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter

If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of

testpmd> start
testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0 stop port stop 0 port testpmd> start 0 start

Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop.

In addition, add a value to mac_ctrl_frame_fwd in the ixgbe_flow_ctrl_get () function.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -2
index f8a84c565..dd4023f01 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
 
-	adapter->mac_ctrl_frame_fwd = 0;
-
 	hw->adapter_stopped = true;
 }
 

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct · line 4757

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
@@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct
 rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	fc_conf->mac_ctrl_frame_fwd = mflcn_reg;
+

Error, that is not right!!

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;

else
--
2.17.1

#4 lore raw

Hi

Quoted 54 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Friday, May 22, 2020 5:47 PM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: [email protected]; Yang, Qiming <[email protected]>; Ye, Xiaolong <[email protected]>
Subject: RE: [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter

Hi,

Quoted 44 lines

-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Friday, May 22, 2020 2:12 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter

If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of

testpmd> start
testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0 stop port stop 0 port testpmd> start 0 start

Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop.

In addition, add a value to mac_ctrl_frame_fwd in the ixgbe_flow_ctrl_get () function.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -2
index f8a84c565..dd4023f01 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 adapter->rss_reta_updated = 0;
 
-adapter->mac_ctrl_frame_fwd = 0;
-
 hw->adapter_stopped = true;
 }
 
Quoted 10 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, · line 4757

Quoted 7 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
@@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev,
 struct rte_eth_fc_conf *fc_conf)
  * MFLCN register.
  */
 mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+fc_conf->mac_ctrl_frame_fwd = mflcn_reg;
+

Error, that is not right!!

You are right, I will make corrections later.
In addition, the problem of ixgbe_flow_ctrl_get () and the timing of mac_ctrl_frame_fwd are two problems. I will make a patch set and release it later.

Quoted 6 lines
Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))  rx_pause =

1; else
--
2.17.1

author
#5 lore raw

v2 cover fix MAC ctrl frame fwd get

In reply to Guinan Sun

Fix incorrect MAC control frame forward.
Fix flow control status get.
---
v2 changes:
* Rebase.
* Split into two patches.
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modify commit messge.

Guinan Sun (2):
net/ixgbe: fix incorrect MAC control frame forward net/ixgbe: fix flow control status get

 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
author
#6 lore raw

PATCH v2 1/2 net/ixgbe: fix incorrect MAC control frame forward

mac_ctrl_frame_fwd shouldn't be cleared when port stop, otherwise it will be inconsistent with the actual status. This patch fixes the issue.

Fixes a524f550da6e ("net/ixgbe: fix flow control mode setting")

---
v2 changes:
* Modified commit messge.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -2
index f8a84c565..42947ba40 100644
@@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
 
-	adapter->mac_ctrl_frame_fwd = 0;
-
 	hw->adapter_stopped = true;
 }
 
Signature · 1 line
2.17.1
author
#7 lore raw

PATCH v2 2/2 net/ixgbe: fix flow control status get

In reply to Guinan Sun

mac_ctrl_frame_fwd assignment is missing, so
setting mac_ctrl_frame_fwd should be added in
ixgbe_flow_ctrl_get().
The patch fixes the issue.

Fixes 56ea46a997b7 ("ethdev: retrieve flow control configuration")

---
v2 changes:
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modified commit messge.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +5 -0
index 42947ba40..890d756e4 100644
@@ -4752,6 +4752,11 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	if (mflcn_reg & IXGBE_MFLCN_PMCF)
+		fc_conf->mac_ctrl_frame_fwd = 1;
+	else
+		fc_conf->mac_ctrl_frame_fwd = 0;
+
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;
 	else
Signature · 1 line
2.17.1
Tested-by Chen, BoX C on v2 2/2
#8 lore raw

Re: [dpdk-dev] [PATCH v2 2/2] net/ixgbe: fix flow control status get

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Guinan Sun
Sent: Saturday, May 23, 2020 1:23 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] net/ixgbe: fix flow control status get

mac_ctrl_frame_fwd assignment is missing, so setting mac_ctrl_frame_fwd should be added in ixgbe_flow_ctrl_get(). The patch fixes the issue.

Fixes 56ea46a997b7 ("ethdev: retrieve flow control configuration")

---
v2 changes:
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modified commit messge.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +5 -0
index 42947ba40..890d756e4 100644
@@ -4752,6 +4752,11 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	 * MFLCN register.
 	 */
 	mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+	if (mflcn_reg & IXGBE_MFLCN_PMCF)
+		fc_conf->mac_ctrl_frame_fwd = 1;
+	else
+		fc_conf->mac_ctrl_frame_fwd = 0;
+
 	if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE))
 		rx_pause = 1;
 	else

--
2.17.1

Reviewed-by on the v2 series
#9 lore raw

Re: [dpdk-dev] [PATCH v2 0/2] fix MAC ctrl frame fwd get

In reply to Guinan Sun
Quoted 26 lines

-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Saturday, May 23, 2020 1:23 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>
Subject: [PATCH v2 0/2] fix MAC ctrl frame fwd get

Fix incorrect MAC control frame forward.
Fix flow control status get.
---
v2 changes:
* Rebase.
* Split into two patches.
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modify commit messge.

Guinan Sun (2):
net/ixgbe: fix incorrect MAC control frame forward net/ixgbe: fix flow control status get

 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
2.17.1

Reviewed-by on the v2 series
#10 lore raw

Re: [dpdk-dev] [PATCH v2 0/2] fix MAC ctrl frame fwd get

In reply to Guinan Sun
Quoted 26 lines

-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Saturday, May 23, 2020 1:23 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>
Subject: [PATCH v2 0/2] fix MAC ctrl frame fwd get

Fix incorrect MAC control frame forward.
Fix flow control status get.
---
v2 changes:
* Rebase.
* Split into two patches.
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modify commit messge.

Guinan Sun (2):
net/ixgbe: fix incorrect MAC control frame forward net/ixgbe: fix flow control status get

 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
2.17.1

Acked-by on the v2 series Applied
#11 lore raw

Re: [dpdk-dev] [PATCH v2 0/2] fix MAC ctrl frame fwd get

In reply to Guinan Sun
Quoted 23 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Guinan Sun
Sent: Saturday, May 23, 2020 1:23 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>
Subject: [dpdk-dev] [PATCH v2 0/2] fix MAC ctrl frame fwd get

Fix incorrect MAC control frame forward.
Fix flow control status get.
---
v2 changes:
* Rebase.
* Split into two patches.
* Set fc mac_ctrl_frame_fwd by bit operation.
* Modify commit messge.

Guinan Sun (2):
net/ixgbe: fix incorrect MAC control frame forward net/ixgbe: fix flow control status get

Quoted 5 lines
 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
2.17.1

Applied to dpdk-next-net-intel.

Thanks
Qi