All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Jakub Kicinski'" <kuba@kernel.org>
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: Mon, 28 Jul 2025 10:15:42 +0800	[thread overview]
Message-ID: <058001dbff65$85628e10$9027aa30$@trustnetic.com> (raw)
In-Reply-To: <20250725173428.1857c412@kernel.org>

On Sat, Jul 26, 2025 8:34 AM, Jakub Kicinski wrote:
> 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 ?!

I hope RX and TX can share ITR value, because they share the interrupt.
Once adaptive RX coalesce is on, use the smallest value got from RX sample and TX sample.
If adaptive TX flag is also set, how should I properly set it? Cooperate with RX?

> 
> > +		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-28  2:18 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
2025-07-28  2:15     ` Jiawen Wu [this message]
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='058001dbff65$85628e10$9027aa30$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.