Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1741849ybg; Sat, 19 Oct 2019 01:31:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyinx2iAKQW4gf8dWq/mT9Syl6RmycV7E1wmH2AGal0JY51vCiKQEFj5Ph3KVoXg7SEnzrQ X-Received: by 2002:a17:906:4716:: with SMTP id y22mr12500459ejq.225.1571473870306; Sat, 19 Oct 2019 01:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571473870; cv=none; d=google.com; s=arc-20160816; b=wxbxEE2//uUrRZVKE6EP+zJaeCmNxuqFWVtpE16I6yfyP3ma8cq06iKfivDJs9HEDd Rh4R3WesQdORoZ61Uh2F/pU1lCgNQehvoAjias573oJv23bKQI+guOUG6yOKOtFPXJx+ RkNNNMNCSyltbE13dzN9kDUabnSHJPysvrT6qi1vrT00RCTQh/adlSsfRfpdoUyZ/L3w VHYdD0pTi/q+2QjO2AyfqVaRTiPwvsmqsY9LGEFUNyHK5aI0YXt+SDg8KQSyhfzbYtEQ CbnXIN/MEKW1n0KJ9E38S0xlDN6xPK4vqUU3JHkHv/C48tyK6B8wEZIdkd26r7H94m1V hhZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5ptchJ9UA22jxDJh3Bd/EUwZqE/aEbLVu7JuDoUNaVo=; b=02Le3/CYGgWLUthvzRmytVKiUm3FaCRNkbSdx895D4BhE8lAK0llAXHe4NnqWU+e1l vKjXRzWELymFFuEygIIMAaksIusu0Zu83uWfm9JjVikjd/9DGCw5yUqAdk2VJCNVrRKJ 2pGG4+mHZiS2D2qoEcNZOWvKguFJ3QiJDqgqfMFME1s/xJ6jdo00xWuZFgO8Wpq9uLvE gvAfTxBGnnCJyzRn0Ubxeq0Embgz91o08mxW7A5GNPgTMdE1MI0gFQQFQ3cDcJYyHTph lM3K7XiMOjV3rCX/+kZP5xqoqraETHxuQDhvpukwSY2+v91ZEE41oy9Lx+gN/CLpYBs5 pEpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yg7fL+tE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18si5055829edq.209.2019.10.19.01.30.47; Sat, 19 Oct 2019 01:31:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yg7fL+tE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410442AbfJRO3X (ORCPT + 99 others); Fri, 18 Oct 2019 10:29:23 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35222 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729584AbfJRO3X (ORCPT ); Fri, 18 Oct 2019 10:29:23 -0400 Received: by mail-wm1-f66.google.com with SMTP id n124so2628215wmf.0; Fri, 18 Oct 2019 07:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5ptchJ9UA22jxDJh3Bd/EUwZqE/aEbLVu7JuDoUNaVo=; b=Yg7fL+tE/kvtd8TqGdv5DyItEgy/SQ6F5leKmV64MKRBGuxFXM91r752kNg19q1/6H U8HZR8HW03LFU1LVJUD3qGeu4NDOKSGdC0DmvR84qWQbYHhGHcltRYt74op6dOPN+Jtl tm3A1levUg0YRkb8ZXcZRDYBMBB82OyU66xxUiNWz2qDtyyhEBGFCR5dglDj8r8Sd+Dr A1oa6NtHjvgDmkVwlkGBZbbhSUO3odjCbp0DES+hNUdDMFjLOZ166/B0Y2mFD40K2PZG Tep3KgOfiUpN9R5jXoQSUxCTaRTgrfikKqeJ80iPnFfKyVPgPmq1t1QT8s05EaedDoEp 2sSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5ptchJ9UA22jxDJh3Bd/EUwZqE/aEbLVu7JuDoUNaVo=; b=QBWoLOjO+JEbPFIeUVy3VDF2SGzhZYrPzgS2yDtApEh7jS1C9YSsIJOlNuKfoaBDxQ w6wc5qnQu0ytXLCTBLJd1hrv51pC71Grb3hYvrpjeyDspJfUMGITLqwhDmhj0uYbZxZu cQ9pTGrUjZYNR2Z/fxgdWX1G5hd1nhS3PX3DZSPrM8hgYRaEUn25fIMpJQ4h5yddDFty ljpnD+D0TaWlJ/gV6BmGyfVeNwD/8Prf4Pdm09788MpDkzaM0A8ZEwIAk29fez/V/rEE UiskWB8ceJEvlIuRrbLJCPhriOgBUP1IxgcO2CXi8Wl6x8pU4YywOJhBKWoq3RjvcRy/ ifeA== X-Gm-Message-State: APjAAAVA9h/fDWrm/5DDqUnVCyj+I5W+URYSlDSbQwLNuqLPkUzcf9Rg 0DbS1hsV3/mExM3j/C7N+6g= X-Received: by 2002:a1c:5946:: with SMTP id n67mr8222592wmb.93.1571408959942; Fri, 18 Oct 2019 07:29:19 -0700 (PDT) Received: from Red ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id 36sm6791136wrp.30.2019.10.18.07.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 07:29:19 -0700 (PDT) Date: Fri, 18 Oct 2019 16:29:17 +0200 From: Corentin Labbe To: Mans Rullgard Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Ripard , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , "David S. Miller" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] net: ethernet: dwmac-sun8i: show message only when switching to promisc Message-ID: <20191018142917.GA26078@Red> References: <20191018140514.21454-1-mans@mansr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018140514.21454-1-mans@mansr.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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