Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1583290pxb; Thu, 4 Feb 2021 17:36:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjpo8qUJrGR6cpL+cnqT5JybxVKlC3axNfgZ6vlY1hgJbeQTv/+GC57ZW+fZKOv7+Ay1/U X-Received: by 2002:aa7:c755:: with SMTP id c21mr1309003eds.47.1612488968474; Thu, 04 Feb 2021 17:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612488968; cv=none; d=google.com; s=arc-20160816; b=Y4mnUpad+QMErYjWNMuDQZTomLufKIgAXr8i4sDk+WA38U28VqZ46evyaLIfljUpse FnFZkWns24gHk1k5XZxN+6pJTt+HUxj4zzoitymn3+WV25lJG5zdJlXWVhxedc/gwoHZ 5ZMxvRE0kwLrwZ7J0ZoUPmqmwcqq2zowkM2emDszCOo+JQ1zZzXbYbI9KRO5PJgflDKT XZQmnlaxwxzbJ9CqwbM3tEr4TX/QRehW6vBwI3Q+B9SJ0BiD6SURgh+6NKQPXpaTg7Bm 2T/cT26Gf+bNek7+Eu1t+Xd3kHiAy8jKb/xMnbkHSx6Fvzu8fefCy9d7KgdKquLu8UC4 LIyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xwUaHrAY9e5uB5d1q6wUXQhrvTNEhAkgbykgjfGD8F4=; b=eUp7GsKjAcicZIuOJjOs6s6KU77SVE3/VW9lOgS3PRmIFZraQK8uk2X4m6Bj2D2jiw z15Iw1qpDLuVoFMZBGUj6a0rQMfEL17PKg/huj+A3dmxGcOVaev3CqBZ0l+L+wi/g/9m tZ/RK1aU0CzOckN36i/2Lmeq1nVgj2AJtF9DqNo4B3PrK2yNk6LWx4hmTKOzOZqYUobE xftEjKMkKz0rEUjwlIeuuYXwC18RXAlF0vw5c8Fx4Zoc+88mNusVauiOuhVecn0+Aylh k56lK5dhUbOS4nKFESwZUJEgZHVIhcMOQdu3JeJy1fIyivg6Vxy18Pp0AbFogquB7dFT J2Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=r4iifmn2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si4044066edf.27.2021.02.04.17.35.44; Thu, 04 Feb 2021 17:36:08 -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=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=r4iifmn2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239577AbhBDTDs (ORCPT + 99 others); Thu, 4 Feb 2021 14:03:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239552AbhBDTCV (ORCPT ); Thu, 4 Feb 2021 14:02:21 -0500 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38C2C06121E for ; Thu, 4 Feb 2021 11:00:29 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id x81so4452575qkb.0 for ; Thu, 04 Feb 2021 11:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xwUaHrAY9e5uB5d1q6wUXQhrvTNEhAkgbykgjfGD8F4=; b=r4iifmn2GZr3/AUv3oeaqwvvTahZHM0KtyIoAMNtNjc4ndeC6/3VBxI63sdXey+3FL T5xpZQIncLFJPyaQd4adyGdXsc1dgztBkqO0qy26GL+nyHoXt/WOV9bTimwP5iGZvKXI ATPDXNFOF/kzH3/7Grof9UCL3JM0wCUIBPjcZLPtRui9NB1KNd6D+rLjEMUhIwcso1qK 9rT/d80vP8Rl/uTUhRubnUl+q++6Wx0woOE4bCrdL1dUSaFMrMOyGBQlm0/LyqL59U3s Pl/HBo2F29nB6YB7adlzPCUmUV4EIZ6cFqfvyR1+WkCa6uPqmT7ZZy8T+0vP3hYu8i3x 4M5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xwUaHrAY9e5uB5d1q6wUXQhrvTNEhAkgbykgjfGD8F4=; b=qM4t4TtNxO+dz7SFhDaKxH1kufUouoleR2yO7+otH1dkZQRKBJhYD8DST0l9Kf/4aK Su9PcDNR6oJJA05tLhfjI9w7IjrAZFJr+2qTxdLwA9/zTZ2Fwun56q9wVkOwOMfKVQTE wo35o9TIjtgwMj3vb4Ze7BL4BzGpUm9e8iVL7h05MlN4InJN22jL9m20kO7Gy/ULRqLC S9qiSGf9iaJp4bnSTTA/I/XwNwYZuTeet9po+kNeI6l1cRT42/+GUSa8xjG0JmfLT9JO ztdEekXKj54MN1OsE7dUQLu0A+0wI3qX2mr6wtz3TimSK6Rvp1vCJ7Q+CvKlgS7ONype +e7g== X-Gm-Message-State: AOAM532KANUrJuo44saMD9up4DM00zxKj4eXtbYmrjconWvPpxcWbqzc IjkfY44vXExO1iP7i5MbBPrm68BqeHRrKfjsdmnl+pqZ3zaTyQ== X-Received: by 2002:a05:620a:f96:: with SMTP id b22mr553601qkn.295.1612465229053; Thu, 04 Feb 2021 11:00:29 -0800 (PST) MIME-Version: 1.0 References: <1612253821-1148-1-git-send-email-stefanc@marvell.com> In-Reply-To: <1612253821-1148-1-git-send-email-stefanc@marvell.com> From: Marcin Wojtas Date: Thu, 4 Feb 2021 20:00:18 +0100 Message-ID: Subject: Re: [PATCH v7 net-next 00/15] net: mvpp2: Add TX Flow Control support To: Stefan Chulski Cc: netdev , Thomas Petazzoni , "David S. Miller" , nadavh@marvell.com, Yan Markman , Linux Kernel Mailing List , Jakub Kicinski , Russell King - ARM Linux , Andrew Lunn , Russell King , atenart@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, wt., 2 lut 2021 o 09:17 napisa=C5=82(a): > > From: Stefan Chulski > > Armada hardware has a pause generation mechanism in GOP (MAC). > The GOP generate flow control frames based on an indication programmed in= Ports Control 0 Register. There is a bit per port. > However assertion of the PortX Pause bits in the ports control 0 register= only sends a one time pause. > To complement the function the GOP has a mechanism to periodically send p= ause control messages based on periodic counters. > This mechanism ensures that the pause is effective as long as the Appropr= iate PortX Pause is asserted. > > Problem is that Packet Processor that actually can drop packets due to la= ck of resources not connected to the GOP flow control generation mechanism. > To solve this issue Armada has firmware running on CM3 CPU dedicated for = Flow Control support. > Firmware monitors Packet Processor resources and asserts XON/XOFF by writ= ing to Ports Control 0 Register. > > MSS shared SRAM memory used to communicate between CM3 firmware and PP2 d= river. > During init PP2 driver informs firmware about used BM pools, RXQs, conges= tion and depletion thresholds. > > The pause frames are generated whenever congestion or depletion in resour= ces is detected. > The back pressure is stopped when the resource reaches a sufficient level= . > So the congestion/depletion and sufficient level implement a hysteresis t= hat reduces the XON/XOFF toggle frequency. > > Packet Processor v23 hardware introduces support for RX FIFO fill level m= onitor. > Patch "add PPv23 version definition" to differ between v23 and v22 hardwa= re. > Patch "add TX FC firmware check" verifies that CM3 firmware supports Flow= Control monitoring. > > v6 --> v7 > - Reduce patch set from 18 to 15 patches > - Documentation change combined into a single patch > - RXQ and BM size change combined into a single patch > - Ring size change check moved into "add RXQ flow control configurations= " commit > > v5 --> v6 > - No change > > v4 --> v5 > - Add missed Signed-off > - Fix warnings in patches 3 and 12 > - Add revision requirement to warning message > - Move mss_spinlock into RXQ flow control configurations patch > - Improve FCA RXQ non occupied descriptor threshold commit message > > v3 --> v4 > - Remove RFC tag > > v2 --> v3 > - Remove inline functions > - Add PPv2.3 description into marvell-pp2.txt > - Improve mvpp2_interrupts_mask/unmask procedure > - Improve FC enable/disable procedure > - Add priv->sram_pool check > - Remove gen_pool_destroy call > - Reduce Flow Control timer to x100 faster > > v1 --> v2 > - Add memory requirements information > - Add EPROBE_DEFER if of_gen_pool_get return NULL > - Move Flow control configuration to mvpp2_mac_link_up callback > - Add firmware version info with Flow control support > > Konstantin Porotchkin (1): > dts: marvell: add CM3 SRAM memory to cp115 ethernet device tree > > Stefan Chulski (14): > doc: marvell: add cm3-mem and PPv2.3 description > net: mvpp2: add CM3 SRAM memory map > net: mvpp2: add PPv23 version definition > net: mvpp2: always compare hw-version vs MVPP21 > net: mvpp2: increase BM pool and RXQ size > net: mvpp2: add FCA periodic timer configurations > net: mvpp2: add FCA RXQ non occupied descriptor threshold > net: mvpp2: enable global flow control > net: mvpp2: add RXQ flow control configurations > net: mvpp2: add ethtool flow control configuration support > net: mvpp2: add BM protection underrun feature support > net: mvpp2: add PPv23 RX FIFO flow control > net: mvpp2: set 802.3x GoP Flow Control mode > net: mvpp2: add TX FC firmware check > > Documentation/devicetree/bindings/net/marvell-pp2.txt | 4 +- > arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 10 + > drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 128 ++++- > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 563 ++++++++++++= ++++++-- > 4 files changed, 655 insertions(+), 50 deletions(-) > I tested the latest version on CN9132-DB with 2 10G ports bridged and connected to the packet generator. Under load the interfaces were capable of generating the pause frames, so all seems to work as expected. There is also no regression neither with the feature disabled, nor on Armada boards (I checked MacchiatoBin and Armada 7040 DB). I added my comments in the patches. BTW for that I had to enable the ports in device tree: diff --git a/arch/arm64/boot/dts/marvell/cn9130-db.dts b/arch/arm64/boot/dts/marvell/cn9130-db.dts index 79020e6d2792..9b248e3a1a34 100644 --- a/arch/arm64/boot/dts/marvell/cn9130-db.dts +++ b/arch/arm64/boot/dts/marvell/cn9130-db.dts @@ -129,7 +129,7 @@ &cp0_ethernet { /* SLM-1521-V2, CON9 */ &cp0_eth0 { - status =3D "disabled"; + status =3D "okay"; phy-mode =3D "10gbase-kr"; /* Generic PHY, providing serdes lanes */ phys =3D <&cp0_comphy4 0>; diff --git a/arch/arm64/boot/dts/marvell/cn9131-db.dts b/arch/arm64/boot/dts/marvell/cn9131-db.dts index 3c975f98b2a3..5c081d68941d 100644 --- a/arch/arm64/boot/dts/marvell/cn9131-db.dts +++ b/arch/arm64/boot/dts/marvell/cn9131-db.dts @@ -85,7 +85,7 @@ &cp1_ethernet { /* CON50 */ &cp1_eth0 { - status =3D "disabled"; + status =3D "okay"; phy-mode =3D "10gbase-kr"; /* Generic PHY, providing serdes lanes */ phys =3D <&cp1_comphy4 0>; Best regards, Marcin