Received: by 10.223.185.116 with SMTP id b49csp5454375wrg; Wed, 7 Mar 2018 12:02:56 -0800 (PST) X-Google-Smtp-Source: AG47ELsf69lMs4/5heZ8oh3TQkXxzTNKKoUzEZAQeqJa33qcrJvgqVotT+K9ExVFqZ/jLWOmB5VK X-Received: by 10.99.145.199 with SMTP id l190mr18432410pge.397.1520452976197; Wed, 07 Mar 2018 12:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452976; cv=none; d=google.com; s=arc-20160816; b=a96i7Na8QzmxNDaADeg2aYwh/wvBwUugYf2Y7v6x567kCqjKNPLU9163u9U2janoLg f0slFqI4U0IKEEHNwVUJXhr6YTSW2KYlnctWU4e7PhYVma2gIEZln4ML/S3x1DQxTRmW kvHQph7+V8YsL/zX8dtexwOtCNYH6jl7asb0dINVqdXhuvw8p+kSbil+ouISFD2lnJ2V aVUsfZqK11nq2u8NRk4gmDC2wAtV6MiWaloEoF64pE1Ax1MC/QGJNfgVMZaycVRCo5xa abDgXG5VRQBGf8Pv0hmAcdFLu/dsIyknFewWTWr86xQCnA4qfCNqBJhbzERy8r5axBnO dGGA== 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=Tpr8rUE4P2FMKdEeqozeI8ZBAi7YnoUeKg7QT0cubFM=; b=SNknTxL2QQkIwdKal/dQK5cT03jgUpyguYEqVPr6SVKkxNWB6Te+zX445fgL1Rqoxc R+mFvwVpAP7EEEIYrrmStroq/oMeSN67lcHLn6zp5rC0qFjRvhpnxKkBdS+Y9KqkM4kh ClmZof2tm6Uciwdfh+RXCH5EPMDfqxPdnb10GUnVhZ0MxxKeFzHaFunKHDS3C4HNOIFk mdaNkXdgbaTSC3sTV6j8X0srQ82fp9yZCNP4y/85o/v/jmSKY/evN3MNzfOIv9ZIixu9 DAyDIwNUHdQjRfIjUbYIwc/5c+43m2LZ8o1drMnGYDD4uLLaw0v3SWc9oP8OW5TwXBGD acZQ== 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 k131si11784592pgc.361.2018.03.07.12.02.41; Wed, 07 Mar 2018 12:02:56 -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 S1754859AbeCGTqv (ORCPT + 99 others); Wed, 7 Mar 2018 14:46:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44754 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965606AbeCGTqq (ORCPT ); Wed, 7 Mar 2018 14:46:46 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A17C410A9; Wed, 7 Mar 2018 19:46:45 +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.14 069/110] mlxsw: spectrum_router: Do not unconditionally clear route offload indication Date: Wed, 7 Mar 2018 11:38:52 -0800 Message-Id: <20180307191048.449350680@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@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.14-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 @@ -3032,6 +3032,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];