DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Zaiyu Wang'" <zaiyuwang@trustnetic.com>, <dev@dpdk.org>
Subject: RE: [PATCH v2 09/15] net/txgbe: add TX head Write-Back mode for Amber-Lite NICs
Date: Mon, 4 Aug 2025 15:15:52 +0800	[thread overview]
Message-ID: <073701dc050f$9c77d6a0$d56783e0$@trustnetic.com> (raw)
In-Reply-To: <20250625125047.18072-10-zaiyuwang@trustnetic.com>

> diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
> index 8005283a26..5692883f60 100644
> --- a/drivers/net/txgbe/base/txgbe_type.h
> +++ b/drivers/net/txgbe/base/txgbe_type.h
> @@ -723,6 +723,8 @@ struct txgbe_phy_info {
>  #define TXGBE_DEVARG_FFE_MAIN		"ffe_main"
>  #define TXGBE_DEVARG_FFE_PRE		"ffe_pre"
>  #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"
> 
>  static const char * const txgbe_valid_arguments[] = {
>  	TXGBE_DEVARG_BP_AUTO,
> @@ -733,6 +735,8 @@ static const char * const txgbe_valid_arguments[] = {
>  	TXGBE_DEVARG_FFE_MAIN,
>  	TXGBE_DEVARG_FFE_PRE,
>  	TXGBE_DEVARG_FFE_POST,
> +	TXGBE_DEVARG_TX_HEAD_WB,
> +	TXGBE_DEVARG_TX_HEAD_WB_SIZE,
>  	NULL
>  };
> 
> @@ -783,6 +787,8 @@ struct txgbe_devargs {
>  	u16 poll;
>  	u16 present;
>  	u16 sgmii;
> +	u16 tx_headwb;
> +	u16 tx_headwb_size;
>  };
> 
>  struct txgbe_hw {
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index a854b40b9f..ed84594105 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -513,6 +513,9 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
>  	u16 ffe_main = 27;
>  	u16 ffe_pre = 8;
>  	u16 ffe_post = 44;
> +	/* New devargs for amberlite config */
> +	u16 tx_headwb = 1;
> +	u16 tx_headwb_size = 16;
> 
>  	if (devargs == NULL)
>  		goto null;
> @@ -537,6 +540,10 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
>  			   &txgbe_handle_devarg, &ffe_pre);
>  	rte_kvargs_process(kvlist, TXGBE_DEVARG_FFE_POST,
>  			   &txgbe_handle_devarg, &ffe_post);
> +	rte_kvargs_process(kvlist, TXGBE_DEVARG_TX_HEAD_WB,
> +			   &txgbe_handle_devarg, &tx_headwb);
> +	rte_kvargs_process(kvlist, TXGBE_DEVARG_TX_HEAD_WB_SIZE,
> +			   &txgbe_handle_devarg, &tx_headwb_size);
>  	rte_kvargs_free(kvlist);
> 
>  null:
> @@ -544,6 +551,8 @@ txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
>  	hw->devarg.poll = poll;
>  	hw->devarg.present = present;
>  	hw->devarg.sgmii = sgmii;
> +	hw->devarg.tx_headwb = tx_headwb;
> +	hw->devarg.tx_headwb_size = tx_headwb_size;
>  	hw->phy.ffe_set = ffe_set;
>  	hw->phy.ffe_main = ffe_main;
>  	hw->phy.ffe_pre = ffe_pre;

Add the strings into RTE_PMD_REGISTER_PARAM_STRING().

> diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
> index 558ffbf73f..9846ce3c56 100644
> --- a/drivers/net/txgbe/txgbe_rxtx.c
> +++ b/drivers/net/txgbe/txgbe_rxtx.c
> @@ -92,14 +92,29 @@ txgbe_tx_free_bufs(struct txgbe_tx_queue *txq)
>  	int i, nb_free = 0;
>  	struct rte_mbuf *m, *free[RTE_TXGBE_TX_MAX_FREE_BUF_SZ];
> 
> -	/* check DD bit on threshold descriptor */
> -	status = txq->tx_ring[txq->tx_next_dd].dw3;
> -	if (!(status & rte_cpu_to_le_32(TXGBE_TXD_DD))) {
> -		if (txq->nb_tx_free >> 1 < txq->tx_free_thresh)
> -			txgbe_set32_masked(txq->tdc_reg_addr,
> -				TXGBE_TXCFG_FLUSH, TXGBE_TXCFG_FLUSH);
> -		return 0;
> -	}
> +	if (txq->headwb_mem) {
> +		uint16_t tx_last_dd = txq->nb_tx_desc +
> +				      txq->tx_next_dd - txq->tx_free_thresh;
> +		if (tx_last_dd >= txq->nb_tx_desc)
> +			tx_last_dd -= txq->nb_tx_desc;
> +
> +		volatile uint16_t head = (uint16_t)*(txq->headwb_mem);
> +
> +		if (txq->tx_next_dd > head && head > tx_last_dd)
> +			return 0;
> +		else if (tx_last_dd > txq->tx_next_dd &&
> +				(head > tx_last_dd || head < txq->tx_next_dd))
> +			return 0;
> +	} else {
> +		/* check DD bit on threshold descriptor */
> +		status = txq->tx_ring[txq->tx_next_dd].dw3;
> +		if (!(status & rte_cpu_to_le_32(TXGBE_TXD_DD))) {
> +			if (txq->nb_tx_free >> 1 < txq->tx_free_thresh)
> +				txgbe_set32_masked(txq->tdc_reg_addr,
> +					TXGBE_TXCFG_FLUSH, TXGBE_TXCFG_FLUSH);
> +			return 0;
> +		}
> +}

TAB
 


  reply	other threads:[~2025-08-04  7:16 UTC|newest]

Thread overview: 43+ 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 [this message]
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

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='073701dc050f$9c77d6a0$d56783e0$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@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).