Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5979923iob; Tue, 10 May 2022 07:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu8eWL7Jkfw/mu9lOinW45FVmqlgkoWE+P6G217OlwBCd9DcY2nix96AvG3qihj4MouUZ/ X-Received: by 2002:a17:90a:c388:b0:1d9:6336:2d7a with SMTP id h8-20020a17090ac38800b001d963362d7amr374081pjt.244.1652194409857; Tue, 10 May 2022 07:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652194409; cv=none; d=google.com; s=arc-20160816; b=VLuiSIrfdrKCWZNGVxatvlY2EBw3fHFfrfV+Uo0p2mHjDmDlODUbuNNqqkgqRPu7O0 hz1fBaO2iyu1QVFB/sKDKzdzoLJchoKBjqGVn1Ay8EFqT1OiVCnfqSSRzNuDymKFZ0NB 2SDrxC/Ib2Tm+2IK7vdJjuw8vuDX8fdZDOfBdhdXrf26sYwD7PWQD8G3b86TreCrEd8j PswnlLeu1QyseQ97p/+EmSHp9q9/6aq9bjrfauCi2yY2w9mrk7m/WtYbaizH7KYq1NUV Hva3RQel+TPWWCFnMlG1thnfU1aJbxY/GV3JuvFZz86DA8pQZoMJeFhgrib4pekCDUhX NVtA== 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=GOk9VCyzFZso0z8+qAyYFt+JYmdM7wUIDrJV2WtvJIw=; b=SPpXVNVVU5OHsZ5i2wNRZgFOmAqxESOGHj4vJlBRz5DlOxLl9TpD8v8EdLEIie//tY X1jTrO8xBE7VMvKggLc6DceQ6UFRS4Mu1j4jsq0UmIRaqSQy6vCRRWSHnCyBLGwsGHPr GKi94hj7Xdh+glytzhMjUvOGke+yAhmz7yf/BdQnslHTpyjIXZ15sWPcZRyiP6ctaOBj 1Nk+/Zo5dWUtCs54kKbEd+DFh12Dlz6iImhB722mI4HYR0eqrK/ekYz4L9NFCsfTbJhB XQ4Dehdl9JjzQeiopyXxID6ntEK6+qn8qv26i33U1TabnQMLGWwy0bWGvmaS+fg322OO NLmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b8kgaD5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020aa79e88000000b004fa3a8e006fsi17114547pfq.294.2022.05.10.07.53.15; Tue, 10 May 2022 07:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b8kgaD5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S243544AbiEJNzl (ORCPT + 99 others); Tue, 10 May 2022 09:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244767AbiEJNiC (ORCPT ); Tue, 10 May 2022 09:38:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E00DE5838D; Tue, 10 May 2022 06:26:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 730C2B81DA8; Tue, 10 May 2022 13:26:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C91E5C385C6; Tue, 10 May 2022 13:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189178; bh=Q7tCidXFNBg5wGReamRFoXUum6q7cRGXz98pfpLdfkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b8kgaD5BUlRTrd82qnwJjidqNEbSCCgYKnRhrE8Nw6EDQveFECfsd0YPSFsYMQjJF sQhuSBF8otPg5VpKeznAeF+ReVekZ2FZIx9chiRn6Rr26SJDlw/sXs3eHCKvCG/utF Sqa+OhA0O9G3qbxI/50Mj/KN4m69TOufgHQtcm30= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vlad Buslov , Maor Dickman , Saeed Mahameed Subject: [PATCH 5.10 38/70] net/mlx5e: Dont match double-vlan packets if cvlan is not set Date: Tue, 10 May 2022 15:07:57 +0200 Message-Id: <20220510130733.979174634@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130732.861729621@linuxfoundation.org> References: <20220510130732.861729621@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vlad Buslov commit ada09af92e621ab500dd80a16d1d0299a18a1180 upstream. Currently, match VLAN rule also matches packets that have multiple VLAN headers. This behavior is similar to buggy flower classifier behavior that has recently been fixed. Fix the issue by matching on outer_second_cvlan_tag with value 0 which will cause the HW to verify the packet doesn't contain second vlan header. Fixes: 699e96ddf47f ("net/mlx5e: Support offloading tc double vlan headers match") Signed-off-by: Vlad Buslov Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2396,6 +2396,17 @@ static int __parse_cls_flower(struct mlx match.key->vlan_priority); *match_level = MLX5_MATCH_L2; + + if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN) && + match.mask->vlan_eth_type && + MLX5_CAP_FLOWTABLE_TYPE(priv->mdev, + ft_field_support.outer_second_vid, + fs_type)) { + MLX5_SET(fte_match_set_misc, misc_c, + outer_second_cvlan_tag, 1); + spec->match_criteria_enable |= + MLX5_MATCH_MISC_PARAMETERS; + } } } else if (*match_level != MLX5_MATCH_NONE) { /* cvlan_tag enabled in match criteria and