Received: by 10.223.185.116 with SMTP id b49csp1018233wrg; Wed, 21 Feb 2018 10:39:02 -0800 (PST) X-Google-Smtp-Source: AH8x226eKzB827n6NNxedX39/KFNFkMY/JaNUpW5/kumMLOU7fdL2mWpAYzb/CV4jh6wV8AMLK+R X-Received: by 10.101.81.204 with SMTP id i12mr3450723pgq.206.1519238342577; Wed, 21 Feb 2018 10:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519238342; cv=none; d=google.com; s=arc-20160816; b=mltNhpv0lY8MNWY5bdAf3lVHP2KwHnr9JaHQwRyfX6t1P6/5a0rphbbN0pHm8pkgII wsnCv5SHHKBIIR+gWmH8WtPuJNJRb15vQ9YCtVWjT7DfpSWJUovbFMLyNAgiDZebx8UI dLBcjJ4zm3R8shpO3ngF/laWo23ghLmShln7tLsuTDwXoe60D8gbDiREPTgu298hz2r0 edCt4rorLi78etY2q160iQwpR/1IsqAos2iORrcnGnBHCR4U9NK2IQb80LRQ0GjtDhY2 IPH+qPm7Fm3skX92+vSNqSYv8qsZUyMnMZfg6qOBOqH02o6Srng/mfrfV36qQzSG2evG tPqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ak6so3SLMJtp98VgF/G4OVtPUE49Oicpl2zh8QO+icM=; b=cDUDdi2nuEeViz+2i4Oc2zYsgVwEbruyWOkAPaFeYW7sJoFyfH6BaYwZYdkU8Gh0x5 A4Cv55AmbUxFNJd75ydCYHTBjc+hjylsMHH9lFTAlB6UfRX05TKVsyX+cQMyoBc+MuTn he1Ei7zoMcz7/DO/x3NVzu8RU8YoXnHkXNIHBwkdzp4ED+6vwOK9FLHpIhNfpcg+kt53 avs1tTDvy270fatPMS4RiLrfdulX55rGlU+K7CYzGTvVM91uPWne13/8zT16Qy2g5pqw Lo5NKk5DPHu2qirmJ+uhHyP9yAFBgScUQ5daZAXj2c4g+GyC6WRWGdEMFqT5niptDWqs tKQQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si1511872pgq.674.2018.02.21.10.38.48; Wed, 21 Feb 2018 10:39:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965615AbeBUNMd (ORCPT + 99 others); Wed, 21 Feb 2018 08:12:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45712 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965605AbeBUNMb (ORCPT ); Wed, 21 Feb 2018 08:12:31 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DA8CB1076; Wed, 21 Feb 2018 13:12:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , "David S. Miller" Subject: [PATCH 4.15 151/163] mvpp2: fix multicast address filter Date: Wed, 21 Feb 2018 13:49:40 +0100 Message-Id: <20180221124538.356378054@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikulas Patocka commit 7ac8ff95f48cbfa609a060fd6a1e361dd62feeb3 upstream. IPv6 doesn't work on the MacchiatoBIN board. It is caused by broken multicast address filter in the mvpp2 driver. The driver loads doesn't load any multicast entries if "allmulti" is not set. This condition should be reversed. The condition !netdev_mc_empty(dev) is useless (because netdev_for_each_mc_addr is nop if the list is empty). This patch also fixes a possible overflow of the multicast list - if mvpp2_prs_mac_da_accept fails, we set the allmulti flag and retry. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/mvpp2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -7127,6 +7127,7 @@ static void mvpp2_set_rx_mode(struct net int id = port->id; bool allmulti = dev->flags & IFF_ALLMULTI; +retry: mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC); mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti); mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti); @@ -7134,9 +7135,13 @@ static void mvpp2_set_rx_mode(struct net /* Remove all port->id's mcast enries */ mvpp2_prs_mcast_del_all(priv, id); - if (allmulti && !netdev_mc_empty(dev)) { - netdev_for_each_mc_addr(ha, dev) - mvpp2_prs_mac_da_accept(priv, id, ha->addr, true); + if (!allmulti) { + netdev_for_each_mc_addr(ha, dev) { + if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) { + allmulti = true; + goto retry; + } + } } }