Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp910543rwi; Mon, 31 Oct 2022 08:59:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EvH5CEMLuqwunZMTC3HWuD+6a+HRYMiptGwXkqOI/cgIBRaPywe6csHWrgxG22DGqem2Y X-Received: by 2002:aa7:c3ca:0:b0:463:4784:bcec with SMTP id l10-20020aa7c3ca000000b004634784bcecmr7405492edr.315.1667231969328; Mon, 31 Oct 2022 08:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667231969; cv=none; d=google.com; s=arc-20160816; b=nT0sp7vXt995XexUzO6vSQJ6oTLCHPW/IDon3Zuz3ICufekC9UwLVJiSdjHB3rXSvu TtNniVQubxqYEuU01CS/e/NLIHeK4llsIUhESE8ZnVhLCYI4Pgv4CRAq4fjIZz2cqQza 5HHa2xO/tBuJo9PRQbSU5CVaPyiwjKL0Hf6p0oQknsZAPaqMRrAb5UTaizHnYaTcHy9J 74wrXGihBGwVUEAG2Up9QY5uQENwjpLkPZAijrTakfkwcgvjDg3vKVGlQbwvl4yMFoFC 2IltuqBnSfgNb7h4GBSZcoVVLaAXcQV4d4DVKLjpB4h1CKMNBl2NaO6XM6bddTwff7Qk BuDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=qM0Vnk1JKwz9CHmMSGtyy/wMpDPgeuLnuHkoMyR+Hfo=; b=wHo5SGMsaSYGtUkgcJjlwiykQsvlHooxivzgzEUHQreuKx20POvD409Wi4xCu7lKtG Yki1h/65KvOSCHIrvDMrGBxqiUwEMxAdsF2MyTLO7rBb+CnZthSnG2KdCepYHUL4JDgL WrRm5h9Ct49uhy0m/+I3wDILDvXaRIZBkwLzAwJr4eZb8POXB/sM/O/zs0C7GPUYNKxr 6eLHKl9thA5N+q2nz+9P3ifdlgwiIcfw6TwHLyY9j34T6SeB0bkCVyBhz0v1Wzx8erqL Ikzj7ga3+1rgbFO64pfLbtXQlVeBX+49SId0g9jLud1xojc/dbny74gQk1P/g3dUsyJP vEXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="pPU/7QJ6"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056402254800b0045d9a3adf19si9198510edb.564.2022.10.31.08.59.05; Mon, 31 Oct 2022 08:59: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=@microchip.com header.s=mchp header.b="pPU/7QJ6"; 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 S231795AbiJaPv4 (ORCPT + 98 others); Mon, 31 Oct 2022 11:51:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbiJaPvy (ORCPT ); Mon, 31 Oct 2022 11:51:54 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 414A211C01; Mon, 31 Oct 2022 08:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667231513; x=1698767513; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=/e/xVUZOgx6ZC1PZjHKMVt7ZDLH/w5AwFjP1sMSN8Qw=; b=pPU/7QJ6EUkuF8jzSAMjhbNKW+LCpgQhSgZ4L09xXh1718KAEZsaym+Z WPcvLGOTKI/mQWA9jYn/v9DfzwdRIXtDodj67U+MGD59UnRLxS8d6Npqy cKq9057cn02XqRMv4pAiQav+U+EwIS05aKEaDM5G7fKKd9WnsKmGxGxOe Xxok1CHHiUafx8qsH7ofb8ugI9quP8LELnOPA13E+cvO2clXM4IXFo9Hw LDscqApgyU5av4MwhvBiXX/bZPPb4HAvW9d+Vw/jGEe6qmEYvFxtnWfjE nDooa6SXNgPCSUNPyYSxhjY5/2aFB4mltIIrXDTBHB3O53ur2u8+RYjYb Q==; X-IronPort-AV: E=Sophos;i="5.95,228,1661842800"; d="scan'208";a="197767741" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 31 Oct 2022 08:51:52 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.12; Mon, 31 Oct 2022 08:51:51 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 31 Oct 2022 08:51:48 -0700 Message-ID: <1625e326b6b8fc030425c61c29d31262366edf7a.camel@microchip.com> Subject: Re: [PATCH net-next v2 2/5] net: microchip: sparx5: Adding more tc flower keys for the IS2 VCAP From: Steen Hegelund To: Casper Andersson CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , Randy Dunlap , Russell King , "Wan Jiabing" , Nathan Huckleberry , , , , Daniel Machon , Horatiu Vultur , Lars Povlsen Date: Mon, 31 Oct 2022 16:51:47 +0100 In-Reply-To: <20221031145209.hqebvyfqdsrzhiuh@wse-c0155> References: <20221028144540.3344995-1-steen.hegelund@microchip.com> <20221028144540.3344995-3-steen.hegelund@microchip.com> <20221031103747.uk76tudphqdo6uto@wse-c0155> <51622bfd3fe718139cece38493946c2860ebdf77.camel@microchip.com> <20221031145209.hqebvyfqdsrzhiuh@wse-c0155> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 MIME-Version: 1.0 X-Spam-Status: No, score=-5.5 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 Hi Casper, On Mon, 2022-10-31 at 15:52 +0100, Casper Andersson wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know th= e content is safe >=20 > Hi Steen, >=20 > On 2022-10-31 13:14, Steen Hegelund wrote: > > Hi Casper, > >=20 > > First of all thanks for the testing effort (as usual).=C2=A0 This is mo= st welcome. > >=20 > > On Mon, 2022-10-31 at 11:44 +0100, Casper Andersson wrote: > > > EXTERNAL EMAIL: Do not click links or open attachments unless you kno= w the content is safe > > >=20 > > > Hi Steen, > > >=20 > > > On 2022-10-28 16:45, Steen Hegelund wrote: > > > > - IPv4 Addresses > > > > =C2=A0=C2=A0=C2=A0 tc filter add dev eth12 ingress chain 8000000 pr= io 12 handle 12 \ > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 protocol ip flower skip_= sw dst_ip 1.0.1.1 src_ip 2.0.2.2=C2=A0=C2=A0=C2=A0 \ > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 action trap > > >=20 > > > I'm not able to get this working on PCB135. I tested the VLAN tags an= d > > > did not work either (did not test the rest). The example from the > > > previous patch series doesn't work either after applying this series. > >=20 > >=20 > > Yes I did not really explain this part (and I will update the series wi= th an explanation). > >=20 > > 1) The rule example in the previous series will no longer work as expec= ted as the changes to the > > port keyset configuration now requires a non-ip frame to generate the M= AC_ETYPE keyset. > >=20 > > So to test the MAC_ETYPE case your rule must be non-ip and not use "pro= tocol all" which is not > > supported yet. > >=20 > > Here is an example using the "protocol 0xbeef": > >=20 > > tc qdisc add dev eth3 clsact > > tc filter add dev eth3 ingress chain 8000000 prio 10 handle 10 \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 protocol 0xbeef flower skip_= sw \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dst_mac 0a:0b:0c:0d:0e:0f \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 src_mac 2:0:0:0:0:1 \ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 action trap > >=20 > > And send a frame like this (using EasyFrame): > >=20 > > ef tx eth_fiber1 rep 10 eth dmac 0a:0b:0c:0d:0e:0f smac 2::1 et 0xbeef = data repeat 50 0x61 >=20 > Thanks, this works. I saw now that you even mentioned that "protocol > all" doesn't work at the very end of this commit message. >=20 > > I am not sure what went wrong when you tested the ipv4 rule, but if I c= reate the rule that you > > quoted above the rule is activated when I send frames like this: > >=20 > > ef tx eth_fiber1 rep 10 eth dmac 0a:0b:0c:0d:0e:0f smac 2::2 ipv4 dip 1= .0.1.1 sip 2.0.2.2=C2=A0 data > > repeat 50 0x61 >=20 > Looks like adding the "data" at the end of it makes a difference when > creating the packets. Without it the ip.proto field becomes 17 (UDP). > With "data" it becomes 0 (IPv6 Hop-by-Hop Option). Ef will defaults to > 17 if no data is specified, otherwise it ends up 0. And the reason > UDP doesn't get trapped I assume is because this rule falls under the > IPV4_OTHER keyset (as opposed to IPV4_TCP_UDP). Yes the EasyFrame tool just uses defaults if you do not specify any data fo= r the frame, so I usually try to remember to do that to tweak the test a bit. >=20 > Doing just this was enough: > ef tx eth0 rep 10 eth dmac 0a:0b:0c:0d:0e:0f smac 2::2 ipv4 dip 1.0.1.1 s= ip 2.0.2.2 data >=20 > This also solved it for VLANs. I have successfully tested ipv4, ipv6, > protocol info (ICMP), and vlan tag info from the examples you provided. >=20 > Tested on Microchip PCB135 switch. >=20 > Tested-by: Casper Andersson >=20 > BR, > Casper >=20 > >=20 > > Note that the smac is changed to avoid hitting the first rule. > >=20 > > 2) As for the VLAN based rules, the VLAN information used by IS2 is the= classified VID and PCP, > > so > > you need to create a bridge and add the VID to the bridge and the ports= to see this in action. > >=20 > > IS0 uses the VLAN tags in the frames directly: this is one of the diffe= rences between IS0 and > > IS2. > >=20 > > This is how I set up a bridge on my PCB134 when I do the testing: > >=20 > > ip link add name br5 type bridge > > ip link set dev br5 up > > ip link set eth12 master br5 > > ip link set eth13 master br5 > > ip link set eth14 master br5 > > ip link set eth15 master br5 > > sysctl -w net.ipv6.conf.eth12.disable_ipv6=3D1 > > sysctl -w net.ipv6.conf.eth13.disable_ipv6=3D1 > > sysctl -w net.ipv6.conf.eth14.disable_ipv6=3D1 > > sysctl -w net.ipv6.conf.eth15.disable_ipv6=3D1 > > sysctl -w net.ipv6.conf.br5.disable_ipv6=3D1 > > ip link set dev br5 type bridge vlan_filtering 1 > > bridge vlan add dev eth12 vid 600 > > bridge vlan add dev eth13 vid 600 > > bridge vlan add dev eth14 vid 600 > > bridge vlan add dev eth15 vid 600 > > bridge vlan add dev br5 vid 600 self > >=20 > > This should now allow you to use the classified VLAN information in IS2= on these four ports. > >=20 > > >=20 > > > This example was provided in your last patch series and worked earlie= r. > > >=20 > > > My setup is PC-eth0 -> PCB135-eth3 and I use the following EasyFrames > > > command to send packets: > > >=20 > > > ef tx eth0 rep 50 eth smac 02:00:00:00:00:01 dmac 0a:0b:0c:0d:0e:0f > > >=20 > > > IPv4: > > > tc qdisc add dev eth3 clsact > > > tc filter add dev eth3 ingress chain 8000000 prio 12 handle 12 \ > > > =C2=A0=C2=A0=C2=A0 protocol ip flower skip_sw dst_ip 1.0.1.1 src_ip 2= .0.2.2=C2=A0=C2=A0=C2=A0 \ > > > =C2=A0=C2=A0=C2=A0 action trap > > >=20 > > > ef tx eth0 rep 50 eth smac 02:00:00:00:00:01 dmac 0a:0b:0c:0d:0e:0f i= pv4 dip 1.0.1.1 sip > > > 2.0.2.2 > > >=20 > > > Same setup as above and I can't get this to work either. > >=20 > > Maybe you are hitting the first rule here, so changing the smac to avoi= d that, should help. > >=20 > > >=20 > > > I'm using tcpdump to watch the interface to see if the packets are be= ing > > > trapped or not. Changing the packets' dmac to broadcast lets me see t= he > > > packets so I don't have any issue with the setup. > > >=20 > > > BR, > > > Casper > > >=20 > >=20 > > Best Regards > > Steen >=20 > BR, > Casper Thanks again for the testing. I will send an updated series with a bit mor= e explanation in the commit header. BR Steen