mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Maxim Kiselev <bigunclemax@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Yang Yingliang <yangyingliang@huawei.com>,
	Colin Ian King <colin.king@canonical.com>,
	Yufeng Mo <moyufeng@huawei.com>, Michael Walle <michael@walle.cc>,
	Sriram <srk@ti.com>, <linux-omap@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: davinci_emac: Fix interrupt pacing disable
Date: Mon, 1 Nov 2021 17:13:34 +0200	[thread overview]
Message-ID: <01b318d1-ad3a-bf00-3ebe-6b449af5928d@ti.com> (raw)
In-Reply-To: <CALHCpMjqL2i8rJBR1vVnW1orrY1Y6rSdmKGnL6uNE6tSa6jNYQ@mail.gmail.com>



On 01/11/2021 16:03, Maxim Kiselev wrote:
>  From ca26bf62366f249a2ed360b00c1883652848bfdc Mon Sep 17 00:00:00 2001
> From: Maxim Kiselev <bigunclemax@gmail.com>
> Date: Mon, 1 Nov 2021 16:37:12 +0300
> Subject: [PATCH v2] net: davinci_emac: Fix interrupt pacing disable
> 
> This patch allows to use 0 for `coal->rx_coalesce_usecs` param to
> disable rx irq coalescing.
> 
> Previously we could enable rx irq coalescing via ethtool
> (For ex: `ethtool -C eth0 rx-usecs 2000`) but we couldn't disable
> it because this part rejects 0 value:
> 
>         if (!coal->rx_coalesce_usecs)
>                 return -EINVAL;
> 
> Fixes: 84da2658a619 ("TI DaVinci EMAC : Implement interrupt pacing
> functionality.")
> 
> Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com>
> ---
> Changes v1 -> v2 (after review of Grygorii Strashko):
> 
>   - Simplify !coal->rx_coalesce_usecs handler


Do not send v2 as reply to v1 - pls, re-send as it will not hit
https://patchwork.kernel.org/project/netdevbpf/list/ properly

Otherwise:
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>

> 
> ---
>   drivers/net/ethernet/ti/davinci_emac.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c
> b/drivers/net/ethernet/ti/davinci_emac.c
> index e8291d8488391..d243ca5dfde00 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -420,8 +420,20 @@ static int emac_set_coalesce(struct net_device *ndev,
>          u32 int_ctrl, num_interrupts = 0;
>          u32 prescale = 0, addnl_dvdr = 1, coal_intvl = 0;
> 
> -       if (!coal->rx_coalesce_usecs)
> -               return -EINVAL;
> +       if (!coal->rx_coalesce_usecs) {
> +               priv->coal_intvl = 0;
> +
> +               switch (priv->version) {
> +               case EMAC_VERSION_2:
> +                       emac_ctrl_write(EMAC_DM646X_CMINTCTRL, 0);
> +                       break;
> +               default:
> +                       emac_ctrl_write(EMAC_CTRL_EWINTTCNT, 0);
> +                       break;
> +               }
> +
> +               return 0;
> +       }
> 
>          coal_intvl = coal->rx_coalesce_usecs;
> 

-- 
Best regards,
grygorii

      reply	other threads:[~2021-11-01 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  9:21 Maxim Kiselev
2021-11-01 11:54 ` Grygorii Strashko
2021-11-01 12:05   ` Maxim Kiselev
2021-11-01 12:33     ` Grygorii Strashko
2021-11-01 14:03 ` Maxim Kiselev
2021-11-01 15:13   ` Grygorii Strashko [this message]

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=01b318d1-ad3a-bf00-3ebe-6b449af5928d@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=andrew@lunn.ch \
    --cc=bigunclemax@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=moyufeng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=srk@ti.com \
    --cc=yangyingliang@huawei.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

all inboxes | Powered by JetHome®