From patchwork Tue Jan 12 07:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12012525 X-Patchwork-Delegate: kuba@kernel.org 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.3 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,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 0A10DC43381 for ; Tue, 12 Jan 2021 07:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC84922AAF for ; Tue, 12 Jan 2021 07:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391902AbhALHO0 (ORCPT ); Tue, 12 Jan 2021 02:14:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:37566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391826AbhALHOZ (ORCPT ); Tue, 12 Jan 2021 02:14:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97A9E22D01; Tue, 12 Jan 2021 07:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610435625; bh=3OMEF2lY2e3KG2yS3rlIrF/fVnWCck/jj3EHH6R2dXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n6QdykkN0ObDOJ5+lJCPl0L7zeaic9qAxCIiTNmQdb6bKny8HJyOCcL8JL0rXNQCQ Brst9LmFrUiwj8BacX+EHj7XuUG7NEhdGi7hFvfZ14+BJ64bUwTOiNZljMWSEWM5XB gsIxkq1z7rWPkDQ74B9N3xy/GtYBU7EC/B9OdZpN2km4z+T1HQmXKvJBXl5IsSTlGZ 9BTgdzDw/sWlHlFp9PFMR/Sn1feJgCqcWv79qK9IdpZ1tUIBhXjqBZPgVMb3ciG7U9 HsU0omOakg2EEXnzNzOXmadauFyjHcLC4IimpBWWp6ETnwaRz6lq941Ftw3IPzFTx5 EkEpzTkLM6pzw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Eli Cohen , Roi Dayan , Mark Bloch , Saeed Mahameed Subject: [net-next V2 03/11] net/mlx5: E-Switch, use new cap as condition for mpls over udp Date: Mon, 11 Jan 2021 23:05:26 -0800 Message-Id: <20210112070534.136841-4-saeed@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112070534.136841-1-saeed@kernel.org> References: <20210112070534.136841-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eli Cohen Use tunnel_stateless_mpls_over_udp instead of MLX5_FLEX_PROTO_CW_MPLS_UDP since new devices have native support for mpls over udp and do not rely on flex parser. Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c index 1f9526244222..3479672e84cf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_mplsoudp.c @@ -81,8 +81,8 @@ static int parse_tunnel(struct mlx5e_priv *priv, if (!enc_keyid.mask->keyid) return 0; - if (!(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) & - MLX5_FLEX_PROTO_CW_MPLS_UDP)) + if (!MLX5_CAP_ETH(priv->mdev, tunnel_stateless_mpls_over_udp) && + !(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) & MLX5_FLEX_PROTO_CW_MPLS_UDP)) return -EOPNOTSUPP; flow_rule_match_mpls(rule, &match);