From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 563C71D2B2 for ; Thu, 22 Jun 2023 05:48:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC556C433C8; Thu, 22 Jun 2023 05:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687412885; bh=a3DfA3pEFUrCiTIBstXhFyg0ja2cqiRK6RpSlVthg2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ID4Kuf6cYLcm37yUBKoQDueQXQdpKod8F4fkyrgcLEfAHYW4PSI3tJur2oiixPEZo r/dbd6LaULA7IwOH5UKIEXMVxYT+HbTxLIcThoFS90DjOnXVlTWM3TZvPORGwOkAoX s2WacvZuPIewfX4yOmIntDAPdbEnVkhgxFzmSGLxklaWJog/RZ3ibTdbNg7haRz5oJ BA+ToEoUqo1bd8deGOa401x9mqoMQDHKr2aLHwXMb1wNUBJIXQcMd0sWhuTfdikjrN /FPuv6WO33yYwVB2uDLfVGwZkNMWljRa14Q6xQtEVgblSmFTO0spZNbYp4PIIDu4V9 cpMu9RXRgMHvg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Jiri Pirko , Shay Drory Subject: [net-next 15/15] net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type() Date: Wed, 21 Jun 2023 22:47:35 -0700 Message-ID: <20230622054735.46790-16-saeed@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622054735.46790-1-saeed@kernel.org> References: <20230622054735.46790-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jiri Pirko As xa_get_mark() returns false in case the entry is not present, no need to redundantly check if vport is present. Remove the lookup. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index b4e465856127..faec7d7a4400 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1908,12 +1908,6 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, static bool mlx5_esw_check_port_type(struct mlx5_eswitch *esw, u16 vport_num, xa_mark_t mark) { - struct mlx5_vport *vport; - - vport = mlx5_eswitch_get_vport(esw, vport_num); - if (IS_ERR(vport)) - return false; - return xa_get_mark(&esw->vports, vport_num, mark); } -- 2.41.0