From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80BAECD4853 for ; Wed, 4 Sep 2024 15:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mcX2cY1Y9Cg1FIm24tTfwc/xlRibf5mFH2JL1I2kqCI=; b=tKcL5is9ixAGOtlrzFweEKlWfz ZYuwbUCCR+fOtO8l0BCBIV8N+GKl4ASY4ReFPF/vHvwxJnXiozrieZkDDk19SOiJhn9ZCuKVfdiPA AQ+d1pW0Z/QdAuk8FSy6Th2LHGmI2+4nux6IzGF1HcMLkGOyVdvXru4TtGOrqmw4xiXKX2IsMBONv RiBK9RG/4Omsak4BDyuON0JlrXGFiS0grd4KSJeNllsALwNzSzdv5kYdbqgk3fhO8ISXyTcFnvr6C D2JzrYZAQZSr52DpTfP/wzTnNTzU0H929GuxbFnU1qelxUvpOUYOZeCCpwsI5IyMj/pZjMYjDF8LM GQNFxx6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slsPP-000000058MM-2YjB; Wed, 04 Sep 2024 15:59:03 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slsMI-000000057kQ-09vY for linux-arm-kernel@bombadil.infradead.org; Wed, 04 Sep 2024 15:55:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mcX2cY1Y9Cg1FIm24tTfwc/xlRibf5mFH2JL1I2kqCI=; b=n35PfVEVe+l1BhdC+UlrXIR/et JFinBCstGjefydlEGUV1k56fxFyjqlFBEv/GT48Rtkrqur5rD0U8hImCXpR1+B4f2i+auKLXcoW6s 1zQPmPuV6PBo4+00RGiopRxqy5OtDs4ezsVLI7Mlt1THxrQskbLTdW5cbuyOicYF7/faevgkD4ZZT UJQ/kKJ9Rx6XDl0cEJtl3SGbGZ4r+hmRSzXjFdoLEpNi2syFpgpkJCifH8cKCZGgcoFw6E+X6KWNk qEVB1ioW9OowdIO4ViKW87RHV2PECFgjoKkEs5IDktRfTH/SMY6IeWVp0P00Spk2K9Lmrnz66u1eQ SW4tDmzw==; Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1slsMF-00000000IQu-0OUR for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 15:55:48 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a86939e9d7cso26666466b.2 for ; Wed, 04 Sep 2024 08:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725465344; x=1726070144; darn=lists.infradead.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=mcX2cY1Y9Cg1FIm24tTfwc/xlRibf5mFH2JL1I2kqCI=; b=CCBQBkpYfvtCuSw2OnXb982sIDQ9bcnyry+1ThPfKwqW7mfd9aLCbW2EGn1ZvQiJ14 iCT2DQzm3cEBJAziLK8b0K0AHcVXmbcHmyRLFpRq+eAcHC/mkDqWbHLh18amCfOVii2j sNaFl2raSatrYXzqVimhyqB5nKGMZQ+A7N2oWTEhjUnUuprEhy6EkIlOfWRpkKcUuok8 1g2dRfVGNcVJ8Q0fgr9aNGnGo1kkn3oistc3pImhOLVncbBLyQlrzU3Gwas4hPR5RfYK zY7NMxAddb8VCX0ZuH2pCvgyCdnMlgcxGw80+9MvM77x1WPvaQRgrOv55GDGbH6NsRCq DRLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725465344; x=1726070144; 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=mcX2cY1Y9Cg1FIm24tTfwc/xlRibf5mFH2JL1I2kqCI=; b=JfyKhcIbjXE5yai6/EvwX1HAOJ2gN8SKIuJCwrFZTQ3IsCMq4ykQlRweiNLfLlx1H7 dBRugQ3qGOTuL93ZphYsbM96dLOqFzH7Oxf2nd4egqu9M3KpbCVSH/VSN3ofBIgmMT9W fFiqEBG+97F7ljVoNi4AFq+G9rfU4+hyAjX5fNWQ7aMQ3+Cs5grhaQ46KLYORn8LRlfs G4dDHZBLM1+z1gt5EyFfcModlkyb3DkoCv6WRWFugs4z8uOi4d4merVcjMdH+MInZvWz 2cCNfRtBRdG9wrKww33Y2zLIk7hf/bH2hbDJ7ZPaHdn6gcuCmFQ4sZXhjrg8TCmU/duA yCaw== X-Forwarded-Encrypted: i=1; AJvYcCWs/ulbGajkYWvDzQdptdP5EvLbQJU1znElWt6MLSkW/5Pr8MpotUHCPHECamPZ0NG7D2iXW62VPUf+LD9fT9IK@lists.infradead.org X-Gm-Message-State: AOJu0YyjDuw+NdP566RT9D5p/6iPvo2mYTleu1Megu7mBcJj613dvPmy 42STW/gzUfqyeqFC9L5rhBNoQFzfjSc0+F7Cc09hIhVugQ5rrkVV X-Google-Smtp-Source: AGHT+IHCCHjeecVUu2mfuw+SZXICoUrUnjll4WII6neWRV8Wc3f3RmXhAL6+xuBDckdLKsiyVJeqRg== X-Received: by 2002:a17:907:c21:b0:a7a:9d1e:3b28 with SMTP id a640c23a62f3a-a89a377d761mr766072866b.5.1725465343025; Wed, 04 Sep 2024 08:55:43 -0700 (PDT) Received: from skbuf ([188.25.134.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a6236d16fsm7662166b.99.2024.09.04.08.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 08:55:42 -0700 (PDT) Date: Wed, 4 Sep 2024 18:55:39 +0300 From: Vladimir Oltean To: Furong Xu <0x1207@gmail.com> Cc: Alexander Lobakin , Serge Semin , "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rmk+kernel@armlinux.org.uk, linux@armlinux.org.uk, xfr@outlook.com Subject: Re: [PATCH net-next v7 6/7] net: stmmac: support fp parameter of tc-taprio Message-ID: <20240904155539.mh5crdw7xqudkjur@skbuf> References: <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com> <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com> <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_165547_188769_AD46889C X-CRM114-Status: GOOD ( 21.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 04, 2024 at 05:21:21PM +0800, Furong Xu wrote: > .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 23 +++++++------------ > 1 file changed, 8 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > index 9ec2e6ab81aa..2bdb22e175bc 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > @@ -931,9 +931,9 @@ static int tc_taprio_configure(struct stmmac_priv *priv, > struct tc_taprio_qopt_offload *qopt) > { > u32 size, wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep; > + struct netlink_ext_ack *extack = qopt->mqprio.extack; > struct timespec64 time, current_time, qopt_time; > ktime_t current_time_ns; > - bool fpe = false; > int i, ret = 0; > u64 ctr; > > @@ -1018,16 +1018,12 @@ static int tc_taprio_configure(struct stmmac_priv *priv, > > switch (qopt->entries[i].command) { > case TC_TAPRIO_CMD_SET_GATES: > - if (fpe) > - return -EINVAL; > break; > case TC_TAPRIO_CMD_SET_AND_HOLD: > gates |= BIT(0); > - fpe = true; > break; > case TC_TAPRIO_CMD_SET_AND_RELEASE: > gates &= ~BIT(0); > - fpe = true; > break; > default: > return -EOPNOTSUPP; > @@ -1058,11 +1054,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv, > > tc_taprio_map_maxsdu_txq(priv, qopt); > > - if (fpe && !priv->dma_cap.fpesel) { > - mutex_unlock(&priv->est_lock); > - return -EOPNOTSUPP; > - } > - > ret = stmmac_est_configure(priv, priv, priv->est, > priv->plat->clk_ptp_rate); > mutex_unlock(&priv->est_lock); > @@ -1071,6 +1062,11 @@ static int tc_taprio_configure(struct stmmac_priv *priv, > goto disable; > } > > + ret = stmmac_fpe_map_preemption_class(priv, priv->dev, extack, > + qopt->mqprio.preemptible_tcs); > + if (ret) > + goto disable; > + Doesn't this break taprio for those callers of tc_setup_taprio() which do not implement fpe_map_preemption_class(), but at least want taprio without FPE nonetheless? As in the earlier mqprio patch, they will return -EINVAL here. Through code inspection, those users are: - All users of .tc = dwxgmac_tc_ops: they have .mac = &dwxlgmac2_ops or .mac = &dwxgmac210_ops, neither of which implements fpe_map_preemption_class(). - The users of .tc = &dwmac510_tc_ops which have .mac = &dwmac4_ops. Again, this does not implement .fpe_map_preemption_class(). I can only rely on code inspection, because I don't know what is the priv->dma_cap.estsel value that the above cores were synthesized with. Thus, I don't know if we break a feature which was available before, or one that was already unavailable. My suggestion is similar: allow mqprio.preemptible_tcs to go to non-zero only if fpe_map_preemption_class() is implemented. Then, program it with any value (including 0) only if fpe_map_preemption_class() is implemented. > netdev_info(priv->dev, "configured EST\n"); > > return 0;