[v2,06/12] net/txgbe: fix MAC control frame forwarding
Checks
Commit Message
Test Failure on the case "test_pause_fwd_port_stop_start", which expect
MAC control frame forwarding setting still working after port stop/start.
Fix the bug to pass the test case.
Fixes: 69ce8c8a4ce3 ("net/txgbe: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/base/txgbe_hw.c | 9 +++++++++
drivers/net/txgbe/base/txgbe_type.h | 1 +
drivers/net/txgbe/txgbe_ethdev.c | 1 +
3 files changed, 11 insertions(+)
@@ -226,6 +226,15 @@ s32 txgbe_setup_fc(struct txgbe_hw *hw)
TXGBE_MD_DEV_AUTO_NEG, reg_cu);
}
+ /*
+ * Reconfig mac ctrl frame fwd rule to make sure it still
+ * working after port stop/start.
+ */
+ wr32m(hw, TXGBE_MACRXFLT, TXGBE_MACRXFLT_CTL_MASK,
+ (hw->fc.mac_ctrl_frame_fwd ?
+ TXGBE_MACRXFLT_CTL_NOPS : TXGBE_MACRXFLT_CTL_DROP));
+ txgbe_flush(hw);
+
DEBUGOUT("Set up FC; reg = 0x%08X", reg);
out:
return err;
@@ -299,6 +299,7 @@ struct txgbe_fc_info {
u32 high_water[TXGBE_DCB_TC_MAX]; /* Flow Ctrl High-water */
u32 low_water[TXGBE_DCB_TC_MAX]; /* Flow Ctrl Low-water */
u16 pause_time; /* Flow Control Pause timer */
+ u8 mac_ctrl_frame_fwd; /* Forward MAC control frames */
bool send_xon; /* Flow control send XON */
bool strict_ieee; /* Strict IEEE mode */
bool disable_fc_autoneg; /* Do not autonegotiate FC */
@@ -3586,6 +3586,7 @@ txgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
hw->fc.low_water[0] = fc_conf->low_water;
hw->fc.send_xon = fc_conf->send_xon;
hw->fc.disable_fc_autoneg = !fc_conf->autoneg;
+ hw->fc.mac_ctrl_frame_fwd = fc_conf->mac_ctrl_frame_fwd;
err = txgbe_fc_enable(hw);