Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp979914pxp; Wed, 16 Mar 2022 23:19:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1n7OtYlDnaRU/bSzyhZ/OPo/9pE/GRIvE26ooJ7UtTC+fEHG3Itx+xTs/22/Kyr2CfCvb X-Received: by 2002:a63:8ac9:0:b0:380:8d8b:d01a with SMTP id y192-20020a638ac9000000b003808d8bd01amr2395353pgd.572.1647497968942; Wed, 16 Mar 2022 23:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497968; cv=none; d=google.com; s=arc-20160816; b=Yjp4cLPS3rNvNBK/95D9tK6/wyUS5KlpuPKEOc67KjYLPtCwEp2F4YlxzVDLRjEM2X T7y8U2FnTjhjXZjjt61qIsE28aK4sJN/jf+GV3E4yPuFggaC0uNPIXybHYdoO2ZeXtAY d7v1xYEX4dUMNCa39WjcZenqg/da0UWz0yiv/SQyTc2lVV5gn5D3g9hJANqdu8uitS51 9hbnppi3qYuHZyUF2/fH354KbLjQ9plmHBFL8c/LSWDn/ar2jgbVXIgebldTKsWedn7x RjR+cZ68nIOyt88F5KYXVPlebhaD7Awe2mjDYq5cQVp3Nrb+oPk9sodL5GJe3KQc4qIv w/1A== 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=HcrbuN0hegLvzt2voJr+w5Kbu3YsTLt0VnzZL2sJ6dA=; b=OuhuZFm1sOkCBr6kMGWthmin18GUKwXZWH/ZlW0mccQQ7OlBWj9qaU6yhlB520UpQY laYQacurAgCpeRcR4cavl/uJjelyyPbUMIuKndfRTHjOpnTF6A2MOFXR6XPrWg+PR+t/ 4SbxtJavmRsKq42taXmNWYBy5snEarNF54N2W+ajuaC468aZaXMj9rxzq7Y96ZS0AhD7 hobHEcA4/y8QJqg/b3HN95kTS5jsgr51MJzK/iAlVAGKcnnbYOAw2vNIbeHz6wmYQCRH AtmGxHbA5xAaREjOdYNnk3cYdGlmMlTsOAA3UqhyavMMiHGV4xfM0fvdJ4v2EVMlRCaO IziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WBsgJsIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n6-20020a17090a670600b001bf5f79a780si1470270pjj.44.2022.03.16.23.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WBsgJsIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D589D1AA8E0; Wed, 16 Mar 2022 22:04:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243287AbiCNMaq (ORCPT + 99 others); Mon, 14 Mar 2022 08:30:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242757AbiCNMTi (ORCPT ); Mon, 14 Mar 2022 08:19:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3DE50067; Mon, 14 Mar 2022 05:14:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ABB5FB80D24; Mon, 14 Mar 2022 12:14:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE3CAC340ED; Mon, 14 Mar 2022 12:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260070; bh=J+Mcl10zyPpXgAkuHU6RkLOihHsQk3ZLF8tcHkwuWgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WBsgJsIrSFBgjPMSEYEJiShDWqmAjyuAzmgWFwJesMBkvcr8SHgsaBTLC1Oo2L5f7 eBvlt9DqiFrtfLkkXT8hKBXUc9nRw7c//aYu9GSTVb2YxyIkrlFu+8CuhV752oPIGg ZeNpuWJ0bpg3VrfSZcQc9EpuGzCbH7xwQFReCvYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Maor Dickman , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.16 047/121] net/mlx5e: Lag, Only handle events from highest priority multipath entry Date: Mon, 14 Mar 2022 12:53:50 +0100 Message-Id: <20220314112745.440328160@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roi Dayan [ Upstream commit ad11c4f1d8fd1f03639460e425a36f7fd0ea83f5 ] There could be multiple multipath entries but changing the port affinity for each one doesn't make much sense and there should be a default one. So only track the entry with lowest priority value. The commit doesn't affect existing users with a single entry. Fixes: 544fe7c2e654 ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c index 1ca01a5b6cdd..626aa60b6099 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c @@ -126,6 +126,10 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, return; } + /* Handle multipath entry with lower priority value */ + if (mp->mfi && mp->mfi != fi && fi->fib_priority >= mp->mfi->fib_priority) + return; + /* Handle add/replace event */ nhs = fib_info_num_path(fi); if (nhs == 1) { @@ -135,12 +139,13 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev); if (i < 0) - i = MLX5_LAG_NORMAL_AFFINITY; - else - ++i; + return; + i++; mlx5_lag_set_port_affinity(ldev, i); } + + mp->mfi = fi; return; } -- 2.34.1