Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4850037pxj; Wed, 9 Jun 2021 03:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2tTZfoXtrYoyWDW7Ko40ei0e7oO0qe+QTnQ9K3Bs/4PGk1CajLQfLHq2KyJbAAvMCLv5Z X-Received: by 2002:a17:907:2709:: with SMTP id w9mr27920088ejk.118.1623234614345; Wed, 09 Jun 2021 03:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234614; cv=none; d=google.com; s=arc-20160816; b=lAytdZb2kLVDYug+/Hur3aJVpjcF/LtIe+JGKbiw8DXL61Esdrv82vvhKpGp6BGM1I OcVdUl5gtZPSZHcKXoF6KR67a/ZOn5AS6/gvhFEhlYRt1y3RiofJMuUfLIkanKGCnq+b ZKLeQPZm4hlExZ3xLzbkg3QHc7BvIkKGxFNCAQ+ua+Nn+cxPwXfMXMtJgHwWZvmAhDcy 1oZAEhESRgraDfNFuNJeQfJKZtHHgg+RwGSqfUksVO5SMAqi9sMtRh6mcrlMZZ/k35e9 y9VgNgXvEfokMQF2SBQlXqr4fnMil9QyLaE+2hwvmxDHHv9H0hnlz84LVIOFtZVq1hmE 8SaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=70tN7ThNU1BN7YPhpeNVc9EnnjctyY7idZcYLuNDWZU=; b=D59vmESILHMfOZgb+VcK0g1XH6FnISFR3N0+sTUpmoT3HS33iQlbfvLPAOnYq1ia1T CkYIC+QXHzC89aR/X0h6TDHBbmttA2m8QFXmCzV4eVft2MPPV/zOf0heNUiycfXKXjsf mbCIfjtf+KmEVp4tNBo6E7c2v9yrdIBm45vl0wnUDkAxz51WjNiDIVcBCUJKupMkSLgB Bki8cqoksclVSgthnLtkKUTJtnLRmjgbwxx7PwZ/PNNW1vK1Vdr/67nmf9qsag5UuAAv kgoM3IzwCMMLRAjC/YDvW6b+17sHArqjJe14hiOyT6O3VIMcYgnWFO+CRIt3k9bU974f E4VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPogH+S5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si2562868edb.418.2021.06.09.03.29.51; Wed, 09 Jun 2021 03:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPogH+S5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237254AbhFHTAK (ORCPT + 99 others); Tue, 8 Jun 2021 15:00:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:52436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235857AbhFHSvw (ORCPT ); Tue, 8 Jun 2021 14:51:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB7026145F; Tue, 8 Jun 2021 18:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177600; bh=vhKXmRy8EHtl+bFeSlZPerbRoRyfhByHOIPq3L0KbY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPogH+S5hMzd4otlgfEKWmbOTp2Cxpz2nFvNRdlGF2dgKE2IoXWQ8ZCq6Bn+HyzGq jHREBopwU/lqksKkVzA3cUVcJ3mbYgLMqAzRF0NszrWwas2kKsgVnmvmSnprsmvu39 Qk4Hef58ZjcJ4K7jC/QiEhwl7shPIV6WxN3EhEog= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso , Roi Dayan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 031/137] net/mlx5e: Check for needed capability for cvlan matching Date: Tue, 8 Jun 2021 20:26:11 +0200 Message-Id: <20210608175943.467646556@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roi Dayan [ Upstream commit afe93f71b5d3cdae7209213ec8ef25210b837b93 ] If not supported show an error and return instead of trying to offload to the hardware and fail. Fixes: 699e96ddf47f ("net/mlx5e: Support offloading tc double vlan headers match") Reported-by: Pablo Neira Ayuso Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 1bdeb948f56d..80abdb0b47d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2253,11 +2253,13 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, misc_parameters); struct flow_rule *rule = flow_cls_offload_flow_rule(f); struct flow_dissector *dissector = rule->match.dissector; + enum fs_flow_table_type fs_type; u16 addr_type = 0; u8 ip_proto = 0; u8 *match_level; int err; + fs_type = mlx5e_is_eswitch_flow(flow) ? FS_FT_FDB : FS_FT_NIC_RX; match_level = outer_match_level; if (dissector->used_keys & @@ -2382,6 +2384,13 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, if (match.mask->vlan_id || match.mask->vlan_priority || match.mask->vlan_tpid) { + if (!MLX5_CAP_FLOWTABLE_TYPE(priv->mdev, ft_field_support.outer_second_vid, + fs_type)) { + NL_SET_ERR_MSG_MOD(extack, + "Matching on CVLAN is not supported"); + return -EOPNOTSUPP; + } + if (match.key->vlan_tpid == htons(ETH_P_8021AD)) { MLX5_SET(fte_match_set_misc, misc_c, outer_second_svlan_tag, 1); -- 2.30.2