netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
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>,
	Jakub Kicinski <kuba@kernel.org>, 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 v4 3/4] net: wangxun: cleanup the code in wx_set_coalesce()
Date: Tue, 12 Aug 2025 13:12:26 +0200	[thread overview]
Message-ID: <aJshmpZhMSPBAGac@mev-dev.igk.intel.com> (raw)
In-Reply-To: <20250812015023.12876-4-jiawenwu@trustnetic.com>

On Tue, Aug 12, 2025 at 09:50:22AM +0800, Jiawen Wu wrote:
> Cleanup the code for the next patch to add adaptive coalesce.
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  .../net/ethernet/wangxun/libwx/wx_ethtool.c   | 28 ++++++-------------
>  1 file changed, 8 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> index 590a5901cf77..c7b3f5087b66 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
> @@ -343,13 +343,19 @@ int wx_set_coalesce(struct net_device *netdev,
>  	switch (wx->mac.type) {
>  	case wx_mac_sp:
>  		max_eitr = WX_SP_MAX_EITR;
> +		rx_itr_param = WX_20K_ITR;
> +		tx_itr_param = WX_12K_ITR;
>  		break;
>  	case wx_mac_aml:
>  	case wx_mac_aml40:
>  		max_eitr = WX_AML_MAX_EITR;
> +		rx_itr_param = WX_20K_ITR;
> +		tx_itr_param = WX_12K_ITR;
>  		break;
>  	default:
>  		max_eitr = WX_EM_MAX_EITR;
> +		rx_itr_param = WX_7K_ITR;
> +		tx_itr_param = WX_7K_ITR;
>  		break;
>  	}
>  
> @@ -362,34 +368,16 @@ int wx_set_coalesce(struct net_device *netdev,
>  	else
>  		wx->rx_itr_setting = ec->rx_coalesce_usecs;
>  
> -	if (wx->rx_itr_setting == 1) {
> -		if (wx->mac.type == wx_mac_em)
> -			rx_itr_param = WX_7K_ITR;
> -		else
> -			rx_itr_param = WX_20K_ITR;
> -	} else {
> +	if (wx->rx_itr_setting != 1)
>  		rx_itr_param = wx->rx_itr_setting;
> -	}
>  
>  	if (ec->tx_coalesce_usecs > 1)
>  		wx->tx_itr_setting = ec->tx_coalesce_usecs << 2;
>  	else
>  		wx->tx_itr_setting = ec->tx_coalesce_usecs;
>  
> -	if (wx->tx_itr_setting == 1) {
> -		switch (wx->mac.type) {
> -		case wx_mac_sp:
> -		case wx_mac_aml:
> -		case wx_mac_aml40:
> -			tx_itr_param = WX_12K_ITR;
> -			break;
> -		default:
> -			tx_itr_param = WX_7K_ITR;
> -			break;
> -		}
> -	} else {
> +	if (wx->tx_itr_setting != 1)
>  		tx_itr_param = wx->tx_itr_setting;
> -	}
>  
>  	/* mixed Rx/Tx */
>  	if (wx->q_vector[0]->tx.count && wx->q_vector[0]->rx.count)

LGTM
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

> -- 
> 2.48.1

  reply	other threads:[~2025-08-12 11:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12  1:50 [PATCH net-next v4 0/4] net: wangxun: complete ethtool coalesce options Jiawen Wu
2025-08-12  1:50 ` [PATCH net-next v4 1/4] net: ngbe: change the default ITR setting Jiawen Wu
2025-08-12 11:11   ` Michal Swiatkowski
2025-08-12  1:50 ` [PATCH net-next v4 2/4] net: wangxun: limit tx_max_coalesced_frames_irq Jiawen Wu
2025-08-12  1:50 ` [PATCH net-next v4 3/4] net: wangxun: cleanup the code in wx_set_coalesce() Jiawen Wu
2025-08-12 11:12   ` Michal Swiatkowski [this message]
2025-08-12  1:50 ` [PATCH net-next v4 4/4] net: wangxun: support to use adaptive RX/TX coalescing Jiawen Wu
2025-08-15 18:18   ` Jakub Kicinski
2025-08-20  1:57     ` Jiawen Wu
2025-08-20 15:45       ` Jakub Kicinski
2025-08-21  1:45         ` Jiawen Wu

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=aJshmpZhMSPBAGac@mev-dev.igk.intel.com \
    --to=michal.swiatkowski@linux.intel.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=jiawenwu@trustnetic.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 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).