From patchwork Wed Jun 7 21:03:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13271319 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 2FD56C7EE2E for ; Wed, 7 Jun 2023 21:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236025AbjFGVFm (ORCPT ); Wed, 7 Jun 2023 17:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236349AbjFGVE4 (ORCPT ); Wed, 7 Jun 2023 17:04:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98BE22136 for ; Wed, 7 Jun 2023 14:04:28 -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 E3225649E1 for ; Wed, 7 Jun 2023 21:04:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 362ACC4339B; Wed, 7 Jun 2023 21:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686171867; bh=nIH9mrPFFXgSbpkpBEvTP5WzN3FA6no+1bOBPuGF88c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQCLWsVjjrildNz/+ozAqe0RNKEOOMfnq8MpAP9OfUytsctXw4IdG6M2cHt2ESeZR hGLxKV9+1if8OJxQWa6CNOzx6PDrV626KpK0pSL+p7Yx0dTqGKJtX1Ujf13+rtjaYI 8K7nbZLciWwCK7jrgZdIRHmcwn0U3U+HAj43CiABNs1f4LlTevrZKqLv9l5/5qU78u RDyh382XEBrZO5yhIw+4gfNR1bG83xlTj2rCLTYeege1Op5102FFpONH6zC9v5ej6E RGZp5ItFFO9d2hwqu4Q9aqxQEbhurS2uiFtFZPeyVJZAmu9VY445ZzLuh1RTe+lZN7 udNQPGtXNAGGA== 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 V2 01/14] RDMA/mlx5: Free second uplink ib port Date: Wed, 7 Jun 2023 14:03:57 -0700 Message-Id: <20230607210410.88209-2-saeed@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607210410.88209-1-saeed@kernel.org> References: <20230607210410.88209-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. 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;