Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3769264ybl; Mon, 13 Jan 2020 02:16:11 -0800 (PST) X-Google-Smtp-Source: APXvYqx9lPZ3Q/jkeDcewgWrR7WlHzPOtN2gwx4u5Ut51yHxBTpT8FmxaUSWWfUVVoBE99VFfFQ3 X-Received: by 2002:a9d:6b17:: with SMTP id g23mr11939589otp.265.1578910571636; Mon, 13 Jan 2020 02:16:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578910571; cv=none; d=google.com; s=arc-20160816; b=G+GZU9V93lXr4AJCmHR5zWYpcJFmGD8kYk625JaIJ6rd8nfykHuAzDqOVuTlUTWP5E 5YEInakFydPRXsQPgDdEje7+CxT37ojaF2NrqLHQM9Nh08a/HqDtzcUBnt9FDP7T2t+h GBJii9cmeZ3wH4mfzVsXg2BCN6TaGcji+qylNc5Ta/aiBMyMMuIOZH6fnXBLfEQsxVQD tbn+4suqI3EIsUw2rLGUi9iDuSodeOzZ96xvFgntXazRml9yMKa2HjBHUtFfXdz4vPnm ub88C78thmOMfHYQsaZAWSRZaBJEp+/+rAF71k+H1+ICsUvwFcOHw3/eLBoDe2DuahRM uPqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0dm1FCPNRIy/Y7VhSKdvCzkFaAPSOq5A5XL5Es2LXao=; b=P8YK/GeHPsZ7YPyr6fCCvEXIYXKUghhHBBH3SfyK4knsvOZZGkmwdKf5ppRI0AS6HE HU5DzS2SYnVwO1b1dfuTBXFIijUU4EGz3E+IlrFEegav4dmTqN//L1Sdp5zZjX9NRSlG PTexFuyua3d2FRuhRywJl/1APql5zkmSx/JqRsckEidS6fOZRsV04BMq41whxNeuq3Bd j4LA5e+piSkEc6ZsAukESdrSir73365GT4uV+sBwRtCgzGyr9fJUnneQ+PyO6/WkWv5I Ik8osl9BIbe9QIN8EfwkjNb8MoOa3YAkfur5vn5zirXrJL9K+5zSGrt1RaLkjHadITcu pxMQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si5602075oip.277.2020.01.13.02.15.59; Mon, 13 Jan 2020 02:16:11 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728868AbgAMKNq (ORCPT + 99 others); Mon, 13 Jan 2020 05:13:46 -0500 Received: from mga03.intel.com ([134.134.136.65]:10161 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbgAMKNp (ORCPT ); Mon, 13 Jan 2020 05:13:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116851" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:41 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Cc: Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , "David S . Miller" , Maxime Coquelin , Ong Boon Leong , Tan Tee Min , Voon Weifeng , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 6/7] net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter Date: Tue, 14 Jan 2020 10:01:15 +0800 Message-Id: <1578967276-55956-7-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Verma, Aashish" Without checking for IFF_MULTICAST flag, it is wrong to assume multicast filtering is always enabled. By checking against IFF_MULTICAST, now the driver behaves correctly when the multicast support is toggled by below command:- ip link set multicast off|on Fixes: 477286b53f55 ("stmmac: add GMAC4 core support") Signed-off-by: Verma, Aashish Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 6e3d0ab..53be936 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -420,7 +420,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw, value |= GMAC_PACKET_FILTER_PM; /* Set all the bits of the HASH tab */ memset(mc_filter, 0xff, sizeof(mc_filter)); - } else if (!netdev_mc_empty(dev)) { + } else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) { struct netdev_hw_addr *ha; /* Hash filter for multicast */ -- 2.7.4