Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6254715iob; Tue, 10 May 2022 14:05:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycRX6zSxrCzivimIoD1H/ZZV65DW3iEYitDJoaPS/VBySAiE1iYfSMMBRAnMO8QO9H3wVj X-Received: by 2002:a17:90b:2311:b0:1d9:2e43:c7ae with SMTP id mt17-20020a17090b231100b001d92e43c7aemr1729868pjb.47.1652216728549; Tue, 10 May 2022 14:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652216728; cv=none; d=google.com; s=arc-20160816; b=XKuWYIknbUcvBM8a717GXaqm4KPg4an24ZKOMKRMHp9b2laZkkEZtwhZ7psI672u6I dL+Vud6T6k9U/3Z1m8rmqVgLzNds5VpRme5hd4dUrRQYS9Tbx98QGpsFrBm0DaFzVrcn aE6XQCTiQbsPNp98tjsbPF19slqAkDkve6wzv5WGZV1GfnmnZR7d/e+vrPWXwBVMuzLR 0PjoKZofX4nEfk1qtk8WwenHiV4U6b+VUbTJ6VXYzgqZQcvm58Y6LXWGOgIqCz0Us3ss 30BRrdHHgco/SBNjlKqBhJTZmOTniKgDgu2jRMNoB9O25+hqf8w/GJplDgV+884e/qXW 1HWA== 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=fYj777ckoc2wAwyN9pOL0n0QF5fUbMwkbyxiSxtvnn0=; b=JL7Jfn+9XyxKK6bzQJlf5JqaimgfMP/lCnKDmcwm2Gem7mCBBVjwW1fGlDBnVMjJ16 EnG/PuLuDEZIg1Jr5IRWXnymLJkRVQwVlutt5+cCyNXg1tsb5JRY9GN716Ca7n7tLikE +O1/qbIR2l0x1wgEoNISRQMCUTqHvQwBMjNKL7p3nQ4L3ugM7ZZRO3mfY13fvqz4YKy4 biyoggjXpfgVn5l7NcWUYRm9zqKeGhmrcHRxXbJfgujDvrcWtvL8XJJGt3pU7JPhTCld 8Vq9zpZrb7Qs2J+ivHliM8EObE1f/kKunPcR8SKzI0gyqVpDyekS/pHPflZVwW3+bkFs TSmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vhNqLmQf; 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 kb18-20020a17090ae7d200b001dc633e998fsi386940pjb.103.2022.05.10.14.05.11; Tue, 10 May 2022 14:05:28 -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=vhNqLmQf; 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 S1344418AbiEJO0o (ORCPT + 99 others); Tue, 10 May 2022 10:26:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244470AbiEJNx4 (ORCPT ); Tue, 10 May 2022 09:53:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611E42A0A41; Tue, 10 May 2022 06:38:26 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 03003615C8; Tue, 10 May 2022 13:38:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6DD3C385C2; Tue, 10 May 2022 13:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189905; bh=CZCbhfw3omaRJXhOwD3hj63Q4L75/COhbyLBzDbWWxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vhNqLmQfBiWaFOb9RqbcWklPP3VhLdgl5Azskqu0HLK/FMVk7Y5dIcW+k4eohsQUg bEgBn6RxbhT+AdSUV2hhHRDKa3tMdRljiJwQiw4+o9jKu11XLVwaMhnF3lW0re85dI req+GoI5Rr0vIverNEey2YUNY6e2vLBu5OUrhUMQ= 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.17 066/140] net/mlx5e: Dont match double-vlan packets if cvlan is not set Date: Tue, 10 May 2022 15:07:36 +0200 Message-Id: <20220510130743.507125417@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130741.600270947@linuxfoundation.org> References: <20220510130741.600270947@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 @@ -2355,6 +2355,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