From patchwork Fri Jan 27 13:08:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 49389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp827514wrn; Fri, 27 Jan 2023 05:16:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXt/wxJEPCO9jGPmy3TffzqAUfmM/Qb6zeELXBj882YMOc8mvAF2TiuTu8mOnV5SfciRMeEH X-Received: by 2002:a17:907:cc8a:b0:7ad:d62d:9d31 with SMTP id up10-20020a170907cc8a00b007add62d9d31mr31242627ejc.67.1674825405608; Fri, 27 Jan 2023 05:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674825405; cv=none; d=google.com; s=arc-20160816; b=p3WmTN71JvkBmGKNNzXfUADvS2zZFaeLq5QvsrovMKdyX4th/a9nii6ZQGH97tnS0E 07zzotetu11q+ljISHtyIHX5kmoGT+ZIGbRDqGSdE3Z4moRLCJ3y1Eo9vkMvLV/ywLYI XEprAL5VrkmLNFH4kTwOdBsCX3+c098IawJmptrBJSEfHZ7TTghWYWkr+6y5GLK+DdRZ sB8KDopdVPYZxaaJDUFbxmDeVmyYy7xYNYQ2TKuP0LRVLWShFCQskSyqinuVRvyTyFRm IkX6t8XKJg6zJHjSIARQa9o7ypdyTm3LmuBtkHyvP4oexd2XzpECtMM6ZzYjfKwUBkqS qmwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AfTwuJgVUHUlE6ybuFaMwUIBZXykZVDesIyx70UulDE=; b=rLv3nFk0WceDrFtNvlc7eMW2XONbOex8hSySBlGDIN3wVYP8wZ5/88i0xsPk1NAZ// kpBaQ9mcuj54J5cVoUMwPwt9yM33qXBign8zWp30B8xaCBk6AACU8SXSRNBfLgRLFR7L NDqhtXpPa2o824bBWMrLHcita7fcbZsy1ROi2S4Z117ek9aty1EZmtiHMmFLY4a3bOmb 6K0XyXLZpDZRm5hjWpRAG1TeH9stV0CVIyHQAmNP0vn9Cwh/sVvWTfq7nrjGk0JWcDNY UkhfYu5ZA/eOwWpgMrhzODNPi3U0M5oKvZmMxATbFSTmH2hwGKNSfoTy2B8NAlSBb2i9 ffng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ZDNk7kFV; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 15-20020a170906208f00b00871a4e8d7bbsi5091801ejq.268.2023.01.27.05.16.20; Fri, 27 Jan 2023 05:16:45 -0800 (PST) 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=@microchip.com header.s=mchp header.b=ZDNk7kFV; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233268AbjA0NJs (ORCPT + 99 others); Fri, 27 Jan 2023 08:09:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234612AbjA0NJ1 (ORCPT ); Fri, 27 Jan 2023 08:09:27 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D797FA01; Fri, 27 Jan 2023 05:09:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674824952; x=1706360952; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aOekovlU26BZ6lJ7Al8iWnX4uypFmQKrzcdds3/X4kA=; b=ZDNk7kFVOvbpPYnBBQjnBVgyBHFwEafS/iHVYqLumBLR3r2HHxRtVg0a LRO0UjT5e6YQfXjTOyhKz0wmInpef6V67KjL1Q4YAPx9kGjcfmL98dD0+ gsSZ/YH3HjQkLkZLP2tnRHJapZ46Lm9XhDIOpgSN3CSgCCc3z31E/lu98 ByPBdLtN4GtM5lkUHr4TgY6stjOyhDJemVqCLRtvAx7lbOj7SH69CKIkj JPtNYRRquZkeiyHRSOySA/imR+GDjQAlXUuJsnQC4yf3mGpmLKdFUgkPE rWLuxgqIK/7gbRoy+Bf1ZsZqlysn1Dut1miZy92JzUl/TkLgtbeAS2OpY A==; X-IronPort-AV: E=Sophos;i="5.97,251,1669100400"; d="scan'208";a="198504099" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jan 2023 06:08:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 27 Jan 2023 06:08:52 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Fri, 27 Jan 2023 06:08:47 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , Randy Dunlap , "Casper Andersson" , Russell King , Wan Jiabing , "Nathan Huckleberry" , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Dan Carpenter , Michael Walle Subject: [PATCH net-next 2/8] net: microchip: sparx5: Improve the IP frame key match for IPv6 frames Date: Fri, 27 Jan 2023 14:08:24 +0100 Message-ID: <20230127130830.1481526-3-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230127130830.1481526-1-steen.hegelund@microchip.com> References: <20230127130830.1481526-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756181724515265414?= X-GMAIL-MSGID: =?utf-8?q?1756181724515265414?= This ensures that it will be possible for a VCAP rule to distinguish IPv6 frames from non-IP frames, as the IS0 keyset usually selected for the IPv6 traffic class in (7TUPLE) does not offer a key that specifies IPv6 directly: only non-IPv4. The IP_SNAP key ensures that we select (at least) IP frames. Signed-off-by: Steen Hegelund --- drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index 59d6ed6f4191..8982c434cf54 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -266,6 +266,14 @@ sparx5_tc_flower_handler_basic_usage(struct sparx5_tc_flower_parse_usage *st) VCAP_BIT_0); if (err) goto out; + if (st->admin->vtype == VCAP_TYPE_IS0) { + err = vcap_rule_add_key_bit(st->vrule, + VCAP_KF_IP_SNAP_IS, + VCAP_BIT_1); + if (err) + goto out; + } + } }