From patchwork Wed Jan 24 08:18:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13528779 X-Patchwork-Delegate: kuba@kernel.org 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 911D917756 for ; Wed, 24 Jan 2024 08:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706084357; cv=none; b=XGiQoDvg0uuc6sNF7E8KCg54TH79BapwmsLgaaldhRl3dKeP7UwGiKnmuWzgn0U94a1oztRaipX163XSpPlImRAUSttLvpG+TmL3vxtWvYsuyWQapGlA8DvNnfQMZM/+tUcdkMHIuiJTvkNd59oBfMo0BwPE8K2Og/BCWJFd8+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706084357; c=relaxed/simple; bh=1NWurbFv6ZN4umhSbEGGKqB6lISrm8744fUrroskShc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KunRGFtTRl2wm9lf/tJ0oK2+rl9NoD39qxlY3a+PWxEiU+pUmC9WpFvL272YgvFdqdkDoYVdvUKrua+UXOd7prRcJcpxNV7zz2EsNEnGcbHSVIbNPJWs0rEkfzlAMfqfDafwmGWwfdsrT2QQajZnSbrzg0+tj3imeCyKRnWZwP4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HSXKU5FZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HSXKU5FZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF033C433C7; Wed, 24 Jan 2024 08:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706084357; bh=1NWurbFv6ZN4umhSbEGGKqB6lISrm8744fUrroskShc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HSXKU5FZzGidVCmjg0zVoSCfGo8KzVcVoLv8tCvs+eVYLte4ndX5HH8Oxj5L6Wk+W 51xM8MnLhcpq1yDg/qr9i/Us0myvlh7nvWeg80/exkQrr3pGDDvFoZCj10dvZixYUM 3cpZ7hswwItuY1LH41r9s6P9vcNylLcaGhaLXDLinFM0Q8KL9CD/Kqu4ibflkb+Orl rKHAJbAV/APW+lgDY4W0qQQPiORB4Zmw65yp9gxsydzO1S86sfFNnJB4bLzZxJDCMk 6DTrE8Jpyc9F9oj7A4xAfKlxt/e9/uduBaS6cdsTdSm7wYd09CwdvulnDOaV7pc7DN qrwASd20LLjOQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Yevgeny Kliteynik , Erez Shitrit Subject: [net 09/14] net/mlx5: DR, Can't go to uplink vport on RX rule Date: Wed, 24 Jan 2024 00:18:50 -0800 Message-ID: <20240124081855.115410-10-saeed@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124081855.115410-1-saeed@kernel.org> References: <20240124081855.115410-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik Go-To-Vport action on RX is not allowed when the vport is uplink. In such case, the packet should be dropped. Fixes: 9db810ed2d37 ("net/mlx5: DR, Expose steering action functionality") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Erez Shitrit Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_action.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c index 95517c4aca0f..2ebb61ef3ea9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c @@ -874,11 +874,17 @@ int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher, action->sampler->tx_icm_addr; break; case DR_ACTION_TYP_VPORT: - attr.hit_gvmi = action->vport->caps->vhca_gvmi; - dest_action = action; - attr.final_icm_addr = rx_rule ? - action->vport->caps->icm_address_rx : - action->vport->caps->icm_address_tx; + if (unlikely(rx_rule && action->vport->caps->num == MLX5_VPORT_UPLINK)) { + /* can't go to uplink on RX rule - dropping instead */ + attr.final_icm_addr = nic_dmn->drop_icm_addr; + attr.hit_gvmi = nic_dmn->drop_icm_addr >> 48; + } else { + attr.hit_gvmi = action->vport->caps->vhca_gvmi; + dest_action = action; + attr.final_icm_addr = rx_rule ? + action->vport->caps->icm_address_rx : + action->vport->caps->icm_address_tx; + } break; case DR_ACTION_TYP_POP_VLAN: if (!rx_rule && !(dmn->ste_ctx->actions_caps &