Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2965735pxp; Mon, 14 Mar 2022 08:16:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2X3VWN6Pwomlx5SOIzHz+mMqKk3+vtkC8mawu+TAbETBoS4rpnnK9NjN7nqynNo1Kvbcq X-Received: by 2002:a54:4197:0:b0:2d9:be61:f577 with SMTP id 23-20020a544197000000b002d9be61f577mr15355297oiy.271.1647270960601; Mon, 14 Mar 2022 08:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647270960; cv=none; d=google.com; s=arc-20160816; b=syMpt50rE0+ZFdlgMpM7x/KqlFmlsbpF26ramKbGheXrH7TEFLxmwZsP+TnvOVeJRs RrfR3MnII8RP9dfyX50XygARNaIZH10q/kry28+C1Mbj4iNy/+ZuiiWVplil4J8GLf3O 8DHCAal6o5mkqyc0gRSWOqMJT5PtBmHgK3p+0AhANow8xijKU2AvXUUklYSakBsvgBEB H7ty7FqusSbOjSKWsXuz07YeLjhGr6srr1RB8qm6GAVsaYeu5eer17kd00ngX91dEOTw kqbmiAz1ot+Uzzf6dBJEB8EvCDerDlDZa2KVSc91njcE4ULAMKUFXud99zIGx2hlCQVz L9YA== 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=T99O5P4K9HhsOc3PjkmiFroogYvfzpKUEE7dyII1oCM=; b=pNjhzGx9Q418/1crVObk1Fy6wp0pr2c7oy6t12SeGwIVNOQGZRXVErlE/zNJvQuVVZ ABHLAt+mPXu1wgCwUM1YLOML2OHhv94C1teI61onlxAD3VokUG1UkGlvVwK9u8pXYp2f JQif5YqgXa+gxSySXtDP9mRoSM4SPyYeZmYfIlBaZ5DDwDQZPCY676M4oNmXFjcUETgM DancQtHVRR4D2Wjcqc0V4HqNWoBNGIc4UNk4qzRPhSpADI94my20HqY9zgS3jthOS+Yt pseolToc9MQpIf1uUN+dLgEd7UZy+VEFlnf9zDocHOMlVAnTm9wFJYd0zpdHAr/z7pZA zk8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWfaHR5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020a056820050c00b0032413e7bf58si4378960ooj.59.2022.03.14.08.15.47; Mon, 14 Mar 2022 08:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWfaHR5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241367AbiCNMSB (ORCPT + 99 others); Mon, 14 Mar 2022 08:18:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242004AbiCNMJa (ORCPT ); Mon, 14 Mar 2022 08:09:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDBF6506DA; Mon, 14 Mar 2022 05:06:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7BDDF612FF; Mon, 14 Mar 2022 12:06:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E729C340E9; Mon, 14 Mar 2022 12:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259586; bh=Eb3QsL3Gokqu+VNIPcIeAZHx3c4CIYro4yhWODlIKHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWfaHR5QOyD/FuJZ3No/98Iy/YaRcVTdcPA5SIvLirsxxWyBzbv05U2jJd6jvPKwy FjQY819C7KkkQYyohzhMeuAOl7H0DO9liMjxkpduXGh6VvHbw0AXgT6oSg6ERYnzpO SisRgbU5Jr8x6Pu3wf8hr6qtbwkZT4xq0/I7r+6Q= 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.15 042/110] net/mlx5e: Lag, Only handle events from highest priority multipath entry Date: Mon, 14 Mar 2022 12:53:44 +0100 Message-Id: <20220314112744.212409403@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@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=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 30282d86e6b9..cb0a48d374a3 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