Received: by 10.223.185.116 with SMTP id b49csp5476949wrg; Wed, 7 Mar 2018 12:26:16 -0800 (PST) X-Google-Smtp-Source: AG47ELvFMLJr76+hjTiRYzCnjYXYet/MpkIPT1COCGoZudr8nrwHKp3DktDAol33Yf3UceC1ywYV X-Received: by 10.98.131.4 with SMTP id h4mr23687077pfe.156.1520454376295; Wed, 07 Mar 2018 12:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520454376; cv=none; d=google.com; s=arc-20160816; b=nDpMnaXv+ehpOezF/ZEgf3q15toktIIqJ2eZHTJU2J9LVdirnoUdxrZ+3QyLAMsuA1 Yt/ecwpZcBc/MnHgp3ZN2P5QO58kVOcV51vliWm95HDtUn1ogt8ttEg/ktPkMtorrQ9B Wq7JmIiZO6M8VNgy1LtWEyvVFgR4mX/hi1yl+ZJKzPYUVIfQIDZbep2v8URK/4YHra+c vKBowz4x9dNKcwpqvaZXHcOl46q3bTc1wnnHei3zgGuY35EpN6xOYZ42eCjvoTyqGVjq cF9N8bZs2/oKsA6Tib8n8HMcv6x1ZEFgQdykjOMBTCvhXF+9vctWoZ9gizFbMT9XfkZN XUFA== 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=6GmzlhQF/78W8ctpvsm1SuMudk71HrTHzFPjv6MuDIc=; b=ANjoKBq5dqcWtY8cdkQAw//6wtgPEWimhLWo5cGZMC1VF3Vp0KgoOQbzEWNB3npbPx 3LyvikBIduOWFD+mdJg8/LxAPLEQojo1zm7XVEHc0BfivnZq4uQIE8qePUCuTFseBZOV Xl8MQSPcxf9KqH0UNDyniWgdAd/QNqSPYkC4xNnBkN8/UsJ/evGsvtx0CCit6JcikNyI SXCbLKY15GOwxtexIy6kiGeZ+6V073x0f4b5M3rKI3yjknjOaFHSmr9HDerEy19n96Il d2LDsgWKFptvbIuhQld70BWhkQsRPCh9lJKY5Q49i+5QKWVnelxk40qsBHcNAKKPUrNA U+jg== 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 b16si6366361pgs.810.2018.03.07.12.26.01; Wed, 07 Mar 2018 12:26:16 -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 S964946AbeCGUZG (ORCPT + 99 others); Wed, 7 Mar 2018 15:25:06 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42730 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933537AbeCGTnW (ORCPT ); Wed, 7 Mar 2018 14:43:22 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BBCF410D0; Wed, 7 Mar 2018 19:43:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Alexander Petrovskiy , Jiri Pirko , "David S. Miller" Subject: [PATCH 4.15 073/122] mlxsw: spectrum_router: Do not unconditionally clear route offload indication Date: Wed, 7 Mar 2018 11:38:05 -0800 Message-Id: <20180307191739.900424076@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@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: Ido Schimmel [ Upstream commit d1c95af366961101819f07e3c64d44f3be7f0367 ] When mlxsw replaces (or deletes) a route it removes the offload indication from the replaced route. This is problematic for IPv4 routes, as the offload indication is stored in the fib_info which is usually shared between multiple routes. Instead of unconditionally clearing the offload indication, only clear it if no other route is using the fib_info. Fixes: 3984d1a89fe7 ("mlxsw: spectrum_router: Provide offload indication using nexthop flags") Signed-off-by: Ido Schimmel Reported-by: Alexander Petrovskiy Tested-by: Alexander Petrovskiy Signed-off-by: Jiri Pirko 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 @@ -3765,6 +3765,9 @@ mlxsw_sp_fib4_entry_offload_unset(struct struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group; int i; + if (!list_is_singular(&nh_grp->fib_list)) + return; + for (i = 0; i < nh_grp->count; i++) { struct mlxsw_sp_nexthop *nh = &nh_grp->nexthops[i];