All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Jacob Keller'" <jacob.e.keller@intel.com>,
	<netdev@vger.kernel.org>, "'Andrew Lunn'" <andrew+netdev@lunn.ch>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Eric Dumazet'" <edumazet@google.com>,
	"'Jakub Kicinski'" <kuba@kernel.org>,
	"'Paolo Abeni'" <pabeni@redhat.com>,
	"'Simon Horman'" <horms@kernel.org>
Cc: "'Mengyuan Lou'" <mengyuanlou@net-swift.com>
Subject: RE: [PATCH net-next v2 2/3] net: wangxun: limit tx_max_coalesced_frames_irq
Date: Thu, 24 Jul 2025 15:40:40 +0800	[thread overview]
Message-ID: <046601dbfc6e$41017be0$c30473a0$@trustnetic.com> (raw)
In-Reply-To: <97f47ab9-638e-45e4-88be-b1bcd089c2c6@intel.com>

On Tue, Jul 22, 2025 7:57 AM, Jacob Keller wrote:
> On 7/21/2025 1:01 AM, Jiawen Wu wrote:
> > Add limitation on tx_max_coalesced_frames_irq as 0 ~ 65535.
> >
> > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> > ---
> 
> Previously you accepted arbitrary values, and now its limited to the
> specified range of 0 through 65535. Seems reasonable. Might be good to
> explain why this particular limit is chosen.

Because 'wx->tx_work_limit' is a u16 member.

> 
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> 
> >  drivers/net/ethernet/wangxun/libwx/wx_ethtool.c | 7 +++++--
> >  drivers/net/ethernet/wangxun/libwx/wx_type.h    | 1 +
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> > index 85fb23b238d1..ebef99185bca 100644
> > --- a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> > +++ b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> > @@ -334,8 +334,11 @@ int wx_set_coalesce(struct net_device *netdev,
> >  			return -EOPNOTSUPP;
> >  	}
> >
> > -	if (ec->tx_max_coalesced_frames_irq)
> > -		wx->tx_work_limit = ec->tx_max_coalesced_frames_irq;
> > +	if (ec->tx_max_coalesced_frames_irq > WX_MAX_TX_WORK ||
> > +	    !ec->tx_max_coalesced_frames_irq)
> > +		return -EINVAL;
> > +
> > +	wx->tx_work_limit = ec->tx_max_coalesced_frames_irq;
> >
> >  	switch (wx->mac.type) {
> >  	case wx_mac_sp:
> > diff --git a/drivers/net/ethernet/wangxun/libwx/wx_type.h b/drivers/net/ethernet/wangxun/libwx/wx_type.h
> > index 9d5d10f9e410..5c52a1db4024 100644
> > --- a/drivers/net/ethernet/wangxun/libwx/wx_type.h
> > +++ b/drivers/net/ethernet/wangxun/libwx/wx_type.h
> > @@ -411,6 +411,7 @@ enum WX_MSCA_CMD_value {
> >  #define WX_7K_ITR                    595
> >  #define WX_12K_ITR                   336
> >  #define WX_20K_ITR                   200
> > +#define WX_MAX_TX_WORK               65535
> >  #define WX_SP_MAX_EITR               0x00000FF8U
> >  #define WX_AML_MAX_EITR              0x00000FFFU
> >  #define WX_EM_MAX_EITR               0x00007FFCU



  reply	other threads:[~2025-07-24  7:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  8:01 [PATCH net-next v2 0/3] net: wangxun: complete ethtool coalesce options Jiawen Wu
2025-07-21  8:01 ` [PATCH net-next v2 1/3] net: wangxun: change the default ITR setting Jiawen Wu
2025-07-21 23:55   ` Jacob Keller
2025-07-22  2:40     ` Jiawen Wu
2025-07-22 21:46       ` Jacob Keller
2025-07-21  8:01 ` [PATCH net-next v2 2/3] net: wangxun: limit tx_max_coalesced_frames_irq Jiawen Wu
2025-07-21 23:57   ` Jacob Keller
2025-07-24  7:40     ` Jiawen Wu [this message]
2025-07-21  8:01 ` [PATCH net-next v2 3/3] net: wangxun: support to use adaptive RX coalescing Jiawen Wu
2025-07-22  0:02   ` Jacob Keller
2025-07-22 23:00     ` Jakub Kicinski
2025-07-22 23:07       ` Jacob Keller

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='046601dbfc6e$41017be0$c30473a0$@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.