netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Mengyuan Lou <mengyuanlou@net-swift.com>
Subject: Re: [PATCH net-next v3 3/3] net: wangxun: support to use adaptive RX coalescing
Date: Fri, 25 Jul 2025 17:34:28 -0700	[thread overview]
Message-ID: <20250725173428.1857c412@kernel.org> (raw)
In-Reply-To: <20250724080548.23912-4-jiawenwu@trustnetic.com>

On Thu, 24 Jul 2025 16:05:48 +0800 Jiawen Wu wrote:
> Support to turn on/off adaptive RX coalesce. When adaptive RX coalesce
> is on, use DIM algorithm for a dynamic interrupt moderation.

you say Rx, and you add Rx as the flag

> +				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX,

so far so good, but then you also have dim instances for Tx ?!

> +		q_vector->tx.dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_CQE;

> +static void wx_tx_dim_work(struct work_struct *work)

I don't get it.

> @@ -363,10 +366,15 @@ int wx_set_coalesce(struct net_device *netdev,
>  	    (ec->tx_coalesce_usecs > (max_eitr >> 2)))
>  		return -EINVAL;
>  
> +	if (ec->use_adaptive_rx_coalesce) {
> +		wx->rx_itr_setting = 1;
> +		return 0;
> +	}
> +
>  	if (ec->rx_coalesce_usecs > 1)
>  		wx->rx_itr_setting = ec->rx_coalesce_usecs << 2;
>  	else
> -		wx->rx_itr_setting = ec->rx_coalesce_usecs;
> +		wx->rx_itr_setting = rx_itr_param;

looks racy, you should probably cancel the DIM works?
Otherwise if the work is in flight as the user sets the values
the work will overwrite user settings.
-- 
pw-bot: cr

  reply	other threads:[~2025-07-26  0:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  8:05 [PATCH net-next v3 0/3] net: wangxun: complete ethtool coalesce options Jiawen Wu
2025-07-24  8:05 ` [PATCH net-next v3 1/3] net: wangxun: change the default ITR setting Jiawen Wu
2025-07-26  0:30   ` Jakub Kicinski
2025-07-24  8:05 ` [PATCH net-next v3 2/3] net: wangxun: limit tx_max_coalesced_frames_irq Jiawen Wu
2025-07-26  0:31   ` Jakub Kicinski
2025-07-24  8:05 ` [PATCH net-next v3 3/3] net: wangxun: support to use adaptive RX coalescing Jiawen Wu
2025-07-26  0:34   ` Jakub Kicinski [this message]
2025-07-28  2:15     ` Jiawen Wu
2025-07-28 15:23       ` Jakub Kicinski

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=20250725173428.1857c412@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).