From patchwork Tue Jun 6 07:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13268361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62511C7EE2A for ; Tue, 6 Jun 2023 07:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236060AbjFFHMz (ORCPT ); Tue, 6 Jun 2023 03:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235906AbjFFHMd (ORCPT ); Tue, 6 Jun 2023 03:12:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04015E7F for ; Tue, 6 Jun 2023 00:12:31 -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 7027962DA6 for ; Tue, 6 Jun 2023 07:12:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3DE7C433D2; Tue, 6 Jun 2023 07:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686035550; bh=LvJ3Nqcwx2ubTY72fUCes0Oz3BY+iZ9j20J0IG69fCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cZUhdFYvNzdOuokcbi7lpllfMb+RBoR41UkANJsb1/b5Jf1kz4SCveTA4cTfnwW+e KFcERgf9+pBd8WeRNFsgGnxHEk3v28fz+3Ohgp4PtENGTS8V/XZCg2/yCiYWDObE0C qYhNrDw8EJatfWtP8p5halQGcKUdzN+ewshKcV4G3IG3lky8AGzET97QLD9GdwEf6c zcGeQGqiACnSfD97WFz1YQ1KK3x78xkDCxA6zwW0UzU3xdLyqHHK9juvvsfCQicEoI M8QEQgGNh9uaJe3yxUeXu5ubza25d1c7agKaMdnQfz+7wlN+HvSItCMYKUNFMq+sip iJ9db1mwcClgg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Leon Romanovsky , linux-rdma@vger.kernel.org, Shay Drory , Mark Bloch Subject: [net-next 01/15] RDMA/mlx5: Free second uplink ib port Date: Tue, 6 Jun 2023 00:12:05 -0700 Message-Id: <20230606071219.483255-2-saeed@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606071219.483255-1-saeed@kernel.org> References: <20230606071219.483255-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Shay Drory The cited patch introduce ib port for the slave device uplink in case of multiport eswitch. However, this ib port didn't perform anything when unloaded. Unload the new ib port properly. Fixes: 27f9e0ccb6da ("net/mlx5: Lag, Add single RDMA device in multiport mode") Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed --- drivers/infiniband/hw/mlx5/ib_rep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c index ddcfc116b19a..a4db22fe1883 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.c +++ b/drivers/infiniband/hw/mlx5/ib_rep.c @@ -126,7 +126,7 @@ mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep) !mlx5_lag_is_master(mdev)) { struct mlx5_core_dev *peer_mdev; - if (rep->vport == MLX5_VPORT_UPLINK) + if (rep->vport == MLX5_VPORT_UPLINK && !mlx5_lag_is_mpesw(mdev)) return; peer_mdev = mlx5_lag_get_peer_mdev(mdev); vport_index += mlx5_eswitch_get_total_vports(peer_mdev); @@ -146,6 +146,9 @@ mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep) struct mlx5_core_dev *peer_mdev; struct mlx5_eswitch *esw; + if (mlx5_lag_is_shared_fdb(mdev) && !mlx5_lag_is_master(mdev)) + return; + if (mlx5_lag_is_shared_fdb(mdev)) { peer_mdev = mlx5_lag_get_peer_mdev(mdev); esw = peer_mdev->priv.eswitch;