Received: by 10.223.185.116 with SMTP id b49csp972178wrg; Wed, 21 Feb 2018 09:54:15 -0800 (PST) X-Google-Smtp-Source: AH8x225/DRGwtMxwBoLPXp/ZX2ZGBKvNFlFOX5ZpOqiVWQ/Bpw2O2ie0xEARWJzcYn+CNxjD2HDK X-Received: by 2002:a17:902:d891:: with SMTP id b17-v6mr3770022plz.241.1519235655288; Wed, 21 Feb 2018 09:54:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519235655; cv=none; d=google.com; s=arc-20160816; b=CE++2P49L11dB0N4kpKwOCumkh5SLbPSGLgmoDfOkAATDJgnhhUGWiG7X+G877Urh4 BEMUWw30m7zTh5du+gKrF9FYCYqJeTutO9Dklf17EdtesVX9ORpHKD9slT3iXOtsXA3W GSe6+f3B0qzVkSv4v6c4sEYs19+3UyQNkO+4nuZnvsikzaMaQUoSqPxUxK2St4Un4zTu TTN59qtp+18QxBXb7WNCjW1Ba6Oa4+C0G4z0F9zvnWOLYE00TANTB89OC3mxtFJIvPek Jsa0uGGoEhxJrfvDS9FUdSD9DvtDP8+6QSzQ4Gzf0tFTsbI8IwvhL05ERqlGXeMRcq6O y7Kw== 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=L4RVWN1mfubz3WsfTCYt/xthMB6z6bvzAcC2bBr5tRA=; b=l2UAC05GO1f1mhZVAAeH7P0No1Qt3y+VWPHthGQBRMG88M23ZyAB00v761zkmkiT2Z Gv0PNcNj4PppMCZpy0duK6fV/yddvilhJQRSC0uGy4HfmoofhXFOwapUh1zT9LSYA9pm 7Hcsaf0++I+7G4zJAZKuV/I8R59Mo3zp9OPFdHh3CxppJiKMhTTeXckVZse+WQixdjk5 KEM65b7DlMyejnkhEvDDbID/ZvinSeP5ukWs3RQBD9sgz1RzUqA7HUca6StFpLrX/HH+ V35kP4kBuhdoR2ubueBUAyYm1eqa2dlUjS+XJXXtsBBJeADhSnC6ZU/oV5aIALeAdgxd nVzg== 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 y13-v6si156712plr.10.2018.02.21.09.54.01; Wed, 21 Feb 2018 09:54:15 -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 S934258AbeBUMzX (ORCPT + 99 others); Wed, 21 Feb 2018 07:55:23 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34396 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932659AbeBUMzV (ORCPT ); Wed, 21 Feb 2018 07:55:21 -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 097471110; Wed, 21 Feb 2018 12:55:20 +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.9 31/77] mvpp2: fix multicast address filter Date: Wed, 21 Feb 2018 13:48:40 +0100 Message-Id: <20180221124433.501918970@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124432.172390020@linuxfoundation.org> References: <20180221124432.172390020@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.9-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 @@ -5657,6 +5657,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); @@ -5664,9 +5665,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; + } + } } }