Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2700997pxj; Mon, 31 May 2021 08:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYEgGDtFz8QKeu8UI6exgKD541QJFSqSIwwox2B3Ct9whopQ2OzHHaXVwDlZvf1X9zjuWt X-Received: by 2002:a17:906:b2d6:: with SMTP id cf22mr9878706ejb.29.1622475298183; Mon, 31 May 2021 08:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475298; cv=none; d=google.com; s=arc-20160816; b=H5/L6tTOF5nrR/e8eJl0UI0MkP0ZhCaMXG7NcIcvWzJt5I8fNWaw8gA25c1dR5EegO X3qzrhc9596BIAGulReXemJ0hE/LKvq/Bo4//dywr3lA2EH3wtn7ByW/h7Ube1D5/yBS Rk7tBb5Gh4fHfW2rqLH5AlDdpPI1Qr0Cce76cjZi2uicwSdRXW8i9kzzG0LpdW8xxt6O 4Jw8TR3YvWZfe+TiLf0pOw6WZngJa8zEErkzMEb0H08QQzXjOf6Fi3RYPu9V+X9aycm2 QrJ3jTIkiiExtRukzUKI48tL2BhpH9e0RkokGgG9ICKPIbJpeWojFPb+lNpTpVa2Sy3X QjmA== 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=LhT2LNvWA6zucpfRYxtvH1GObQ+VNjE/nSRWtV9txtA=; b=CuNqNYY7njzctOC+fTDUqRHSovlwHARbRw5ptcQrw0xe1Vp0wunC4uQ5001XAkD+RH /xyx9lwfEmhLxSy6TffAv7b7irmnKeWNaJ96JCKeizXZ4H3s00gKXRbbOePry380om8R +akyP5htYw06ABQKXKbO9r69706NfT1A9gDBbtj8hyNXSwzeKsp/IjM+O2hcqbvaSUMv djZ9JLXtOX2/QpeQPFhZf9BuIOtNjycVSBAQWpAFU6p81eD8FR1UrbAwad9d84Lu9doY 6vgDHQ73IF/LGrmlZoMQQaxfRd8Rt1LFyfFCJWoWVEzYJYQFg+URqbXSDNHC5PAQ3JFe TsZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wr0CGvjh; 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 d10si8907526ede.460.2021.05.31.08.34.35; Mon, 31 May 2021 08:34:58 -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=wr0CGvjh; 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 S234363AbhEaPdF (ORCPT + 99 others); Mon, 31 May 2021 11:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233482AbhEaOTH (ORCPT ); Mon, 31 May 2021 10:19:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 81308619B7; Mon, 31 May 2021 13:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468649; bh=zH5zUuwgFW9ZZZXgIpNcKq6XZaHbmZk4BtIuoV0z7ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wr0CGvjhFSaya2nZCE7L79IRFdXipemyxfHb51NA0eS4kEjuKO1LCM9M4vMU9pUSV ZrDeOaeaGQJ+NrsvgCfyqhEQsRhINfwEKZQnTtz56ZR9WHGy6a7qhCQWwPC1de5ThV bkfmxj0beacPW1x5GJEUzvCN2p82mQWxWqauIz60= 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.4 072/177] net/mlx5e: Fix multipath lag activation Date: Mon, 31 May 2021 15:13:49 +0200 Message-Id: <20210531130650.387543693@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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; @@ -328,4 +333,5 @@ void mlx5_lag_mp_cleanup(struct mlx5_lag unregister_fib_notifier(&mp->fib_nb); mp->fib_nb.notifier_call = NULL; + mp->mfi = NULL; }