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 X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 827C7C433ED for ; Mon, 19 Apr 2021 21:51:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05E976113C for ; Mon, 19 Apr 2021 21:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05E976113C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0dvvx7TyTQxeRfRg3WmLxAG7PvNwcxTDs8mzD7aiTkw=; b=SweSaCjhEl2cBWz2zHHXqqjIL hGrXQT4LJHW8ZipQ/uSkOdF9wTiGvhlh2D6R8gxHGgzo9cVKdQ3RU40/hkYKzCM0aiLfYlyDRfZ6z t7sqPzkdosjvBGFnKDVUUOFG7WG9AYyMxrHNSFHuAFJCBeW/seKVq4Bi6GlDyAdP4/XWI5aJOeoT8 ZMn8sYvRKKur79G8Z5UBgfts+eB1WA8ijCO6GN4CuvbWKDPuZOLmp7M+BXx2DrrifZXxFW5xsSsr6 vQS+yTqO8P9I6SOKYauvpDxCbQ7HBwb44Yg9uk1DUu0IckKD76ND8p4ouX20saqxufWXZ39OgnTuy lbpOx+bwg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYbli-00AgLq-EJ; Mon, 19 Apr 2021 21:49:22 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYblg-00AgLj-Bt for linux-arm-kernel@desiato.infradead.org; Mon, 19 Apr 2021 21:49:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=JXn3Ho4kiCXgfD9yiFqXvyQpWztZ1i1zYDQa5yNiDZc=; b=v1nuXstNqVEk/QQ4bgRwg4ulQl X2ye1utlzIV/12Klp/n9yz8sTy/lCJlfvY0QmNpLgo8d31HO30lgOswp6ZTh7/DP7etA/NKBIJ3Hc NS9sOvWUeCnt1GNncUAmk0J5viozDZZoaFhaJmnY4p+RoUnmDqgp58xpThfmM3UnVtoh5wyk4nAgo 4waXdyZ4Y3mAHzqFgD3YnfDCuD+nyKr7SrxtLVyhAC2x2lLcFr2TiA8czc/NqlNcloj/i+B+UogqD ++uMmOtHOKsB8CRKi673ZPdjOaNEDxcbpEotglo+x9n85RlUVLY5oEgqEtBQ7lIGM16u0ey91SNis 2+iVYgWQ==; Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYblZ-00BgCr-Nm for linux-arm-kernel@lists.infradead.org; Mon, 19 Apr 2021 21:49:18 +0000 Received: by mail-ej1-x630.google.com with SMTP id g5so48509710ejx.0 for ; Mon, 19 Apr 2021 14:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JXn3Ho4kiCXgfD9yiFqXvyQpWztZ1i1zYDQa5yNiDZc=; b=XYlUOBnp2/x5oRaftrKVeFxht1ldNP926XPqKRU+E/7YeckSuPEv6T0uf2FbILZTXr uvNZ/gblRKnjRVPnVgid9/xKUyjsO2XlgV2l/QrokTZCoYaPcnUhIrbldHu3ereccX5z cU2nvAs+a1hyZm6OiJx7iugB+2DT4tLuH2uzedIT7TowLxcEpczi+e23RKQM0QdsyNAH m+CEQCqQRS0Y4AUaWBd9kxHSki3g/eoAuWk8bNSVfBstqFQbu51WOyoPuS/A7Bw2A5De 8vuzpFW/RXrP3Y8PclC3gCa62q65iMLNtbBvsXIazXQ+cTtK/0RMG881wSohd3FzdyBh g0ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JXn3Ho4kiCXgfD9yiFqXvyQpWztZ1i1zYDQa5yNiDZc=; b=L7ATiVvz2Pp+tQUDj7VUXlGIfrjInNAyf+wQ9SF901+xUN9eorFdH5/2BtD043aWO3 9pkUccncI83fvY1o9saSOBGwqWu8LWt2MtGzoOPjN1SxH8IOOCgVSs2A161GLhiUP0jS RD37kz7HJZNmK8/U6zDu5qPFEU+L86dzhHdk87NLAW5ESBsL0c6SiZ0JOr9uzqnrrV/y JjPnFLvyGOSGZNM3mxtiswBC7pXaERo0oV0Gbw2fVn6orm7xXZuUI7zbqstN0vr+dElx Mhti+S785EafaD/0H2wpochJjs4tIfEVQOb2Xz2sSkxlX+nsl1TdKfAJwnAXYmV0cu+P Qu0w== X-Gm-Message-State: AOAM533YGnZH7oAl4rbadatu4rt955QwJqlV1+xolozBtgC9DwPo/zLl j13bfDNEqDgQcn9lbtio3DE= X-Google-Smtp-Source: ABdhPJwBrVAk/GfJi5L+sXZgnSX5Ru9B38JGSNzpVli67R72dNlR9iVRpGiEX5Dsp9J/bQ8ifCbvWQ== X-Received: by 2002:a17:906:cc88:: with SMTP id oq8mr20169472ejb.66.1618868951554; Mon, 19 Apr 2021 14:49:11 -0700 (PDT) Received: from skbuf (5-12-16-165.residential.rdsnet.ro. [5.12.16.165]) by smtp.gmail.com with ESMTPSA id i25sm11315695edr.68.2021.04.19.14.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 14:49:11 -0700 (PDT) Date: Tue, 20 Apr 2021 00:49:10 +0300 From: Vladimir Oltean To: Jakub Kicinski Cc: "David S. Miller" , netdev@vger.kernel.org, Po Liu , Claudiu Manoil , Alex Marginean , Rob Herring , Shawn Guo , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Russell King - ARM Linux admin , Andrew Lunn , Michael Walle , Vladimir Oltean Subject: Re: [PATCH net-next 0/5] Flow control for NXP ENETC Message-ID: <20210419214910.hbwry2cnjn6d7crf@skbuf> References: <20210416234225.3715819-1-olteanv@gmail.com> <20210419140442.79dd0ce0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210419140442.79dd0ce0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_144913_820284_50E4CB85 X-CRM114-Status: GOOD ( 32.59 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jakub, On Mon, Apr 19, 2021 at 02:04:42PM -0700, Jakub Kicinski wrote: > On Sat, 17 Apr 2021 02:42:20 +0300 Vladimir Oltean wrote: > > From: Vladimir Oltean > > > > This patch series contains logic for enabling the lossless mode on the > > RX rings of the ENETC, and the PAUSE thresholds on the internal FIFO > > memory. > > > > During testing it was found that, with the default FIFO configuration, > > a sender which isn't persuaded by our PAUSE frames and keeps sending > > will cause some MAC RX frame errors. To mitigate this, we need to ensure > > that the FIFO never runs completely full, so we need to fix up a setting > > that was supposed to be configured well out of reset. Unfortunately this > > requires the addition of a new mini-driver. > > FWIW back in the day when I was working on more advanced devices than > I deal with these days I was expecting to eventually run into this as > well and create some form of devlink umbrella. IMHO such "mini driver" > is a natural place for a devlink instance, and not the PFs/ports. > Is this your thinking as well? AFAICT enetc doesn't implement devlink > today so you start from whatever model works best without worrying > about backward compat. Sorry, but I am not sure if I understood the central idea of what you were trying to transmit. What is 'a devlink instance and not the PFs'? I am not aware of how a single devlink instance can be exposed for a piece of hardware presenting itself as multiple PFs with multiple driver instances running asynchronously and potentially being assigned to AMP software execution environments (other cores running non-Linux, and most probably Linux is not even the privileged execution environment which has write access to the FIFO parameters). Are you suggesting that the FIFO size and partitioning characteristics be exposed through the devlink subsystem? Isn't that what devlink-sb is for? Also, that would not help with what the IERB driver is trying to achieve. There isn't anything we want the user to view or fiddle with, the reality is simply that the FIFO parameters were supposed to be one-size-fits-all-and-nobody-cares-about-them (the memory usage scheme of this NIC is smart enough to allow for that, or so I think) but nonetheless, the hardware defaults need to be touched up. If LS1028A was a new SoC today we would have probably done this from U-Boot, from the same logic that already passes the MAC addresses to the PFs through the IERB, but the ship has kind of sailed for that, bootloaders are stable, and 'Linux needs this feature' is not a good reason to update them. So this is all that I would like the IERB driver to do, notice how it's all writes of predefined values but no reads. For next generation SoCs with ENETC we'll try our best to not need an IERB driver in Linux at all. Another option would have been to do these fixups in the arch init code as a sort of erratum workaround, but I didn't find a place similar to arch/arm/mach-* for arm64, so I assumed that the arm64 port just doesn't want to go that route. So here I am with a driver for some memory writes. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel