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]
Date:   Fri, 18 Oct 2019 16:29:17 +0200
From:   Corentin Labbe <clabbe.montjoie@...il.com>
To:     Mans Rullgard <mans@...sr.com>
Cc:     Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Jose Abreu <joabreu@...opsys.com>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Chen-Yu Tsai <wens@...e.org>,
        "David S. Miller" <davem@...emloft.net>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] net: ethernet: dwmac-sun8i: show message only when
 switching to promisc

On Fri, Oct 18, 2019 at 03:05:14PM +0100, Mans Rullgard wrote:
> Printing the info message every time more than the max number of mac
> addresses are requested generates unnecessary log spam.  Showing it only
> when the hw is not already in promiscous mode is equally informative
> without being annoying.
> 
> Signed-off-by: Mans Rullgard <mans@...sr.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> index 79c91526f3ec..5be2de1f1179 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> @@ -646,7 +646,8 @@ static void sun8i_dwmac_set_filter(struct mac_device_info *hw,
>  			}
>  		}
>  	} else {
> -		netdev_info(dev, "Too many address, switching to promiscuous\n");
> +		if (readl(ioaddr + EMAC_RX_FRM_FLT) != EMAC_FRM_FLT_RXALL)
> +			netdev_info(dev, "Too many address, switching to promiscuous\n");
>  		v = EMAC_FRM_FLT_RXALL;
>  	}
>  

You need to mask the result, if EMAC_FRM_FLT_MULTICAST | EMAC_FRM_FLT_RXALL is set, you will still print the message.
Or shorter than masking, !(readl(ioaddr + EMAC_RX_FRM_FLT) & EMAC_FRM_FLT_RXALL)

I just realize that perhaps we need to set also IFF_PROMISC in dev->flags.

Thanks
Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ