Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2657549pxj; Mon, 31 May 2021 07:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGKfhVFrajw+d0byhOqYrfEUzhBe94B4k6N+Xj4cJmwmDgtN+6GPPQUtztsccFB5Facxji X-Received: by 2002:a17:906:6d43:: with SMTP id a3mr23315167ejt.142.1622471653599; Mon, 31 May 2021 07:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471653; cv=none; d=google.com; s=arc-20160816; b=m7ylGzuengkQOBXQpSXC69oB04yQql5386ivo6jsvGnMtJ3BgvQZBJwBayoPGXcSkA RvCs3/Yjs92BWeMkvssNUMqAMb9zJ58yLPXvooxr0sadSeWkDagh6ucw6adPgY/+l97p qP/Qmdl5bqIaY/LREmCpWTU/sax62idcx6nxke3nHthBVDL/LDV7zNVkDtYNhrnFBu3g MmLLgRc3F7jr0nXx4qP7+dZ2c1TBCCqtbA+0CdL6SupR7JQ29+NMWVrGzE9ayZkatcXP Ul+6z+XvixysA6aoo9NtRYrM36QhNcn+/UiK0ctnZ6dZApFCjMEBv4zwTwSq24ZAKEnN 8TOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GaD431GiieeBOkyINU+Qw4ZaRgYCSQCxpKV+D4gVLgI=; b=sHsSqOvyvMFxcHXhoorApRsIzU1J8MCanmeTNYJk1hxuatXsuEMMG1nz9ok6UfhMFC uW3qBF0j0vx0owXIsK1SI9Qs65k2ne0EMWGa+wx66Gm5fjPrUXbbC1oj0ohEwfhJmQYg qcE9z/ZznZReRy/7bnz9SQ5P8T96hakBgfyv0sMpt3w8P5doZgnwA//Ub8OmlsK6EJYY auHoOFrhlDKSRhiP5CY8SgEOnan5SfNqpqPj0NZOBu8dg21XQckCF4R7Td3Vap919mvw u3MoospDIZaH+oPyH36IFcD6ZnujGgSShnmCzBRTwcNeSW96ldHj791yfcf9SrUzHmsw DHNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xVSqywR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si8369977edz.576.2021.05.31.07.33.51; Mon, 31 May 2021 07:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xVSqywR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234170AbhEaOeW (ORCPT + 99 others); Mon, 31 May 2021 10:34:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:59856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbhEaNzT (ORCPT ); Mon, 31 May 2021 09:55:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0EF5261921; Mon, 31 May 2021 13:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468051; bh=RLc5HdfSuRXEJT6fKHrR0akzAXP6BjMfCmZNsOjN9DE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xVSqywR4caDJHGKGk8wKaGpZYydvv+rSaaZXSMKqNM1yOojdx0ECF/ADRkIBWLzfx ZVWvt+m+DuCkADPp9bcBY3eYtGmvjW5yhKsGPUE87i7UVmRPhLZ2c4xoFuRtXrAaMu mP8lZ/qc4j3JUzT+yg/09y/qkvZh98s/QB5rPN3Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dima Chumak , Roi Dayan , Saeed Mahameed Subject: [PATCH 5.10 098/252] net/mlx5e: Fix multipath lag activation Date: Mon, 31 May 2021 15:12:43 +0200 Message-Id: <20210531130701.310427606@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dima Chumak commit 97817fcc684ed01497bd19d0cd4dea699665b9cf upstream. When handling FIB_EVENT_ENTRY_REPLACE event for a new multipath route, lag activation can be missed if a stale (struct lag_mp)->mfi pointer exists, which was associated with an older multipath route that had been removed. Normally, when a route is removed, it triggers mlx5_lag_fib_event(), which handles FIB_EVENT_ENTRY_DEL and clears mfi pointer. But, if mlx5_lag_check_prereq() condition isn't met, for example when eswitch is in legacy mode, the fib event is skipped and mfi pointer becomes stale. Fix by resetting mfi pointer to NULL every time mlx5_lag_mp_init() is called. Fixes: 544fe7c2e654 ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events") Signed-off-by: Dima Chumak Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c @@ -307,6 +307,11 @@ int mlx5_lag_mp_init(struct mlx5_lag *ld struct lag_mp *mp = &ldev->lag_mp; int err; + /* always clear mfi, as it might become stale when a route delete event + * has been missed + */ + mp->mfi = NULL; + if (mp->fib_nb.notifier_call) return 0; @@ -335,4 +340,5 @@ void mlx5_lag_mp_cleanup(struct mlx5_lag unregister_fib_notifier(&init_net, &mp->fib_nb); destroy_workqueue(mp->wq); mp->fib_nb.notifier_call = NULL; + mp->mfi = NULL; }