[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB360000470873FAC497554AD2FFFC0@VI1PR0402MB3600.eurprd04.prod.outlook.com>
Date: Wed, 11 Mar 2020 03:47:34 +0000
From: Andy Duan <fugang.duan@....com>
To: Jakub Kicinski <kuba@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Frank Li <frank.li@....com>
Subject: RE: [EXT] [PATCH net] net: fec: validate the new settings in
fec_enet_set_coalesce()
From: netdev-owner@...r.kernel.org <netdev-owner@...r.kernel.org> On Behalf Of Jakub Kicinski
> fec_enet_set_coalesce() validates the previously set params and if they are
> within range proceeds to apply the new ones.
> The new ones, however, are not validated. This seems backwards, probably a
> copy-paste error?
>
> Compile tested only.
>
> Fixes: d851b47b22fc ("net: fec: add interrupt coalescence feature support")
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Good catch, parameters range checking doesn't impact function, so it should be copy-paste error.
Acked-by: Fugang Duan <fugang.duan@....com>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 4432a59904c7..23c5fef2f1ad 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2529,15 +2529,15 @@ fec_enet_set_coalesce(struct net_device *ndev,
> struct ethtool_coalesce *ec)
> return -EINVAL;
> }
>
> - cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
> + cycle = fec_enet_us_to_itr_clock(ndev, ec->rx_coalesce_usecs);
> if (cycle > 0xFFFF) {
> dev_err(dev, "Rx coalesced usec exceed hardware
> limitation\n");
> return -EINVAL;
> }
>
> - cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
> + cycle = fec_enet_us_to_itr_clock(ndev, ec->tx_coalesce_usecs);
> if (cycle > 0xFFFF) {
> - dev_err(dev, "Rx coalesced usec exceed hardware
> limitation\n");
> + dev_err(dev, "Tx coalesced usec exceed hardware
> + limitation\n");
> return -EINVAL;
> }
>
> --
> 2.24.1
Powered by blists - more mailing lists