From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: zaiyuwang@trustnetic.com, Jiawen Wu <jiawenwu@trustnetic.com>,
stable@dpdk.org
Subject: [PATCH 07/12] net/ngbe: fix MAC control frame forwarding
Date: Fri, 6 Jun 2025 16:01:12 +0800 [thread overview]
Message-ID: <6B775662DA1AA425+20250606080117.183198-8-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20250606080117.183198-1-jiawenwu@trustnetic.com>
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(+)
diff --git a/drivers/net/ngbe/base/ngbe_hw.c b/drivers/net/ngbe/base/ngbe_hw.c
index 6688ae6a31..bf09f8a817 100644
--- a/drivers/net/ngbe/base/ngbe_hw.c
+++ b/drivers/net/ngbe/base/ngbe_hw.c
@@ -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:
diff --git a/drivers/net/ngbe/base/ngbe_type.h b/drivers/net/ngbe/base/ngbe_type.h
index 7a3b52ffd4..fc571c7457 100644
--- a/drivers/net/ngbe/base/ngbe_type.h
+++ b/drivers/net/ngbe/base/ngbe_type.h
@@ -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 */
diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c
index 08e87471f6..a8f847de8d 100644
--- a/drivers/net/ngbe/ngbe_ethdev.c
+++ b/drivers/net/ngbe/ngbe_ethdev.c
@@ -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);
--
2.48.1
next prev parent reply other threads:[~2025-06-06 8:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250606080117.183198-1-jiawenwu@trustnetic.com>
2025-06-06 8:01 ` [PATCH 03/12] net/txgbe: fix reserved extra FDIR headroom Jiawen Wu
2025-06-06 8:01 ` [PATCH 06/12] net/txgbe: fix MAC control frame forwarding Jiawen Wu
2025-06-06 8:01 ` Jiawen Wu [this message]
2025-06-06 8:01 ` [PATCH 08/12] net/txgbe: fix incorrect device statistics Jiawen Wu
2025-06-06 8:01 ` [PATCH 09/12] net/ngbe: " Jiawen Wu
2025-06-06 8:01 ` [PATCH 10/12] net/txgbe: restrict VLAN strip configuration on VF Jiawen Wu
2025-06-06 8:01 ` [PATCH 11/12] net/ngbe: " Jiawen Wu
2025-06-06 8:01 ` [PATCH 12/12] net/txgbe: add missing LRO flag in mbuf when LRO enabled Jiawen Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6B775662DA1AA425+20250606080117.183198-8-jiawenwu@trustnetic.com \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=zaiyuwang@trustnetic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).