Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5011228rdb; Tue, 12 Dec 2023 16:43:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFInRa+vVwfuhBR3lPE9Ac3C9eeLmIsH9x+hMhRAijeH/yN9Mm3tL7CCbQPkBkn7Pbn/aqf X-Received: by 2002:a05:6808:3c4f:b0:3ba:1080:f8d9 with SMTP id gl15-20020a0568083c4f00b003ba1080f8d9mr4351206oib.65.1702428209809; Tue, 12 Dec 2023 16:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702428209; cv=none; d=google.com; s=arc-20160816; b=Js7gtejk9WEnOoc7xu3hLn4R7gytzU2soKaAzPjJ+5IrR8ilkIsI8zEKtXCmeFCYOf LQhgUcuUcf0H00HilxWtePoI/zWhrMX9R0qpzTTRsWBZCoZRoBly48b+SZ8wkIFPX47k Fz5rRToFEmxPk6CYleahh2hoQKEdDneDN+tSlbXBonkWX76L48roCgaeGqU+tQ79v6bN wDBtbbZG/PV8bA5CmRk7QATOz3Vwc/NTcCcx56h6mtRxTZFxjWYNoshGcv1CsZEtTEZ3 0831E9Tf5EHk9s+2QbeSzcKHEVoywu2p4zI3yQywaNxo+dPdtQv9gX7L72LEep98Dp4v 3UiA== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=ZKL5eU2NB9nJqOzdxObiNjRSKS27RY2ubeT3N5kNB70=; fh=rslCcVzm7+qV1N/eBfMa39E+ynswTFm2EGrXJ94is/4=; b=lQdMazRrkZgx2j1uMRvcAiwebJNe9+MeGD/jZOjki62eL+KPw4IxhZT03XiT9ylRuh tAErXRXXFXnIIF2+PUOne5n2xeZ/PG/415Ry1cbemDDJpUplvld0MoSV1Li30oqQBdWd c5qTzJ1ZGHrSxfEvDAsayQLAUhP1jfzRpckk/uO6gKkMzTe/4tSvLhImqNAT7V0KxLso d3ahBtNIvOAmjF52zxR9HFyURibIGw4OiccuNpybU6IPj7zhSRsFPGGeN/Z5n2Y3fY7k DrVmm++dhvNwjtnfA1SBKKPQ2Wjwma52HU3R6qm89dDaPBrtrBEA4LNcxeZkilN0YFAv DA7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZH+6Thax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id lk7-20020a17090b33c700b00286c59061e7si10011286pjb.122.2023.12.12.16.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:43:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZH+6Thax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AB633804F444; Tue, 12 Dec 2023 16:43:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232755AbjLMAnK (ORCPT + 99 others); Tue, 12 Dec 2023 19:43:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjLMAnJ (ORCPT ); Tue, 12 Dec 2023 19:43:09 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A43A99; Tue, 12 Dec 2023 16:43:15 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a1c7d8f89a5so839812466b.2; Tue, 12 Dec 2023 16:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702428194; x=1703032994; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZKL5eU2NB9nJqOzdxObiNjRSKS27RY2ubeT3N5kNB70=; b=ZH+6ThaxOfWNxCGmlrFolGuj+hexuFJ+HhMCDsHzH/T79Ausjx9roHL8/dyfDzjhhW 5HXvvbirWfjLxcy9ED3+YxJsR46Sp/dhIXrYK4MoWjdCKw5oifrUsh0IXGCq2GzSpv5S An/WTuz8SUPBYMKRMH6SIOsgKZsbccXO7SKyXe3+AU5vA4dYiCxSqkFMnbMxukRA4iND dEDhyPOYyAmQsl/E9Mkzs6+E/3Efh3U8/bkqPC0bCx+qRYKVXrORZYiyd7uaLraaIqZe +cMlcMEBmq+BMz41MS0F2Kyu5s+R6Q919cH37r8IXEdxGxXKR723hCkL4sLmZE3hs9MM eH5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702428194; x=1703032994; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZKL5eU2NB9nJqOzdxObiNjRSKS27RY2ubeT3N5kNB70=; b=d0vAQtPABdcX6m2h88TQFpBUZd3Na/EckKiR/VCRcZt7cLsrxgzUTQ8yjqnK33Gb1x aDHFidL95hY74HSgguje3kSeHmQJeSi1kAB7x7wK3+9ohQYcyZNjRCzkk3OT1WL3FN2U YVhn7DLQJ8rUzZ/H6nSPkV+Df17IBIb6/Z0anWrOvjH93Q7Lkgr/biKvZvF92IGRYkvA 51i96rO555pRDUxqbemZbDcuBTTV5/QobqoP/+JvPhBC9CZkwJNPetwymQQGRuQvUnRP 4MuUtF73fyDT5+nNl5qCqv5WwER9nikPs9TG1tlcMjVfBXaNSiJwyGP1G6j0xf30w1Yq mteg== X-Gm-Message-State: AOJu0YzLMFDUKbwRBiSlqAPkYeX2+DVbQAYJIkHz5ORBJbuni7UyNtgI Kk++AZ6goUSTDQhKltogd/isbveMtS3NP7m1 X-Received: by 2002:a17:907:962a:b0:a1d:53d8:427e with SMTP id gb42-20020a170907962a00b00a1d53d8427emr4227324ejc.119.1702428193557; Tue, 12 Dec 2023 16:43:13 -0800 (PST) Received: from skbuf ([188.27.185.68]) by smtp.gmail.com with ESMTPSA id vq2-20020a170907a4c200b00a22faee6649sm119305ejc.117.2023.12.12.16.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:43:13 -0800 (PST) Date: Wed, 13 Dec 2023 02:43:11 +0200 From: Vladimir Oltean To: Jianheng Zhang , Jakub Kicinski Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , James Li , Martin McKenny , "open list:STMMAC ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , open list Subject: Re: [PATCH v2 net-next] net: stmmac: xgmac3+: add FPE handshaking support Message-ID: <20231213004311.nptkcubaxuiineec@skbuf> References: <20231212152347.167007f3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212152347.167007f3@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 16:43:26 -0800 (PST) On Tue, Dec 12, 2023 at 03:23:47PM -0800, Jakub Kicinski wrote: > On Tue, 12 Dec 2023 14:05:02 +0000 Jianheng Zhang wrote: > > Adds the HW specific support for Frame Preemption handshaking on XGMAC3+ > > cores. > > > > Signed-off-by: Jianheng Zhang > > I defer to Vladimir on whether to trust that the follow up with > the ethtool API support will come later (and not require rewrite > of existing code); or we should request that it's part of the same > series. > -- > pw-bot: needs-ack > Here's the thing - my understanding of what Synopsys is doing is that they use TC_TAPRIO_CMD_SET_AND_HOLD and TC_TAPRIO_CMD_SET_AND_RELEASE as implicit hints to the stmmac driver that FPE should be enabled. Hold/Release is merely one use case for frame preemption. The "fp" argument in the tc framework gives you access to the rest: preemption without scheduling, preemption with scheduling but without hold/release. And the ethtool-mm framework gives you compatibility with LLDP, so you can adjust the minimum fragment sizes according to the link partner. Roger Quadros is adding am65-cpsw support for FPE using the generic framework, and the TI device has an erratum that the minimum fragment size that can be received cannot be lower than 124 bytes. LLDP allows link partners to discover that and still interoperate - which is very important, because if first-gen TSN hardware, with all its pre-standard quirks, does not deliver, there may not be a second-gen. By using LLDP, you can also enable the FPE handshake based on user space input - when the LLDP daemon gets an LLDPDU with an Additional Ethernet Capabilities TLV, rather than during each and every stmmac_mac_link_up(), and hoping for someone to respond. Depending on your hardware design, this can even lead to power savings, because you can power on your pMAC only when LLDP says the link partner is also capable, and it will be required. Ethtool also gives you the ability to report standardized stats per eMAC and per pMAC, and standardized stats for the MAC Merge layer itself. Also, the FPE state machine from the stmmac driver is so chatty and spams the kernel log so bad, because it has nowhere else to report its current (fragile) state. The ethtool MAC Merge layer gives the driver a way to report its verification state ("FPE Handshake" as Synopsys calls it) in a standardized enum. A small note that the mainline iproute2 does not even expose the TC_TAPRIO_CMD_SET_AND_HOLD and TC_TAPRIO_CMD_SET_AND_RELEASE netlink attribute values. To quote from the manpage (which is not out of date with the code; I checked - again): 'The only supported is "S", which means "SetGateStates"'. So I can only guess that Synopsys and anyone else who wants to turn on FPE on stmmac has to patch their iproute2. A Github code search made me land here: https://github.com/altera-opensource/meta-intel-fpga-refdes/blob/7b050ca9968f5ff71598e86bb3a10bb8e011439c/recipes-connectivity/iproute2/iproute2/0003-taprio-Add-support-for-the-SetAndHold-and-SetAndRele.patch In principle there's nothing wrong with not sharing patches on community software with the rest of the world. But I cannot help but get the impression that stmmac support for FPE is abandonware / extremely low priority / code written to tick the boxes. It's not in the best state even in the "good" case where the XGMAC3+ support gets accepted. Jianheng, please contradict me by showing what testing is currently conducted with this implementation. If none or close to that, let's get it to a more "observable" state, where at least others' tests could be reused. Even this very patch is slightly strange - it is not brand new hardware support, but it fills in some more FPE ops in dwxlgmac2_ops - when dwxgmac3_fpe_configure() was already there. So this suggests the existing support was incomplete. How complete is it now? No way to tell. There is a selftest to tell, but we can't run it because the driver doesn't integrate with those kernel APIs. There are long periods of radio silence from Synopsys engineers in upstream, and as maintainers we simply don't know what stmmac's FPE implementation does and what it doesn't do. If a future user gets into trouble, having a "known good" bisection point, by means of a selftest that passes, is going to allow even non-expert maintainers like us provide some help, even if Synopsys engineers go radio silent again. It may be that Jianheng just needs a little nudge to help the management prioritize, by getting a NACK. It's a simple "help us help you" situation: the framework is there and it is a gateway for better Linux user space support for your platform, you just need to use it. And what better time to integrate with new API than with new hardware... :) Because it's not as if FPE on XGMAC3+ ever worked in mainline given my reading of the code. So why would users not start learning to use it with what is becoming the common tool set for everybody else. Allow me to change the "needs-ack" into: pw-bot: cr