lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01b318d1-ad3a-bf00-3ebe-6b449af5928d@ti.com>
Date:   Mon, 1 Nov 2021 17:13:34 +0200
From:   Grygorii Strashko <grygorii.strashko@...com>
To:     Maxim Kiselev <bigunclemax@...il.com>
CC:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        Yang Yingliang <yangyingliang@...wei.com>,
        Colin Ian King <colin.king@...onical.com>,
        Yufeng Mo <moyufeng@...wei.com>,
        Michael Walle <michael@...le.cc>, Sriram <srk@...com>,
        <linux-omap@...r.kernel.org>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: davinci_emac: Fix interrupt pacing disable



On 01/11/2021 16:03, Maxim Kiselev wrote:
>  From ca26bf62366f249a2ed360b00c1883652848bfdc Mon Sep 17 00:00:00 2001
> From: Maxim Kiselev <bigunclemax@...il.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@...il.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@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ