From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: zaiyuwang@trustnetic.com, Jiawen Wu <jiawenwu@trustnetic.com>,
stable@dpdk.org
Subject: [PATCH 06/12] net/txgbe: fix MAC control frame forwarding
Date: Fri, 6 Jun 2025 16:01:11 +0800 [thread overview]
Message-ID: <B2D0E5072FC8B760+20250606080117.183198-7-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: 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(+)
diff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c
index 76b9ee3c0a..42cd0e0e2c 100644
--- a/drivers/net/txgbe/base/txgbe_hw.c
+++ b/drivers/net/txgbe/base/txgbe_hw.c
@@ -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;
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index 383438ea3c..65527a22e7 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -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 */
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index e5736bf387..b68a0557be 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -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);
--
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 ` Jiawen Wu [this message]
2025-06-06 8:01 ` [PATCH 07/12] net/ngbe: fix MAC control frame forwarding Jiawen Wu
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=B2D0E5072FC8B760+20250606080117.183198-7-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).