Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1071701rdg; Fri, 11 Aug 2023 08:51:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcPARH81d+fkGPXlTTe3luAMZaCPvEVKVpqCQ5rF5gjm+f/MNtXQIs++YmLOIi9suTfqQu X-Received: by 2002:a17:90a:d50e:b0:26b:36a4:feeb with SMTP id t14-20020a17090ad50e00b0026b36a4feebmr115617pju.8.1691769107833; Fri, 11 Aug 2023 08:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691769107; cv=none; d=google.com; s=arc-20160816; b=V+KkskxUlFbNRYBykicQBC3foZefalozeal5PhKsGCeFyjZU2FcWeQNW8oTZ/BWXk/ 5eRPB8bBCIlXbe8F6ju2wdVPSj1OaQFKQoGwCSCcCw8mXBmNFhkgSRfE7VBtm93CBr2e Q1jsneGUpt1lZJriQ4OchDL2Ufs0rTiuVFk3g8imJJAmpa/VXLnflGjKTOczZJopR9qn XC15f+SWoguc3WrWjAMHX1IWsoOz9zC2bMvSJBpWIo4FCGL3RJm5g/ggGBeJX4XZPMGr ZnGkYRyLM2L+v2m+N0hw998wre9PcFOwGKcuS3LCzHeT74DJF+EgsMJkMXy2xQKcdSTy 1JZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Wy7zK6vSDaRCBgbn9Oe3v1sNULI66WXjvy9IJ4+x0Ls=; fh=WCGBiObhv8AUZxDa8hC4uKf5dJItVUrcexXoAA6vM9I=; b=Ig9pzgL9q6sy5zXUNT4N0nkkKMhPvv99hI9n0sh7WZYg5z4C0adEaG9AXV2iXC1bqw fc67eWyBjqay2G8yG/jH7bD9klOmKNv79LQhBWqaYTKqdX5uS3xfqplJLvrm4Qpmc3gf 9ATS2ll2OGeORQQuthOr3dyZAHgqSSyleqpIn8wJpUP1HMBmjQ0P5QknHnByWjcitEKA PgWa82z/XOQVMAWHdQWWQ3MUe3R8q623TtHdCGGCYw3cgcPUMYVhXvPbfT77UGGHIdjp SOQ50n1ppfq3YiUtDwjQnKZ2VfF+/R9DlELBjiKy9CVwAmxdu6/MD6I7t+CO9GRMgm84 7vVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cvZP4I+b; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cu13-20020a17090afa8d00b00262ee7c6cafsi3604111pjb.87.2023.08.11.08.51.36; Fri, 11 Aug 2023 08:51:47 -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=@kernel.org header.s=k20201202 header.b=cvZP4I+b; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236013AbjHKP0j (ORCPT + 99 others); Fri, 11 Aug 2023 11:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236057AbjHKP0g (ORCPT ); Fri, 11 Aug 2023 11:26:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F9930D8 for ; Fri, 11 Aug 2023 08:26:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2BA6867486 for ; Fri, 11 Aug 2023 15:26:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18745C433C7; Fri, 11 Aug 2023 15:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691767594; bh=8LXyzi9tvgdg/Pt2fdxEW4wGcEQOw91QGZ21a4I/e4w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cvZP4I+bsBDIGK4WsAPL+Bb5UUmNb7iVuvIfagSWS/sAp831+bUMfPaS+ZoTFtrsC psChQEYansyXexDJqNiT/liRlZ1DMW2KprtT+LIKOKgYZeFzMUrhdw7Pk5NHU6QQXR 9tX8JqgefFaI62JUNJa1YmX4gCyNlvJNYn8NFirfFJHiCRutPqDTyY5K5usMUWUOkS aHL+DQHN3TTYtsH+Nut3XmtMvykQhAJph0vdiax6qhTX/hq+FgCI0sJHjJm5cglfJK wa8ZqErohcznOUjY+zYTbmVE7rkMgXJYztWygBmezaROcEWbXVWjTBZ/bOCE/bvxdS yfNUCt07FOj8w== Message-ID: <3fc59b72-65fb-66e3-e291-ec20d1f468d4@kernel.org> Date: Fri, 11 Aug 2023 18:26:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v2] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support Content-Language: en-US To: Vladimir Oltean Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, s-vadapalli@ti.com, srk@ti.com, vigneshr@ti.com, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230810152538.138718-1-rogerq@kernel.org> <20230810152538.138718-1-rogerq@kernel.org> <20230810154703.cyyivcxlppdqr45q@skbuf> From: Roger Quadros In-Reply-To: <20230810154703.cyyivcxlppdqr45q@skbuf> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 Hi Vladimir, On 10/08/2023 18:47, Vladimir Oltean wrote: > Hi Roger, > > On Thu, Aug 10, 2023 at 06:25:38PM +0300, Roger Quadros wrote: >> Add driver support for viewing / changing the MAC Merge sublayer >> parameters and seeing the verification state machine's current state >> via ethtool. >> >> As hardware does not support interrupt notification for verification >> events we resort to polling on link up. On link up we try a couple of >> times for verification success and if unsuccessful then give up. >> >> The Frame Preemption feature is described in the Technical Reference >> Manual [1] in section: >> 12.3.1.4.6.7 Intersperced Express Traffic (IET – P802.3br/D2.0) >> >> Due to Silicon Errata i2208 [2] we set limit min IET fragment size to 124. >> >> [1] AM62x TRM - https://www.ti.com/lit/ug/spruiv7a/spruiv7a.pdf >> [2] AM62x Silicon Errata - https://www.ti.com/lit/er/sprz487c/sprz487c.pdf >> >> Signed-off-by: Roger Quadros >> --- >> >> Hi, >> >> Dropping the RFC tag as I now have MAC merge verification and frame >> preemption working. >> >> Changelog: >> v2: >> - Use proper control bits for PMAC enable (AM65_CPSW_PN_CTL_IET_PORT_EN) >> and TX enable (AM65_CPSW_PN_IET_MAC_PENABLE) >> - Common IET Enable (AM65_CPSW_CTL_IET_EN) is set if any port has >> AM65_CPSW_PN_CTL_IET_PORT_EN set. >> - Fix workaround for erratum i2208. i.e. Limit rx_min_frag_size to 124 >> - Fix am65_cpsw_iet_get_verify_timeout_ms() to default to timeout for >> 1G link if link is inactive. >> - resize the RX FIFO based on pmac_enabled, not tx_enabled. >> >> Test Procedure: >> >> - 2 EVMs with AM65-CPSW network port connected to each other >> - Run iet-setup.sh on both >> >> #!/bin/sh >> #iet-setup.sh >> >> ifconfig eth0 down >> ifconfig eth1 down >> ethtool -L eth0 tx 2 >> ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off >> ethtool --set-mm eth0 pmac-enabled on tx-enabled on verify-enabled on verify-time 10 tx-min-frag-size 124 >> ifconfig eth0 up >> sleep 10 >> >> tc qdisc replace dev eth0 handle 8001: parent root stab overhead 24 taprio \ >> num_tc 2 \ >> map 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 \ >> queues 1@0 1@1 \ >> base-time 0 \ >> sched-entry S 01 1216 \ >> sched-entry S fe 12368 \ >> flags 0x2 \ >> fp P E E E E E E E >> >> tc -g class show dev eth0 >> tc qdisc add dev eth0 clsact >> tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5002 0xffff action skbedit priority 2 >> tc filter add dev eth0 egress protocol ip prio 1 u32 match ip dport 5003 0xffff action skbedit priority 3 >> >> - check that MAC merge verification has succeeded >> >> ethtool --show-mm eth0 >> >> MAC Merge layer state for eth0: >> pMAC enabled: on >> TX enabled: on >> TX active: on >> TX minimum fragment size: 124 >> RX minimum fragment size: 124 >> Verify enabled: on >> Verify time: 10 >> Max verify time: 134 >> Verification status: SUCCEEDED > > Do you also plan to add support for mqprio, to present the same feature > set as everyone, and permit IET to be used without EST? Yes. I'll try to include it in next spin. > > What else would need to change in order for the am65 cpsw to > successfully run the existing tools/testing/selftests/net/forwarding/ethtool_mm.sh? > Just the extra driver-specific ethtool --set-priv-flags? If so, maybe > you could create a wrapper over the generic selftest, and put it in > tools/testing/selftests/drivers/net/. For DSA we also symlink a lot of > bridge selftests, for example. OK. I'll give it a try. > >> - On receiver EVM run 2 iperf instances >> >> iperf3 -s -i30 -p5002& >> iperf3 -s -i30 -p5003& >> >> - On sender EVM run 2 iperf instances >> >> iperf3 -c 192.168.3.102 -u -b200M -l1472 -u -t5 -i30 -p5002& >> iperf3 -c 192.168.3.102 -u -b50M -l1472 -u -t5 -i30 -p5003& >> >> - Check IET stats on sender. Look for iet_tx_frag increments >> >> ethtool -S eth0 | grep iet >> >> iet_rx_assembly_err: 0 >> iet_rx_assembly_ok: 0 >> iet_rx_smd_err: 0 >> iet_rx_frag: 0 >> iet_tx_hold: 0 >> iet_tx_frag: 17307 > > Can you please also implement the standardized ethtool_ops :: get_mm_stats()? > You can see these with ethtool -I --show-mm eth0. Yes. > >> >> - Check IET stats on receiver. Look for iet_rx_frag and iet_rx_assembly_* >> >> ethtool -S eth0 | grep iet >> >> iet_rx_assembly_err: 0 > > This would be struct ethtool_mm_stats :: MACMergeFrameAssErrorCount > >> iet_rx_assembly_ok: 17302 > > This would be struct ethtool_mm_stats :: MACMergeFrameAssOkCount > >> iet_rx_smd_err: 0 > > This would be struct ethtool_mm_stats :: MACMergeFrameSmdErrorCount > >> iet_rx_frag: 17307 > > This would be struct ethtool_mm_stats :: MACMergeFragCountRx > >> iet_tx_hold: 0 > > This would be struct ethtool_mm_stats :: MACMergeHoldCount > >> iet_tx_frag: 0 > > This would be struct ethtool_mm_stats :: MACMergeFragCountTx > Thanks for the hints :) > Also, I opened the AM62x datasheet again and I didn't find this, but I > still need to ask. The CPSW doesn't show the Ethernet counters broken > down by eMAC/pMAC, no? If it does, you should also add support for the > following: I don't think it does. > > ethtool -I --show-pause eth0 --src pmac > ethtool -S eth0 --groups eth-mac eth-phy eth-ctrl rmon -- --src pmac -- cheers, -roger