Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2125344pxb; Thu, 11 Feb 2021 05:10:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKc7cHaPM9Ak8XwonJ15bj/zS09xO8KX53584/BTYl+euegUUAkwJ7225oBxqz1CSEMfFj X-Received: by 2002:a17:906:26ca:: with SMTP id u10mr8492254ejc.165.1613049040617; Thu, 11 Feb 2021 05:10:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613049040; cv=none; d=google.com; s=arc-20160816; b=EEJ5CHkYfjukj4FVb3yZU0/L/y/ti/NDwYv4EiZMX3ocye1bXV+4JZ3HY/Rk7M4isN pVVhrO3kbLOD2/J7O/wCXVobHOu61S48vU5nuaX0j62EWoRqavz5VSR4Pu3HW1Ra3Hz5 uEFPyV5df+CLeH0M93cxbbh6clJhrD8g3MIFZdiUM8DTFrauiOUp44XUGboMkGGezYVp dl4Yn/VsICDooPT6bvCATceZovuu49XXgBIqgCHEveENUppRWFwiU3/ebCTeMCMLv8En oLieGwZkOBP3oRkbZvIpx5X1P4o/f0qIC8aPJ5SizN6ib++dpyJ2iTqv0jxJRLyigN6a wAaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jNdqb4nPe0+4Tf1BWon1fj66dn5Zihb+9hnrzoLJEcg=; b=b7kLcmL7R8wy7fSlNAb/Vw08RRzkTzXVRoUuow/B9PNQlzOUfZ7gvHnlBoCbn0JPro 692zufkRtSNz4NxB8WS5oHk9+lcqjZ3GarAcZB99J+s1mlA26KzItb9q7z67GOXP87vB 63elSDdJMXE/GT5Dy08OG3B7A7E0CXZkaqojhwGcg/HXPwz7q2qoFd6ZvI00kSyhlTeo OMOqlP/7F12JyPdFMJuPO0XxjUS+Bj1RVXVphWYhRuQkUa+9EYRF4ezvB6srx51RZ1Mu zMo61ciUHSd1AIR4Gv6lxxTyyZNWJj0pjmM8i26pRc/EzzcSZCVC2YkaHAac8WxX+urO vMKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="u9lE/RkI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o17si3863154edz.582.2021.02.11.05.10.08; Thu, 11 Feb 2021 05:10:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="u9lE/RkI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbhBKNJb (ORCPT + 99 others); Thu, 11 Feb 2021 08:09:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbhBKMsJ (ORCPT ); Thu, 11 Feb 2021 07:48:09 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883BFC061574; Thu, 11 Feb 2021 04:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jNdqb4nPe0+4Tf1BWon1fj66dn5Zihb+9hnrzoLJEcg=; b=u9lE/RkIgqS1E4pK0wd/xVqNe V6OxKFqjaTwRrqyyAj3totCFfnHNrHJe06L7siydeS2uTLfp8sJWxlUheOkaK8TT/LcVLfkEoiLbT S2jH0qBAYz/SGzK9wMKm/pK0A+wZYdVuSz6YlcJwQDQf2N0aCJprF0rNzdUWdTxnPzKYZdNhS2SVq C5Mc2FqfqTmxtZOqYlsEk/grnyol/6sDwLLk3IZ2unnfKSpTA5KVsRFkjBxYQQenc9BB/fEOK31cB jdL/GgHvCsGHwIO27wy/9+5NyN+kBu/jKJSLCgtx62L8J4dy++EKbdX6pLdTE89sd72VVS3nmGFUA 7MFfkpG0w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:42028) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lABNT-00069X-IB; Thu, 11 Feb 2021 12:47:23 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lABNP-00066C-TH; Thu, 11 Feb 2021 12:47:19 +0000 Date: Thu, 11 Feb 2021 12:47:19 +0000 From: Russell King - ARM Linux admin To: stefanc@marvell.com Cc: netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, davem@davemloft.net, nadavh@marvell.com, ymarkman@marvell.com, linux-kernel@vger.kernel.org, kuba@kernel.org, mw@semihalf.com, andrew@lunn.ch, atenart@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, sebastian.hesselbarth@gmail.com, gregory.clement@bootlin.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v13 net-next 07/15] net: mvpp2: add FCA periodic timer configurations Message-ID: <20210211124719.GE1463@shell.armlinux.org.uk> References: <1613040542-16500-1-git-send-email-stefanc@marvell.com> <1613040542-16500-8-git-send-email-stefanc@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1613040542-16500-8-git-send-email-stefanc@marvell.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021 at 12:48:54PM +0200, stefanc@marvell.com wrote: > @@ -751,6 +760,10 @@ > #define MVPP2_TX_FIFO_THRESHOLD(kb) \ > ((kb) * 1024 - MVPP2_TX_FIFO_THRESHOLD_MIN) > > +/* MSS Flow control */ > +#define FC_QUANTA 0xFFFF > +#define FC_CLK_DIVIDER 100 You later change the number of tabs for these definitions in a later patch. Would it be better to start having the correct number of tabs? > + > /* RX buffer constants */ > #define MVPP2_SKB_SHINFO_SIZE \ > SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > index 5730900..761f745 100644 > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > @@ -1280,6 +1280,49 @@ static void mvpp22_gop_init_10gkr(struct mvpp2_port *port) > writel(val, mpcs + MVPP22_MPCS_CLK_RESET); > } > > +static void mvpp22_gop_fca_enable_periodic(struct mvpp2_port *port, bool en) > +{ > + struct mvpp2 *priv = port->priv; > + void __iomem *fca = priv->iface_base + MVPP22_FCA_BASE(port->gop_id); > + u32 val; net likes to have reverse christmas tree variables. I think you should clean this up. However... > + > + val = readl(fca + MVPP22_FCA_CONTROL_REG); > + val &= ~MVPP22_FCA_ENABLE_PERIODIC; > + if (en) > + val |= MVPP22_FCA_ENABLE_PERIODIC; > + writel(val, fca + MVPP22_FCA_CONTROL_REG); if (en) val = MVPP22_FCA_ENABLE_PERIODIC; else val = 0; mvpp2_modify(priv->iface_base + MVPP22_FCA_BASE(port->gop_id) + MVPP22_FCA_CONTROL_REG, MVPP22_FCA_ENABLE_PERIODIC, val); avoids the need for "fca". > +} > + > +static void mvpp22_gop_fca_set_timer(struct mvpp2_port *port, u32 timer) > +{ > + struct mvpp2 *priv = port->priv; > + void __iomem *fca = priv->iface_base + MVPP22_FCA_BASE(port->gop_id); > + u32 lsb, msb; Same reverse christmas tree issue here. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!