From: Zaiyu Wang <zaiyuwang@trustnetic.com>
To: dev@dpdk.org
Cc: Zaiyu Wang <zaiyuwang@trustnetic.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Jian Wang <jianwang@trustnetic.com>
Subject: [PATCH v4 11/20] net/txgbe: add RX desc merge mode for Amber-Lite NICs
Date: Tue, 30 Sep 2025 17:59:43 +0800 [thread overview]
Message-ID: <20250930095953.18508-12-zaiyuwang@trustnetic.com> (raw)
In-Reply-To: <20250930095953.18508-1-zaiyuwang@trustnetic.com>
Add RX desc merge mode for Amber-Lite NICs. When enabled,
the hardware batch-processes RX packets, significantly
enhancing performance. This feature is enabled by default
in the driver and can be configured via the rx_desc_merge
parameter in devargs.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/txgbe/base/txgbe_regs.h | 4 ++++
drivers/net/txgbe/base/txgbe_type.h | 3 +++
drivers/net/txgbe/txgbe_ethdev.c | 7 ++++++-
drivers/net/txgbe/txgbe_rxtx.c | 11 +++++++++++
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/net/txgbe/base/txgbe_regs.h b/drivers/net/txgbe/base/txgbe_regs.h
index 1a544bcd57..e050941992 100644
--- a/drivers/net/txgbe/base/txgbe_regs.h
+++ b/drivers/net/txgbe/base/txgbe_regs.h
@@ -1377,6 +1377,7 @@ enum txgbe_5tuple_protocol {
#define TXGBE_RXCFG_HDRLEN(v) LS(HDRLEN(v), 12, 0xF)
#define TXGBE_RXCFG_HDRLEN_MASK MS(12, 0xF)
#define TXGBE_RXCFG_WTHRESH(v) LS(v, 16, 0x7)
+#define TXGBE_RXCFG_DESC_MERGE MS(19, 0x1)
#define TXGBE_RXCFG_ETAG MS(22, 0x1)
#define TXGBE_RXCFG_RSCMAX_MASK MS(23, 0x3)
#define TXGBE_RXCFG_RSCMAX_1 LS(0, 23, 0x3)
@@ -1671,6 +1672,9 @@ enum txgbe_5tuple_protocol {
#define TXGBE_RPUP2TC_UP_SHIFT 3
#define TXGBE_RPUP2TC_UP_MASK 0x7
+#define TXGBE_RDM_DCACHE_CTL 0x0120A8
+#define TXGBE_RDM_DCACHE_CTL_EN MS(0, 0x1)
+
/* mac switcher */
#define TXGBE_ETHADDRL 0x016200
#define TXGBE_ETHADDRL_AD0(v) LS(v, 0, 0xFF)
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index 844a2827bc..03e5bd489d 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -718,6 +718,7 @@ struct txgbe_phy_info {
#define TXGBE_DEVARG_FFE_POST "ffe_post"
#define TXGBE_DEVARG_TX_HEAD_WB "tx_headwb"
#define TXGBE_DEVARG_TX_HEAD_WB_SIZE "tx_headwb_size"
+#define TXGBE_DEVARG_RX_DESC_MERGE "rx_desc_merge"
static const char * const txgbe_valid_arguments[] = {
TXGBE_DEVARG_BP_AUTO,
@@ -730,6 +731,7 @@ static const char * const txgbe_valid_arguments[] = {
TXGBE_DEVARG_FFE_POST,
TXGBE_DEVARG_TX_HEAD_WB,
TXGBE_DEVARG_TX_HEAD_WB_SIZE,
+ TXGBE_DEVARG_RX_DESC_MERGE,
NULL
};
@@ -782,6 +784,7 @@ struct txgbe_devargs {
u16 sgmii;
u16 tx_headwb;
u16 tx_headwb_size;
+ u16 rx_desc_merge;
};
struct txgbe_hw {
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 9c14e4b8ed..13d1d6924d 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -516,6 +516,7 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
/* New devargs for amberlite config */
u16 tx_headwb = 1;
u16 tx_headwb_size = 16;
+ u16 rx_desc_merge = 1;
if (devargs == NULL)
goto null;
@@ -544,6 +545,8 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
&txgbe_handle_devarg, &tx_headwb);
rte_kvargs_process(kvlist, TXGBE_DEVARG_TX_HEAD_WB_SIZE,
&txgbe_handle_devarg, &tx_headwb_size);
+ rte_kvargs_process(kvlist, TXGBE_DEVARG_RX_DESC_MERGE,
+ &txgbe_handle_devarg, &rx_desc_merge);
rte_kvargs_free(kvlist);
null:
@@ -553,6 +556,7 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
hw->devarg.sgmii = sgmii;
hw->devarg.tx_headwb = tx_headwb;
hw->devarg.tx_headwb_size = tx_headwb_size;
+ hw->devarg.rx_desc_merge = rx_desc_merge;
hw->phy.ffe_set = ffe_set;
hw->phy.ffe_main = ffe_main;
hw->phy.ffe_pre = ffe_pre;
@@ -5729,7 +5733,8 @@ RTE_PMD_REGISTER_PARAM_STRING(net_txgbe,
TXGBE_DEVARG_FFE_PRE "=<uint16>"
TXGBE_DEVARG_FFE_POST "=<uint16>"
TXGBE_DEVARG_TX_HEAD_WB "=<0|1>"
- TXGBE_DEVARG_TX_HEAD_WB_SIZE "=<1|16>");
+ TXGBE_DEVARG_TX_HEAD_WB_SIZE "=<1|16>"
+ TXGBE_DEVARG_RX_DESC_MERGE "=<0|1>");
RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_init, init, NOTICE);
RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_driver, driver, NOTICE);
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index b15b6788e6..957aa5c6eb 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -4667,6 +4667,17 @@ txgbe_dev_rx_init(struct rte_eth_dev *dev)
buf_size = ROUND_DOWN(buf_size, 0x1 << 10);
srrctl |= TXGBE_RXCFG_PKTLEN(buf_size);
+ if ((hw->mac.type == txgbe_mac_aml ||
+ hw->mac.type == txgbe_mac_aml40) && hw->devarg.rx_desc_merge == 1) {
+ srrctl |= TXGBE_RXCFG_DESC_MERGE;
+
+ wr32(hw, TXGBE_RDM_DCACHE_CTL, TXGBE_RDM_DCACHE_CTL_EN);
+ wr32m(hw, TXGBE_RDM_RSC_CTL, TXGBE_RDM_RSC_CTL_FREE_CTL,
+ TXGBE_RDM_RSC_CTL_FREE_CTL);
+ wr32m(hw, TXGBE_RDM_RSC_CTL, TXGBE_RDM_RSC_CTL_FREE_CNT_DIS,
+ ~TXGBE_RDM_RSC_CTL_FREE_CNT_DIS);
+ }
+
wr32(hw, TXGBE_RXCFG(rxq->reg_idx), srrctl);
/* It adds dual VLAN length for supporting dual VLAN */
--
2.21.0.windows.1
next prev parent reply other threads:[~2025-09-30 10:01 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 9:41 [PATCH 0/2] *** Wangxun new NIC support *** Zaiyu Wang
2025-04-18 9:41 ` [PATCH 1/2] net/txgbe: add support for Wangxun new NIC Amber-Lite 25g/40g Zaiyu Wang
2025-04-18 9:41 ` [PATCH 2/2] net/txgbe: add basic code for Amber-Liter NIC configuration Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 00/15] Wangxun new NIC support Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 01/15] net/txgbe: add basic information for Amber-Lite 25G/40G NICs Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 02/15] net/txgbe: add new SW-FW mailbox interface Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 03/15] net/txgbe: add identification support for new SFP/QSFP modules Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 04/15] net/txgbe: add basic link configuration for Amber-Lite NICs Zaiyu Wang
2025-08-04 6:34 ` Jiawen Wu
2025-06-25 12:50 ` [PATCH v2 05/15] net/txgbe: add support for PHY configuration via SW-FW mailbox Zaiyu Wang
2025-08-04 6:51 ` Jiawen Wu
2025-06-25 12:50 ` [PATCH v2 06/15] net/txgbe: add RX&TX support for Amber-Lite NICs Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 07/15] net/txgbe: add hardware reset change " Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 08/15] net/txgbe: add MAC reconfiguration to avoid packet loss Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 09/15] net/txgbe: add TX head Write-Back mode for Amber-Lite NICs Zaiyu Wang
2025-08-04 7:15 ` Jiawen Wu
2025-06-25 12:50 ` [PATCH v2 10/15] net/txgbe: add RX desc merge " Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 11/15] net/txgbe: add FEC support for Amber-Lite 25G NICs Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 12/15] net/txgbe: add GPIO configuration Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 13/15] net/txgbe: disable unstable features Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 14/15] net/txgbe: add other hardware-related changes Zaiyu Wang
2025-06-25 12:50 ` [PATCH v2 15/15] doc: update for txgbe Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 00/15] Wangxun new NIC support Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 01/15] net/txgbe: add basic information for Amber-Lite 25G/40G NICs Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 02/15] net/txgbe: add new SW-FW mailbox interface Zaiyu Wang
2025-08-04 6:12 ` Jiawen Wu
2025-06-26 8:02 ` [PATCH v3 03/15] net/txgbe: add identification support for new SFP/QSFP modules Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 04/15] net/txgbe: add basic link configuration for Amber-Lite NICs Zaiyu Wang
2025-08-03 16:42 ` Stephen Hemminger
2025-06-26 8:02 ` [PATCH v3 05/15] net/txgbe: add support for PHY configuration via SW-FW mailbox Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 06/15] net/txgbe: add RX&TX support for Amber-Lite NICs Zaiyu Wang
2025-08-04 7:07 ` Jiawen Wu
2025-06-26 8:02 ` [PATCH v3 07/15] net/txgbe: add hardware reset change " Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 08/15] net/txgbe: add MAC reconfiguration to avoid packet loss Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 09/15] net/txgbe: add TX head Write-Back mode for Amber-Lite NICs Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 10/15] net/txgbe: add RX desc merge " Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 11/15] net/txgbe: add FEC support for Amber-Lite 25G NICs Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 12/15] net/txgbe: add GPIO configuration Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 13/15] net/txgbe: disable unstable features Zaiyu Wang
2025-06-26 8:02 ` [PATCH v3 14/15] net/txgbe: add other hardware-related changes Zaiyu Wang
2025-08-04 7:23 ` Jiawen Wu
2025-06-26 8:02 ` [PATCH v3 15/15] doc: update for txgbe Zaiyu Wang
2025-06-30 19:40 ` [PATCH v3 00/15] Wangxun new NIC support Stephen Hemminger
2025-09-30 9:59 ` [PATCH v4 00/20] " Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 01/20] net/txgbe: add basic information for Amber-Lite 25G/40G NICs Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 02/20] net/txgbe: add new SW-FW mailbox interface Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 03/20] net/txgbe: add identification support for new SFP/QSFP modules Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 04/20] net/txgbe: rename raptor to sp for Sapphire-specific code Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 05/20] net/txgbe: add basic link configuration for Amber-Lite NICs Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 06/20] net/txgbe: add support for PHY configuration via SW-FW mailbox Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 07/20] net/txgbe: add RX&TX support for Amber-Lite NICs Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 08/20] net/txgbe: add hardware reset change " Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 09/20] net/txgbe: add MAC reconfiguration to avoid packet loss Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 10/20] net/txgbe: add TX head Write-Back mode for Amber-Lite NICs Zaiyu Wang
2025-09-30 9:59 ` Zaiyu Wang [this message]
2025-09-30 9:59 ` [PATCH v4 12/20] net/txgbe: add FEC support for Amber-Lite 25G NICs Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 13/20] net/txgbe: add GPIO configuration Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 14/20] net/txgbe: disable unstable features Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 15/20] net/txgbe: add support for TX laser enable/disable Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 16/20] net/txgbe: add support for TX queue rate limiting Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 17/20] net/txgbe: add support for getting PHY ID Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 18/20] net/txgbe: add thermal sensor configuration for Amber-Lite NICs Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 19/20] net/txgbe: add RSS " Zaiyu Wang
2025-09-30 9:59 ` [PATCH v4 20/20] doc: update for txgbe Zaiyu Wang
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=20250930095953.18508-12-zaiyuwang@trustnetic.com \
--to=zaiyuwang@trustnetic.com \
--cc=dev@dpdk.org \
--cc=jianwang@trustnetic.com \
--cc=jiawenwu@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).