Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16601421rwd; Mon, 26 Jun 2023 12:16:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7birgpOWx5E7aZSmWvqJS0eiXxnvpFNy5soaxdQj31qPeWQLKW1FyNsR4QUa9F6BqUNdcK X-Received: by 2002:a2e:8855:0:b0:2b5:fef9:6ad6 with SMTP id z21-20020a2e8855000000b002b5fef96ad6mr3872709ljj.25.1687806968363; Mon, 26 Jun 2023 12:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687806968; cv=none; d=google.com; s=arc-20160816; b=KnglSNiclhYbalMz6mJLPM0q92nLUCF0WNDVjlfawF/HrME8iS5FSEjfnTG4Mh0S52 79A2ay5wG1A38W4XmeTRvtmzD/6X+Nz5w3TZ2NTQG90PIxrx+YXNiwt5OOXa0RwlSRFd g6BjQShkcfunJHS2rLaggt7EUSyrEPG9ARGNUtXHluYmJbD7APfHXmemreyGyULa4vBO FmwLHIILfCh+K/T5sLCPPxqn7KiHYMElLf8nIZiGPuCJajU/Dc3Otcn6yAHuG5NksIGd XIpR6fAD/LhpEEjmzJ7mKPjiwp50fOxzBnUEnvACluRAiRqR3czngP5m4EkY/F7bCsSz G/hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:subject:cc:to:from:date:message-id:dkim-signature; bh=YHaGiadj1/XOqlPkGLzbFu74E9MIGjrASNEgHQUgemo=; fh=yNpC0mXHu9ZyJGnQv0lydCHm7NDonQureEy1vw0xEbg=; b=e0gNmDmZJPcz9HlqxMjeo8Ny3AF35Z8slvOF8vL4GmnZoU0b0xgw4Wu/T7mhzVUyrX +r3T25VFR5h9ZXROvopJ2PxQnn4MpX1W8Z8tPzxKTBaCht+4nmJtOP14V07ZyIQ+pUh8 D366GP1KfdSQw14HZwWB2qEm9TEF4cLNTLqTD90NqNnEmecPQfmqfS2SfAdeK2EOTQWg HUaOa3xNpKfbsV5Hn0JA+2p0WMNFBcTmAbRqzXB01F+m8fyrPMfmefYxJjUObasYx9F6 THTCHlBCGmclZo3yUcd+hGfRHjaTyrwYPc+ETBkxH94I+KjIWPSUn/CzeEpqG128C9+o FC/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Uyl45V6m; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gy14-20020a170906f24e00b0098f69e9f021si1766587ejb.211.2023.06.26.12.15.17; Mon, 26 Jun 2023 12:16:08 -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=@gmail.com header.s=20221208 header.b=Uyl45V6m; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbjFZSH4 (ORCPT + 99 others); Mon, 26 Jun 2023 14:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbjFZSHy (ORCPT ); Mon, 26 Jun 2023 14:07:54 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F13E106; Mon, 26 Jun 2023 11:07:51 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-313f2a24cb6so1338681f8f.0; Mon, 26 Jun 2023 11:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687802870; x=1690394870; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=YHaGiadj1/XOqlPkGLzbFu74E9MIGjrASNEgHQUgemo=; b=Uyl45V6m6U9YHt9wlOOlncRXWyaK4xPJJJfj7xGUG4TiROxIbdxbXkp5iggUC/+Cbc gLbPKV7Xf46HUBS2ythvz71UFSfNQQb3VA11KprCCUpVUQBkHhiOKC/xyrw3gDgF1Q2T pn1V7qpp6oQSO0ROYW4qRAyfGI0Wffd7e4fQq9j2vH0Wi4iAlDC3H+Lwl94ubElInhjb /Xh2AZb1i1kiFRkI1yZo2zwQQb751PJbtZg7pmP6F7BOMMajTs4JEgry7CR4EgjN/nki 8UBBLGP1qfbKSeSqqAj1g6NqDR90hwmmXjxG0cNFjYijwqQq8em5OdxtFY9AmICjWCs5 KMXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687802870; x=1690394870; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YHaGiadj1/XOqlPkGLzbFu74E9MIGjrASNEgHQUgemo=; b=lU5K18T5AB+vefoyhCz96f8ygzME1QWCccfbzXU6Z5uwm7uzY5RhDIRq43wysUyW30 8hjkEsgnierl05Gxs5ePH3JqnCo3BnIzYViVmhYf21OchMlS2MrfmJufmBQn+IrFwTJP Eb0I3VQLdh5dEh/CBne0R2za1SdMOsW4eKYFSgaEFGkDp1ksKmVvJAdGN1p3TTnMrv53 IBOu1IHM/vxMb3bAdVSAvRiLNTG+peD9smcUvJD6/ZGohIcJvbWfen+sn4Uq8gecoL59 KzJLofvRkGcjWRrGBEabXLpakYRA/o5LlzrOMprVC3mYYxyHb06V//1lVqowC9+mi2hs PJNg== X-Gm-Message-State: AC+VfDyOg7feEm4LF8sjWwtDwIT1iRaBs+hpqbT5D8PhJ6ytCdZBcxmi Hq+JENCMEVUKRRyWnvUQ5FQtrey7rWY= X-Received: by 2002:a5d:424d:0:b0:313:f2c6:a4f1 with SMTP id s13-20020a5d424d000000b00313f2c6a4f1mr2521853wrr.36.1687802869493; Mon, 26 Jun 2023 11:07:49 -0700 (PDT) Received: from Ansuel-xps. (93-34-93-173.ip49.fastwebnet.it. [93.34.93.173]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b00301a351a8d6sm8109818wrb.84.2023.06.26.11.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 11:07:49 -0700 (PDT) Message-ID: <6499d3f5.050a0220.3becf.7296@mx.google.com> X-Google-Original-Message-ID: Date: Mon, 26 Jun 2023 19:59:41 +0200 From: Christian Marangi To: Vladimir Oltean Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Atin Bainada , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH RFC] net: dsa: qca8k: make learning configurable and keep off if standalone References: <20230623114005.9680-1-ansuelsmth@gmail.com> <20230623114005.9680-1-ansuelsmth@gmail.com> <20230625115803.6xykp4wiqqdwwzv4@skbuf> <6499c31c.df0a0220.e2acb.5549@mx.google.com> <20230626173056.zq77nilzrr5djns5@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230626173056.zq77nilzrr5djns5@skbuf> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING 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 On Mon, Jun 26, 2023 at 08:30:56PM +0300, Vladimir Oltean wrote: > On Mon, Jun 26, 2023 at 06:41:50PM +0200, Christian Marangi wrote: > > > Once that basic precondition passes, you should be able to start looking > > > at tools/testing/selftests/drivers/net/dsa/ and run those one by one. > > > An interesting one would be local_termination.sh, which monitors the way > > > in which frames reach the CPU. Though be aware that some sub-tests from > > > that suite will fail on misconfigurations that are non-fatal (and don't > > > impact functionality), just sub-optimal (affecting performance). Like > > > sending unknown packets to the CPU when the port is non-promiscuous and > > > software would drop those packets anyway. > > > > > > > Lots of difficult to run the selftests on a light fw but step at times > > I'm managing to make use of them (could be helpfull to add some comments > > in the .config saying that the testing port needs to be declared in the > > struct) (and maybe some additional checks on the kind of device type are > > required for the test to actually work (vrf, dummy, macvlan...) > > Yeah, that doesn't sound like a bad idea at all. AFAIK, > tools/testing/selftests/net/forwarding/lib.sh doesn't check > "zcat /proc/config.gz" at all. Maybe it would be nice if it did, and to > guard that behavior based on some REQUIRE_* variables that are true by > default (but can be set to false by scripts). > Some thing can even be checked by simply creating an interface and see if the thing gives error. I feel this is a better approach than checking config and kflags since from what I can see the idea of these scripts is to be system agnostic and sometimes it's handy to ""compile"" or package these scripts on a different system than the target one (this is true for every shell script and target specific stuff that needs to be compiled is not the case) > > Anyway a run of local_termination.sh produce the following output. > > # selftests: drivers/net/dsa: local_termination.sh > > # TEST: lan1: Unicast IPv4 to primary MAC address [FAIL] > > # reception failed > > Hmm, so ping works but this doesn't? That's strange, because send_uc_ipv4() > also pings. Have you run with bash -x to see why it fails? > I just run with bash -x and I also mod the script to not delete the tcpdump. Limiting the script to only this test the dump is just 2 ICMPv6 packet and no output from tcpdump aside from tcpdump: listening on lan1, link-type EN10MB (Ethernet), snapshot length 65535 bytes 3 packets captured 5 packets received by filter 0 packets dropped by kernel I feel like this is important so I think I should focus on understanding why this doesn't work? Any clue? > > # TEST: lan1: Unicast IPv4 to macvlan MAC address [FAIL] > > # reception failed > > # TEST: lan1: Unicast IPv4 to unknown MAC address [ OK ] > > So the only reason why this test passes is because in this case, the > unicast drops are okay? > > > # TEST: lan1: Unicast IPv4 to unknown MAC address, promisc [FAIL] > > # reception failed > > # TEST: lan1: Unicast IPv4 to unknown MAC address, allmulti [ OK ] > > Similar here. Packet should have been dropped; the test detects a drop => okay. > Passes for the wrong reason, most likely, because this driver doesn't react > on IFF_PROMISC or IFF_ALLMULTI. > > > # TEST: lan1: Multicast IPv4 to joined group [ OK ] > > # TEST: lan1: Multicast IPv4 to unknown group [FAIL] > > # reception succeeded, but should have failed > > "reception succeeded, but should have failed" is the okay kind of failure. > "reception failed" is what's bothering. > > > # TEST: lan1: Multicast IPv4 to unknown group, promisc [FAIL] > > # reception failed > > # TEST: lan1: Multicast IPv4 to unknown group, allmulti [ OK ] > > # TEST: lan1: Multicast IPv6 to joined group [ OK ] > > # TEST: lan1: Multicast IPv6 to unknown group [FAIL] > > # reception succeeded, but should have failed > > # TEST: lan1: Multicast IPv6 to unknown group, promisc [FAIL] > > # reception failed > > This I cannot explain. For the test right above, "Multicast IPv6 to unknown group", > it said that reception succeeded. This is sending the same packet, only > the IFF_PROMISC flag of the device changes (this is also propagated to > the DSA master). I've no idea why it fails. Again, bash -x will say more. > > > # TEST: lan1: Multicast IPv6 to unknown group, allmulti [ OK ] > > # TEST: br0: Unicast IPv4 to primary MAC address [FAIL] > > # reception failed > > # TEST: br0: Unicast IPv4 to macvlan MAC address [FAIL] > > # reception failed > > # TEST: br0: Unicast IPv4 to unknown MAC address [ OK ] > > # TEST: br0: Unicast IPv4 to unknown MAC address, promisc [FAIL] > > # reception failed > > # TEST: br0: Unicast IPv4 to unknown MAC address, allmulti [ OK ] > > # TEST: br0: Multicast IPv4 to joined group [ OK ] > > # TEST: br0: Multicast IPv4 to unknown group [FAIL] > > # reception succeeded, but should have failed > > # TEST: br0: Multicast IPv4 to unknown group, promisc [FAIL] > > # reception failed > > # TEST: br0: Multicast IPv4 to unknown group, allmulti [ OK ] > > # TEST: br0: Multicast IPv6 to joined group [ OK ] > > # TEST: br0: Multicast IPv6 to unknown group [FAIL] > > # reception succeeded, but should have failed > > # TEST: br0: Multicast IPv6 to unknown group, promisc [FAIL] > > # reception failed > > # TEST: br0: Multicast IPv6 to unknown group, allmulti [ OK ] > > > > Things doesn't look good to me or I am wrong? > > Nope, doesn't look good at all. Looks like an incomplete setup. -- Ansuel