From patchwork Wed May 19 06:05:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 443947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F52BC433B4 for ; Wed, 19 May 2021 06:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23B7361040 for ; Wed, 19 May 2021 06:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242932AbhESGHx (ORCPT ); Wed, 19 May 2021 02:07:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:49324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238871AbhESGH3 (ORCPT ); Wed, 19 May 2021 02:07:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52E87613AC; Wed, 19 May 2021 06:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621404370; bh=rG2ScH2XvKwESVu6AjjvASE8N5FxMnSsLrV0sntfJDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bb+kF26uBIPh1m3s9RjfOYteEN5zWHLQbAL/ZkHfydiqwjXKgHjXPMRkBpSyCu916 ObQnPt0UkMJAgfgp2iM9MPI1WnhURrvuoPI0mERUKafUM+FjfRrW5Yzy8EQEsfb9w2 bnLzlweNYCcMeJbDNlNYek+8ZIK0W8BuDtq9c8lcIEFoIxK4sy0m4K4Aa2V/0Qb4F+ TLoPJCopn8Le5BXouYUJM7cq2Z/kGOMAOfZ7RGHZCxTvloT0YPYZJvSH/f0DgiOGRe YYCKuTQVUzkeNB/1a/aVMC64zT7QoLWSCh9kaYQXSl44bj9fJ25CgAgeELG0NZO949 Y/4Hzu1sLV/fw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Leon Romanovsky , Vlad Buslov , Roi Dayan , Saeed Mahameed Subject: [net 11/16] net/mlx5e: Reject mirroring on source port change encap rules Date: Tue, 18 May 2021 23:05:18 -0700 Message-Id: <20210519060523.17875-12-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210519060523.17875-1-saeed@kernel.org> References: <20210519060523.17875-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vlad Buslov Rules with MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE dest flag are translated to destination FT in eswitch. Currently it is not possible to mirror such rules because firmware doesn't support mixing FT and Vport destinations in single rule when one of them adds encapsulation. Since the only use case for MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE destination is support for tunnel endpoints on VF and trying to offload such rule with mirror action causes either crash in fs_core or firmware error with syndrome 0xff6a1d, reject all such rules in mlx5 TC layer. Fixes: 10742efc20a4 ("net/mlx5e: VF tunnel TX traffic offloading") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 882bafba43f2..bccdb43a880b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1399,6 +1399,12 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, esw_attr->dests[out_index].mdev = out_priv->mdev; } + if (vf_tun && esw_attr->out_count > 1) { + NL_SET_ERR_MSG_MOD(extack, "VF tunnel encap with mirroring is not supported"); + err = -EOPNOTSUPP; + goto err_out; + } + err = mlx5_eswitch_add_vlan_action(esw, attr); if (err) goto err_out;