[v2,07/12] net/ngbe: 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: f40e9f0e2278 ("net/ngbe: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ngbe/base/ngbe_hw.c | 9 +++++++++
drivers/net/ngbe/base/ngbe_type.h | 1 +
drivers/net/ngbe/ngbe_ethdev.c | 1 +
3 files changed, 11 insertions(+)
@@ -865,6 +865,15 @@ s32 ngbe_setup_fc_em(struct ngbe_hw *hw)
goto out;
}
+ /*
+ * Reconfig mac ctrl frame fwd rule to make sure it still
+ * working after port stop/start.
+ */
+ wr32m(hw, NGBE_MACRXFLT, NGBE_MACRXFLT_CTL_MASK,
+ (hw->fc.mac_ctrl_frame_fwd ?
+ NGBE_MACRXFLT_CTL_NOPS : NGBE_MACRXFLT_CTL_DROP));
+ ngbe_flush(hw);
+
err = hw->phy.set_pause_adv(hw, reg_cu);
out:
@@ -112,6 +112,7 @@ struct ngbe_fc_info {
u32 high_water; /* Flow Ctrl High-water */
u32 low_water; /* 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 */
@@ -2420,6 +2420,7 @@ ngbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
hw->fc.low_water = 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 = hw->mac.fc_enable(hw);