[v2,2/2] net/ixgbe: fix flow control status get

Message ID 20200523052239.62928-3-guinanx.sun@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series fix MAC ctrl frame fwd get |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Guinan Sun May 23, 2020, 5:22 a.m. UTC
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")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
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(+)
  

Comments

Jiang, YuX June 2, 2020, 10:54 a.m. UTC | #1
Tested-by: Chen, BoX C <box.c.chen@intel.com>

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Guinan Sun
Sent: Saturday, May 23, 2020 1:23 PM
To: dev@dpdk.org
Cc: Zhao1, Wei <wei.zhao1@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Sun, GuinanX <guinanx.sun@intel.com>; stable@dpdk.org
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")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
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(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 42947ba40..890d756e4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 42947ba40..890d756e4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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