From patchwork Sun Feb 5 19:24:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 52926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1898907wrn; Sun, 5 Feb 2023 11:33:30 -0800 (PST) X-Google-Smtp-Source: AK7set/NKHDvQKbmyLCGJtVi69ZcZDdPy07IMBjUTyGi9FJ/GcL5Rf7mBJ+uG70378VnaLdEEITl X-Received: by 2002:a17:902:f0d1:b0:198:f339:5f99 with SMTP id v17-20020a170902f0d100b00198f3395f99mr4706136pla.39.1675625609822; Sun, 05 Feb 2023 11:33:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675625609; cv=pass; d=google.com; s=arc-20160816; b=vQkdGT1hqrjBH56BeOWrZ1I1lC/31gF0PJ3EWulZBhe6yA+/lGzyZKrxILZ9ahwABJ EN8Ml2NbSr9GXVfIFX//pYstymc0dckQxk8YygMCECueFPyY35qCNLFA/BvlisaqKH+f F7sHfj3o55v9ZmLpMvlfLMeLIR/iyU7Z304HKPk0p3TgkxM20A9RKaYOk1oM6I78LV+n 9QqRyhcrc/FwvKpScOZrxUagFA01RpPY/EsbiRgn05MfYl+NawUqVP2JyJkYBoLTgv38 XyXI0HzEQ6jLgvYHsGwtnWmO8IjdvNoeQil1bavtJbizcvVw/EmMB93oNGcHSp+PJiSc UhLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=UmU/tu2P/MSmeO81GfJCsa62WvOvEubPnCXpbuVQ1zE=; b=CyfwzFKazdbU+HX+hC6GijTYPHZzqknhH5/PZk5+BDuwzJvr5+1w9tSeYnrJ5kvUME bxJVR5unxZ/0K0bmMqwCHjyhQXXwzKWHZMffefQi+snQA/myMhstIX3zV2M061zBC763 NY1rdIvvHA6UHkptBaG2np6TbzBDQwPRpYC4ECow1r39kjlYhggGqh8PqPWd14x+iN5I I5XCfh5OxS++e+8nHXLWE/pjBkdZCsd7tcthDXbowODu8E3dIZEDNMgpDQVglKEu0H6x w7JalUybHEHo3xXOoPwWu7jZDKeXVs08lJnnHTBVQIqTPkFJWlHYwAmtkemZ0eLZkEyd nwOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="fm9q1ap/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a170903124a00b001947ba0ac92si11528227plh.350.2023.02.05.11.33.17; Sun, 05 Feb 2023 11:33:29 -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=@nxp.com header.s=selector2 header.b="fm9q1ap/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjBETYc (ORCPT + 99 others); Sun, 5 Feb 2023 14:24:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBETYa (ORCPT ); Sun, 5 Feb 2023 14:24:30 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2083.outbound.protection.outlook.com [40.107.8.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E44AF18AB0; Sun, 5 Feb 2023 11:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVs6OaMKsa7y2VfY6jC60VqI0E+hHVAgo8tDYLfcKrc1OhvYKOLKpKZIr1lBJzMVQg3efzxegrOtK5nIjgXPjYcxDebH/K3+RprZy74wQZR3PvCcatvsuITzsytzp2G9mtEE1XEaz+yRWQ9QiRdYBSGsQjS5XZ3oAcWGZ0zM1/OfhiozCuGbZyLNlWu0NVWJT6ieQeEy61ScT7tIv18mlDJnDMiVI0Z1NRFgkkCovJqzUwR2O+90SAgFrABKzQ+Z+ROlf8bh0QaQckWjXpzucGsnTA076LmQEfiMrTQIgKbPED9SzaIoGlhB2AHzRtNNkGlEeCr+OGzR1U9M1+czMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UmU/tu2P/MSmeO81GfJCsa62WvOvEubPnCXpbuVQ1zE=; b=IWNy8ZfbY3N4ar7q6yh/j3x+YzzlxjTn//dKDKLEoMYDS+wDwixdwJuokrDhkLYmRrW6iYDVsTvC0nwMgMMYGRj+nhsdml4Baj5u3ifElFePqlMjLdCaRNZLR4tY2iOjfwGXOIEFpSmAyMrLhFHUuZZOUJTo3q3612R0a/GN+yTJSi7LfYU9E0tOnOyalcT0Mp4FkK+/tBC2AaGh0jSsVH3J1NkA8w3sZxj4plZ3OoS70OATOMzQBZO05W8n2QsVZroaIbdGVD9cncOT0rvT1cCHktasVKa1kA9dORpKh4IemZRmKO9X06AaJ6PhmguZma2/4u26NuErcnWrTUW8Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UmU/tu2P/MSmeO81GfJCsa62WvOvEubPnCXpbuVQ1zE=; b=fm9q1ap/ZW7qkXffaSyflP3bboP9dbtFEIOxMFOeI3U8AHTCdQtslPDDsBNrY7iBf5Ld4xvRtz0CJy9yHHRWmHOGh9nYF5dtnOlvtGgPS3QX7FBOxUYU/r9N51CZNFWUcQ2sHFnVj/exB/bymYC1EGUk25mGXHpiBnXJ66OJUU8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by PAXPR04MB8391.eurprd04.prod.outlook.com (2603:10a6:102:1c4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Sun, 5 Feb 2023 19:24:24 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Sun, 5 Feb 2023 19:24:24 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Richie Pearn , Xiaoliang Yang Subject: [PATCH net 1/2] net: mscc: ocelot: fix VCAP filters not matching on MAC with "protocol 802.1Q" Date: Sun, 5 Feb 2023 21:24:08 +0200 Message-Id: <20230205192409.1796428-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BE1P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7b::14) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PAXPR04MB8391:EE_ X-MS-Office365-Filtering-Correlation-Id: 3730887b-ff29-4700-3fcc-08db07ae961f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IGhnbL8PVvWjdMDfBb4o0ObxxJTjCPJQ8VPHIqtBejK7g00b33niCm3IyClNH4RdU9J1bvRgvTbdjTB1vzexB60HcppPMzQ4rFNGGXPNpUC1BFaOd4RPwc5OhMGmg2lZ45+zNPgOL/p7dEj2bMwJu3kwqebID6rr2F9V+qBZut3OFsiIxJM0YrNDpYZspbT1pCkw8199ne39RQHVKBLME2YNXeqEGfPv3jT1NvI4SvjXM0F3WmZc+KLFLL8u8OuPzGxagxOOOQq1FtgELYi+Mdzbih9QJHV/xZOttSFQhSczC2dYjnbwzyHlgdQTT/b3qXNBg6wBTEnT5M/tkCN0a5KN8Cdfq1vXdj7ld1QDKRCPVB4foMeNKqRNsxG1XOK+om/yimbUdrplGKrgawFlqCrIT91FrHXuLgmY/8DJOhrwClFrcR/veFZ0PVBnPaHP9gCPvaCKT9q5ZFJhnM+vyKnrRWvqyqbur9NQJx1c/Lsm6utUdWoZ8frtEdnHVm+OSsm5JFG53u1tL2UBvWVKnZ1x7eBmF9L2LWu7WX5LDd/NgenJzPQiFMyMqhAqOpWpc1MiZAqMVtyeZxN+r5/Erkguhby8Bdrsvr752xtF4WUziWvYp6ijDIMNLNSs40y+WF383h4o+LccPeFn+Z1hG0QUJTx3fd2gV8+MYNZi0Poh4vx5pHxYvx/bw7uNMoqx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(39860400002)(346002)(451199018)(52116002)(54906003)(66556008)(66946007)(316002)(4326008)(6916009)(38350700002)(86362001)(36756003)(38100700002)(2616005)(186003)(26005)(6512007)(44832011)(41300700001)(83380400001)(7416002)(2906002)(66476007)(8676002)(8936002)(6666004)(6486002)(5660300002)(478600001)(6506007)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dh5qobV0J9Gumnfz41uEi4HZNa38ipKWiJ8tEavnyVz7cyLufwTcR60iatbs2XsNgWembine/yuPK5dtiWCloX7bWOCHN42ZtuyIeHtMdCqDfNOuT3Idpny+Q91i1Zr95qiwGHwN+t1LOow+GhSTuHOXGB+L4FcmURkooTsMYxVoKJrE6ajDXdzu7UZoKEPUkMVkBvX7yGTtVpM0LLHNwsqbckuf0sS1pznycGhNtMcgfLKSySlxB2js6oawgZysp6p0E0h8/O4JjNcT2PS08c54hS1Pju2ucyfHLiba0+tPqwPthFPe2cLO7+JjtuIuLr/O3d5cLRmUojrN9u749nhGomUx6yMfNibMtrJCHJMhfWooEehGrbLomrixSZVegk3u9JHFOQOh+pyaNjPnQDUx13Dw8z6S6kCCrhH5+6vOFXRZl8cE3Tiqap46G5nrrexxUJOe7YuVLa0/dp2GklaGWvsZtojQDsXWvh67KCThOr6aIxC64X4zXjFjQOJZBiCvTx35PwWyKMztVpaxlcJkAqGRkTh9P3v138ggzXc2GHp57w9PJzYwdpY4rzqEDyCKWFu7o5PVL6Go6xDgRCrmPfjcMYTC9EPhruGuOpjNkRtohxfVbOgD8ZK2892IyLMGOZ3uQzE1dD7Ti/AbMsyVjBsNkXd5UtqlnMQTqrP/pKA9UTDSPw27ctasLStVQsfb2aSxBtjflmok/8hnZrv7yHGBw2BDTkyLKyqPylBOKjvoKq1wDzcd9s3OWEswpI/ZpkSMzijCxbZtKzwnH7viuxEx2PzbeboVsC8+ELnOG7TVAVnd8EyWHwOUQ6DWbx8lW+DnecNz7NeM73GciHtGD3Wo4C8Ms7HmlpoupIQuDLsiHHNI9MBFvWKDQBZMBM9Wdvvfu9rzz1eei5BrK33I4S89lUQoiM+m0uOj5q0P6Kw96Yimj5j7CJbXgnet+iAIZn5+UY6ZAS5cY2o6xbL4s1YVNZiSlSoMygJTkLytrmkrG/ya9MGcFuhwzdx3oTU6zoXXbC61vUzex8s+xn9CdbyKyJKjpO6ezMoLSTmYDSkPxI7ffa9aguUVS/i9LC0Wr2oVDkosdHX9IL3qcPIcYhgArH10durBPzSglJychBHDoLjM7IX+hHeBqv9IhhAL3OsIQ01arZRsMw1waTVv2SDk4hfVwPEE73HnwM380/m1LDwcnhjdQYY9ApYY1xE/Hoy5k4G/vIQ518XioW6dw+x65O2hKMtDiqBnhO1/g1yskzTtpBEOoXNwbMJ1aRDnDsu2Yfgwu/FXoYIoSLhjqM457OmXErqv6dNngNWiuaqWILihniXEBTfE1e+2s3o+1kxSEjdRTWOtS6QkVdq0Inu94OWBSiI2t4cRoGDncEU/hAMQuZ/rQDkwsHJCVQmooPuxfGgvtHUIOWnHxoW7cIhssO2g4bCPswPqK89DvBQOeR6NIT5+g2wSExPq9iW0wJKp5+3KfqVUVC0FaTG/4bLi+2r4aE4Ir0ipJPDM2MjqO7vv8ng8IpomlqkYpJWNuDF8H9a8jJbE6K842N9rL440OaPzVQj0nwXZ01uvKpyVuuOCl6ctvn14n4iZBnM6ULTAmNWyqFhwckStFw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3730887b-ff29-4700-3fcc-08db07ae961f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2023 19:24:23.7390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kNwwirSMrO2Vo5jsxTAvXWMjzkPyhG/jp+Lgi2qqfU3eikUOPE1fy8k74VWZSJ3AmZumcxLdtcZLZFF81CBGdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8391 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1757020799512120542?= X-GMAIL-MSGID: =?utf-8?q?1757020799512120542?= Alternative short title: don't instruct the hardware to match on EtherType with "protocol 802.1Q" flower filters. It doesn't work for the reasons detailed below. With a command such as the following: tc filter add dev $swp1 ingress chain $(IS1 2) pref 3 \ protocol 802.1Q flower skip_sw vlan_id 200 src_mac $h1_mac \ action vlan modify id 300 \ action goto chain $(IS2 0 0) the created filter is set by ocelot_flower_parse_key() to be of type OCELOT_VCAP_KEY_ETYPE, and etype is set to {value=0x8100, mask=0xffff}. This gets propagated all the way to is1_entry_set() which commits it to hardware (the VCAP_IS1_HK_ETYPE field of the key). Compare this to the case where src_mac isn't specified - the key type is OCELOT_VCAP_KEY_ANY, and is1_entry_set() doesn't populate VCAP_IS1_HK_ETYPE. The problem is that for VLAN-tagged frames, the hardware interprets the ETYPE field as holding the encapsulated VLAN protocol. So the above filter will only match those packets which have an encapsulated protocol of 0x8100, rather than all packets with VLAN ID 200 and the given src_mac. The reason why this is allowed to occur is because, although we have a block of code in ocelot_flower_parse_key() which sets "match_protocol" to false when VLAN keys are present, that code executes too late. There is another block of code, which executes for Ethernet addresses, and has a "goto finished_key_parsing" and skips the VLAN header parsing. By skipping it, "match_protocol" remains with the value it was initialized with, i.e. "true", and "proto" is set to f->common.protocol, or 0x8100. The concept of ignoring some keys rather than erroring out when they are present but can't be offloaded is dubious in itself, but is present since the initial commit fe3490e6107e ("net: mscc: ocelot: Hardware ofload for tc flower filter"), and it's outside of the scope of this patch to change that. The problem was introduced when the driver started to interpret the flower filter's protocol, and populate the VCAP filter's ETYPE field based on it. To fix this, it is sufficient to move the code that parses the VLAN keys earlier than the "goto finished_key_parsing" instruction. This will ensure that if we have a flower filter with both VLAN and Ethernet address keys, it won't match on ETYPE 0x8100, because the VLAN key parsing sets "match_protocol = false". Fixes: 86b956de119c ("net: mscc: ocelot: support matching on EtherType") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman --- drivers/net/ethernet/mscc/ocelot_flower.c | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c index 7c0897e779dc..ee052404eb55 100644 --- a/drivers/net/ethernet/mscc/ocelot_flower.c +++ b/drivers/net/ethernet/mscc/ocelot_flower.c @@ -605,6 +605,18 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, flow_rule_match_control(rule, &match); } + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { + struct flow_match_vlan match; + + flow_rule_match_vlan(rule, &match); + filter->key_type = OCELOT_VCAP_KEY_ANY; + filter->vlan.vid.value = match.key->vlan_id; + filter->vlan.vid.mask = match.mask->vlan_id; + filter->vlan.pcp.value[0] = match.key->vlan_priority; + filter->vlan.pcp.mask[0] = match.mask->vlan_priority; + match_protocol = false; + } + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { struct flow_match_eth_addrs match; @@ -737,18 +749,6 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, match_protocol = false; } - if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { - struct flow_match_vlan match; - - flow_rule_match_vlan(rule, &match); - filter->key_type = OCELOT_VCAP_KEY_ANY; - filter->vlan.vid.value = match.key->vlan_id; - filter->vlan.vid.mask = match.mask->vlan_id; - filter->vlan.pcp.value[0] = match.key->vlan_priority; - filter->vlan.pcp.mask[0] = match.mask->vlan_priority; - match_protocol = false; - } - finished_key_parsing: if (match_protocol && proto != ETH_P_ALL) { if (filter->block_id == VCAP_ES0) { From patchwork Sun Feb 5 19:24:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 52927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1902741wrn; Sun, 5 Feb 2023 11:48:37 -0800 (PST) X-Google-Smtp-Source: AK7set/0kgIg0z6VnDoGaTN6ZRCLBzKwt+O2A88Xo7c2IJt7DPLJKlxJumszDQyR54RKLhW6kv28 X-Received: by 2002:a05:6a20:3c88:b0:bf:7b3a:fd59 with SMTP id b8-20020a056a203c8800b000bf7b3afd59mr18729482pzj.54.1675626517699; Sun, 05 Feb 2023 11:48:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675626517; cv=pass; d=google.com; s=arc-20160816; b=fne6uyBAzRFRWenBXA7vZ85ZvA33k3HUdJAyqj3zAj8XoDMmRU0lyegzWed0nYbx/S nA9FxtqcoN/ijLmuz/ROsudd9Nkotq1hepsPJ5X/B54eEuFBdMc3Y+JWtBjvKZ8FOIdB 2aZwlgbemaTz2sMLdy2durMoRJooGzhcqBo2h9H05N31Mi9E3DtvguBObnT76o3+v+Mv RxoXijGDSR2jwo7NxMIOnQ+3fqBjJiLE2bjKlPATdBeLQOp5yAOnUikOWfrMJwbAskS0 BGEnCBmhOQT70shv6LwjzHwIPvMK8+YMlVruBbBGtlMD0rddpFucmi9iRAl6UsimBdPa jWPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xxIwUwKxWN6RNJn8UkA+u1msz2UasSdFRO0co8Oegik=; b=Z4ONTacPnwB5SwMCap3J0TLOTsk7PcggNH8cgZQcYiNdTCOyJZ+aFAsRyPZRc3WFbl cq3wq2Y2zbW4OnoUC6pIHUHAKSfPU08lpfDLBY4jft5HXCh+m7U7pG9EhQ6RyfrdbBuo pqHQyh7p9M5lzm47L0IFeoGDFodmPajKqMAfoJtshEq0mohDRQZMTOE1BwJehm2e8sUm CXWcyzDGwodvfCYd2P03x/pQItVhQvmTmPXdpN3A2fTH603IjRt88HaF3sEzyILwvp9k LwyXNiuYD8YB/0+xGSm2YarzdoLk6FevGAv5hnMOPMuvi22vLrIQkxMwUFrgq6WDvVIl VHSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="Bd6w/JyE"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a63ab04000000b004da46ea2717si9682322pgf.35.2023.02.05.11.48.25; Sun, 05 Feb 2023 11:48:37 -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=@nxp.com header.s=selector2 header.b="Bd6w/JyE"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjBETYf (ORCPT + 99 others); Sun, 5 Feb 2023 14:24:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjBETYa (ORCPT ); Sun, 5 Feb 2023 14:24:30 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2083.outbound.protection.outlook.com [40.107.8.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C50018AB2; Sun, 5 Feb 2023 11:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZQilMgcJw+APNkCM9FAHCJ/Z8kee4I/qz/bESgmMIwU6qKd5Ho4jDcN6Wzlb6fLrq3CEtrCl4H4qy9Ws3OUENGJ0bv4xEWQtt6W+32yHrNC6HwxmHlb+TFXTt6bCUyNI89PO5F7k0FQwFxuck0YGgBEg+obYSRQDH21BeQjT4NyVj/2kx9vjl2dRzMXnyGAqIv60Nf/J4n6CBPiVKy+QagSlKS0DI4znKR1m9KL/meIbb65CqBWVR83YKQ5GNDW44zehhe9R6z1Y6yB0S7I6g6TtV8CuV2qNZZS6P2aFlABaVpRmra76zE+dQVHzQozc7FtA3+b8X9DWc9sWUSeiug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xxIwUwKxWN6RNJn8UkA+u1msz2UasSdFRO0co8Oegik=; b=Ml3xMwGSOpiUK0U+WOmsLw1wwLS4Xplfqbe8/+ngRERMmFA6ntlHZfSYWYbU3t24xH/G3D8inUMyRsRhVWbvWcoLb6vLCGYuCiz5Nuev3ec7j2SZghZFpie2lrdJnn/2zN6/srD2QdapPWFqkaZ50VtuaLvFNNfPIJCOJeQOJOgD2/ehu1obcUnXg27p2nMRdXdOnj8++odHqcPXiF/uWdiDPlDWWMt+DaKfcS3lILRiBOjY4f9resOR7C7r/+adrVfd8yYPeN0329IzWFhxFvD/fQGDvjCccgOt75dR5rTnm2KuRQXnZj4SwWwDTuzWPmACrA/O3TQ2sigmwc2bLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xxIwUwKxWN6RNJn8UkA+u1msz2UasSdFRO0co8Oegik=; b=Bd6w/JyEdZ838H6BszlVVy2OaPMLSQZgWEyAy5ezBFgMzsxwIEEUz0qyKM5EUddo/sp9NBZxeMbBI9v9abH9qlKyJnKRP8GDwejdfjvtE1itxDWyX7VZPlc+71w7AGmTEFe1xiBwNSlfPSA7+V9M2hu230/xH4uK443xg9jyR6E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by PAXPR04MB8391.eurprd04.prod.outlook.com (2603:10a6:102:1c4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Sun, 5 Feb 2023 19:24:25 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Sun, 5 Feb 2023 19:24:25 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Richie Pearn , Xiaoliang Yang Subject: [PATCH net 2/2] selftests: ocelot: tc_flower_chains: make test_vlan_ingress_modify() more comprehensive Date: Sun, 5 Feb 2023 21:24:09 +0200 Message-Id: <20230205192409.1796428-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230205192409.1796428-1-vladimir.oltean@nxp.com> References: <20230205192409.1796428-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: BE1P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7b::14) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PAXPR04MB8391:EE_ X-MS-Office365-Filtering-Correlation-Id: aac7520a-c306-4c21-0113-08db07ae978c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lRuyUax3nGD4S+aM5Dmud4gYHPMr7uOkr8k2KPKX7A/Wa2naY3ITigyjUWX/TyfaW4nt8G9vDXwKIcr0ye8EN8hqyXLlI/QCvOKIH0rovAQofJNmWfEWodloYlwHU9OZH6L5GvyhSXaEl5JBQGBkA4IHtVnCjy1DcZmBRvyV8K0xWEBRK0oQOnEUg2LkujVkjnlr+OPCFyagoMrBjrjGDcwItJrtdBHmxmLxcQnvvKxq6fEkVNkbRHe/YwQKepSb9cfHQoRJhJ69j5jldK9oEHKFYch/quqhTl/J6ApeCJaoICGP3/VrQWTvslVJkofqcZCD3gPUZ8a6wK7+qWVhvP9RMd5aLS+6ixl+knVK67g/qjJeyxMcbESPcOFaHOYyqDhDrsGFK0u/Da2zetRHNUpIj4ttdF8M+ZQ4MsHjUmpEWIzI++aKPMGMHqGmycercwMztU9Pgf61V3nzz6KpnQDTek/LAbMu4cKqrDziXqxG20zJDDUXBECErt/6k3vNflf51LLFQiW1fS7h/34rp6EL9zNKvNqrebhvpTg7uNSvzngy7JUeIrAAphOoUqqgrAr9Z1SNUx4X1xyxjT34RlM6gD2RtQjA/i+75oDQmrh36aKZa40CZDEqro4VVjG/pWwtnwxHmtGM0Lqwn6aOpY1bNGydiWVH1Qeqy0WwcIUDcpL/muW7FOgTDk7o03bc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(39860400002)(346002)(451199018)(52116002)(54906003)(66556008)(66946007)(316002)(4326008)(6916009)(38350700002)(86362001)(36756003)(38100700002)(2616005)(186003)(26005)(6512007)(44832011)(41300700001)(83380400001)(7416002)(2906002)(66476007)(8676002)(8936002)(6666004)(6486002)(5660300002)(478600001)(6506007)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B7jmWD+gXNOe26vSjK8WLEgQf0tpArf8Ewk19DEmfkLQECqAFUelcTwZPthR94Ak2VfLwWRrHLpOMDUYsHAZp9/8xveg6OUPKP6L8BrjItDTPFJGQWPyT23Fh8jGkY8L/98P7Ub3kjW3Y31Of2h7HghObK9DZGnZbT6eYGYFK8EEXIXSf28CO2rw3I0/4MEQOErEqttcJrD84mt9Sdp9Jqs2ukQxSX+eBPXxQqdNUT/y2MoUK8P2I0BVoWG0rOZCldMVSyXwMElo81gFDzcRt2ujn/ZiwfXRZu4w8sU+i5CIkSChNRymjV60gWSJNgFPusmCaN8YLeOxp7KsGTvqreyGsvgbqkukJCUQhuGXpbEN0OdTdcdlyjHBqnGic8SWI0Q7LWgHER4xJKHqwnQkeaHnq062xQvyDMuTtKSSMQWPRkIclgW80v3N2YPMx+CrrDtcTPfuoDWp22MsL9kowtt5FVXe3nmXIZnLdcPJHq6IKbVnmDQN7PsX0zwIXAUo1aeN8kC2ePXXlE/yOSchJS+V5vzItYNzNhGOvsDtXWRywJfH3errvRehMKrkneXwitvsVqKFozyswVMmfYpc1Y7FomwcSgqvuF3Qg7SXv9HvqxoUVR0P/el2K8BmVknqOWF3+EijtrBp529Z81hdSG7bG651MmdkJldmHFKEiEpb/1vlbSLSlVgR/trC9CGxwCGCnDO0fQSsLWPhfUJy4Bpy7kRa2E1dMoi5wDAujlOwc1gQL9pp7TjyvL7QjGZO2iOe+kQS2UcX7kcbGPJaolsKPFC/1JcNDzT7taihoXZYwQDd2zyPYFBRyUQLlKZDKHen4cQsYE4xG2JP0KGA2T3BbNoQ6eI3peQCtb0q6OahuMyvpp7TrHlzmgiNZLvza+6WHpqbVd48bbL/pFT0g1h328pIaBpbMGt8Iw26ixaGQS3yksRrkRh1AUfmQLZ8W6lqtcBVVr9bMYuIanI76dNqWpCUCdus3x/ZQzkfJPm0jYS95tCEIGhIoQOL5FT4fR/nQgFAM+Q81a2ReC7+5AzOE/jWzgBNKmSyDVmTlGqNkg082ypRz7PLxjxBMiVXgONx7SioR5Lbf7anHJcng937ZooBCLpmqcZEPwVPHvmXvWO5YdT1PcEltA8B8AD2eOCo8WQczblR6FUtb2eQiCNXJfuATldteGbfSk0dJH+Ix5mQAjxD0ITBMEG6Ex57Et987H9zWXeX/eUOwR4pL4pRMONXFrlliJpKzxOI03obhmKcvrMqqBNaYDXyHsUDVTyNiyk9LZYIo68+UqvueAGlkhzOb+GVmkT19uSnSww/hGrTlshankrruKeOeJ20S8gMID/Wv6SQPExNjbmQjmp4btqpB4sxF284FUAHNKjkdftqnFJ8NnybeKYmHY/B7TnAP0iO+KbmSgNBNilas+y++D1yR6AF9Nez0yJTDN1tkm46CjUqEbQTKZnrQ9bwlEvmJazTIqUC5Y10f7HdHixhqhNxOHNnfhp0dO2ROBzsB5uOjQQRvDkpygnc/R5iFU1FVUXD5y29M6GpXiprgouXx7/J1ZGHUuMqN/Tp4wNEXev3b8V+A0bIqDZC/vOwW8Y2bRHlkdXzbWdWZL8QcQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aac7520a-c306-4c21-0113-08db07ae978c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2023 19:24:25.8014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4ElCJRPJVMK6N1Cnwyr7++tydJfXnMPWonRna7WH2UvVzWZpI/UwD3P6d/8YaWTCaIuhz05IS7iooAVIJ9GxqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8391 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1757021751591746397?= X-GMAIL-MSGID: =?utf-8?q?1757021751591746397?= We have two IS1 filters of the OCELOT_VCAP_KEY_ANY key type (the one with "action vlan pop" and the one with "action vlan modify") and one of the OCELOT_VCAP_KEY_IPV4 key type (the one with "action skbedit priority"). But we have no IS1 filter with the OCELOT_VCAP_KEY_ETYPE key type, and there was an uncaught breakage there. To increase test coverage, convert one of the OCELOT_VCAP_KEY_ANY filters to OCELOT_VCAP_KEY_ETYPE, by making the filter also match on the MAC SA of the traffic sent by mausezahn, $h1_mac. Signed-off-by: Vladimir Oltean --- tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh b/tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh index 9c79bbcce5a8..aff0a59f92d9 100755 --- a/tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh +++ b/tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh @@ -246,7 +246,7 @@ test_vlan_ingress_modify() bridge vlan add dev $swp2 vid 300 tc filter add dev $swp1 ingress chain $(IS1 2) pref 3 \ - protocol 802.1Q flower skip_sw vlan_id 200 \ + protocol 802.1Q flower skip_sw vlan_id 200 src_mac $h1_mac \ action vlan modify id 300 \ action goto chain $(IS2 0 0)