Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11789110pjo; Thu, 2 Jan 2020 14:18:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyckBojD+ZjkT/MWsvkbyW0ana784NHaHdBTIMNE/AbYsVxHkwFjJHAh0AKKBb74dUC3zzJ X-Received: by 2002:a9d:6c01:: with SMTP id f1mr89780901otq.133.1578003507266; Thu, 02 Jan 2020 14:18:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003507; cv=none; d=google.com; s=arc-20160816; b=c51kmdoSCAV6bxMsPKn8n3LztRUBEPuotzXW56lSVeU7LXN7fHFv9mDdBsbrhPleSj Ji2S111FWouNUVByi8Gn3A1dCIN2CTRTe6ao2DAHhNT55AJz9AZ+ud7PYhlJcfb9Ti2i QSN+Wa7r2kXkxNGfLRzpgLtxzLcdWG+TvNq8wYsyIpQJ3k4xl1eGU2DrAfeDgNF8kM19 cd5Ya/cOIEXjYwihhHR8TfEf4RTCtIYXhD3D2jbdz2odGc2GHO/odM8bxf67fMPV2g7A 0rbQlwnJzEg8kvti7rWpKaJfNqgtvjq9lYBahDQlCOxnbRu1mMGJxQvzxGCJtxiDm4Qf 2/gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jxeEIoZGoOfIHK3UpfQgEHIXV20HPX0OAYVdFrH+4nw=; b=JirnIlYn9SrumFdvto//FPvtslB31rz5i0IAPpW85EMUmr4BKbWgsNrrWezuyw7FVN IYdk/heMvsZj2VNKKZKr1MQfJcq1mg5dnpg2C/kwf/VAD0hwM9BU89MZRcCR38cnVSCZ GEaJISUAeG1sF1OMA2TfkDPK6lmDloEAcbeNmVFX0OeDv0yOjxLCSo/repmXh1pjXRPz Jl2oeTEJEt9Z+g039vHbDW6iOb/lUCD3b76MYm0tMm3Kz/mSKNPnWOvT4Hgba06ScSki /Jgt/I/LDNwaVyRUf1UC0cBaN37DFXU+WIKOI8h4CDEinu0sYL4WmQI9+AbGfGYtvbD4 wacg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BQ32KbMf; 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 f17si25937920otl.181.2020.01.02.14.18.14; Thu, 02 Jan 2020 14:18:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=BQ32KbMf; 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 S1728178AbgABWRd (ORCPT + 99 others); Thu, 2 Jan 2020 17:17:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:60012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728168AbgABWRa (ORCPT ); Thu, 2 Jan 2020 17:17:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5674A24125; Thu, 2 Jan 2020 22:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003449; bh=xZQLgMunRJyO2nb4wPwgaz0jgqxLQJDMF+Jhyi9R9Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQ32KbMfUJQNc2DW5OMcW7xVdI2i2UxJk41W1VMJmS8u1o3q2lf3NlHbqPzovajWp li+r8/BR7X27x2E4quUInI9N0T2XPPj8zgKdPuNr0XYFgv5LW22GHWYwQVczL35mIW t/uwe++I1aYwXEIg1rMewIlfJ6s/elixW2i62YyA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Cohen , Ido Schimmel , "David S. Miller" Subject: [PATCH 5.4 165/191] mlxsw: spectrum_router: Skip loopback RIFs during MAC validation Date: Thu, 2 Jan 2020 23:07:27 +0100 Message-Id: <20200102215847.025180886@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amit Cohen [ Upstream commit 314bd842d98e1035cc40b671a71e07f48420e58f ] When a router interface (RIF) is created the MAC address of the backing netdev is verified to have the same MSBs as existing RIFs. This is required in order to avoid changing existing RIF MAC addresses that all share the same MSBs. Loopback RIFs are special in this regard as they do not have a MAC address, given they are only used to loop packets from the overlay to the underlay. Without this change, an error is returned when trying to create a RIF after the creation of a GRE tunnel that is represented by a loopback RIF. 'rif->dev->dev_addr' points to the GRE device's local IP, which does not share the same MSBs as physical interfaces. Adding an IP address to any physical interface results in: Error: mlxsw_spectrum: All router interface MAC addresses must have the same prefix. Fix this by skipping loopback RIFs during MAC validation. Fixes: 74bc99397438 ("mlxsw: spectrum_router: Veto unsupported RIF MAC addresses") Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -6985,6 +6985,9 @@ static int mlxsw_sp_router_port_check_ri for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { rif = mlxsw_sp->router->rifs[i]; + if (rif && rif->ops && + rif->ops->type == MLXSW_SP_RIF_TYPE_IPIP_LB) + continue; if (rif && rif->dev && rif->dev != dev && !ether_addr_equal_masked(rif->dev->dev_addr, dev_addr, mlxsw_sp->mac_mask)) {