Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2731547pxj; Mon, 31 May 2021 09:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaISItE+ZEp9mV9FWNrtOnwTxU26S9uvDNGMXB/uHODALbV5qgJIqeNENDhbZkqAxp1xZX X-Received: by 2002:a92:7007:: with SMTP id l7mr17174444ilc.226.1622477940347; Mon, 31 May 2021 09:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477940; cv=none; d=google.com; s=arc-20160816; b=jsdPBssQ3h0HEj9QMlGCGP8BMeWpnB4J6pPuizrXQPeEiYHEtBRtnrukeGBN21+qcx Nmzxq0D/V7FPuvLpIfv7AvqYl9STWXEXraEzWlouOEPvk0PY4xcCKwbbXYbkpRDmg9vm a/vPd5pmU+WZl1R4Y/oaQS7+tXFVwIUHxqbX0LvTRB4ijVAuYH9a5mhEFDIIV/LRqMhm Ulo1TKfQSTLl+lLdVkCUf3h5QVlJIBhVKrdhI2xQoG6xvZmCN+Z6zylFcL/bFFdv1IFV 5lVuy2v5TErSzr1k/jrKoa6DUWOaoE43+GGmoF/HeByOkqhdXqag8XVhKukCwGSekeWJ Ay+Q== 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=rRtSUQq+NQOLwyIesQQPBIvQPDdaQYqcxIqbkwagpkU+oSFv7mtWJanOKEw0cEdknB sxXB8Dqtxs1a7+9kdluUx3amqW+UY3E5pJC0aysJKIPsnEUIJIHIY7xC9dzR+kYYv++B TwirdP6nwA79x6cuEFlSHHZvMmXSWEP191bDg9Sx4wg8sd44eJe7cNKgy3h3EOO4MzuJ 8CaLTxrbzuxkpTPcNEfnLRRogvBBG8b0FyoE25+YK/R1xIr9NOXInEi5FAbuESBWu42T 3rMWZDwmYIWBcv/Yu/h146gc0fSjavBte+uf3peXrVE6yTgDlTcNf5iqLF/0Ifoh00Fo 2EVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l9pK5Hgz; 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 c7si14833563jap.0.2021.05.31.09.18.47; Mon, 31 May 2021 09:19:00 -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=l9pK5Hgz; 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 S234593AbhEaQTS (ORCPT + 99 others); Mon, 31 May 2021 12:19:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232361AbhEaOli (ORCPT ); Mon, 31 May 2021 10:41:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C8946191A; Mon, 31 May 2021 13:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469232; bh=RLc5HdfSuRXEJT6fKHrR0akzAXP6BjMfCmZNsOjN9DE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l9pK5HgzF+fru0hL9cXkiY29f3gc5qZjalbz5w2e0ESJ+UJ+spBpW49HrTfjQbiJH nvhu3uSaZwRvZaNdwLs7AFfTaUsN3Be+HolOda8RmAk+h0tbfFFaE1buFUUr2rrqSC aOhhpW0879iMCQuSrmzV2GGNtx/wqcBYhQ/4wZjY= 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.12 119/296] net/mlx5e: Fix multipath lag activation Date: Mon, 31 May 2021 15:12:54 +0200 Message-Id: <20210531130707.916635764@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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; }