From patchwork Fri Apr 16 23:42:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12209305 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=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 9712AC433B4 for ; Fri, 16 Apr 2021 23:45:36 +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 19CEC61107 for ; Fri, 16 Apr 2021 23:45:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19CEC61107 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:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TIQ0ic85mFtLEI3JwT4SEpKyLf7YEV2YgOxVWdcFRK4=; b=lA94hU9R1A9qzUq8PZhV5m/8Y+ iYHpbjbAkSniVU77UX9fpdi0EMIECvP6s9HoiLxpCZ+iHX3xttWu+rVbkEyvIDl1dR0ApiZ5HtEru yz4Yl/LUYk0mb6AWbKuWK4Tj9QhMAtNP/yEFVauRrRHjtcUJJKC+Gh/SMr2KRRjdkFHd3dLRhxILr z5aR7o/WPzGMzJen6k/oq01Td2mPd4iOmJzSOju3e9iL8Be2OIbcutO58xsDAkc6/vGkQ/Y9lrPlr Svh92FSHn6m+OPX74MBL+9EWGY6HC7clPT/ZhkyWBuaYsLxFLFZ1DTOk4NfS267+e+ni84cTCbats YfqfxknQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXY7K-003jzE-Tm; Fri, 16 Apr 2021 23:43:19 +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 1lXY7G-003jyo-NN for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 23:43:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=z63PuqgJ/ggxFrYFCkXGSXN03aWadtC6tjM/hw5TpgI=; b=2VuixCY8wQeZrQTrwS9V+gg2GM 6Pna5x83vcx2cp8cf1rQtkcr4CPr5ZYZsMJB0MC3cOCqwv4N3IxSskHxcHxCRefazRtGQCdIQa5jM zSEYKzDEzKncYeNcu63f+vsFVT8aRHRdx2ZJuinP5iuHNnuhr0YK4gsehQxoFYGVaO/CZVNNzZ7Ln w5ONhYEl5zAga1T+m65tw7yTMMNgtQjb81HzqGSNpYhgdKjXYg2mFyaBuilYPLl3j44QAaQx8evzy ILhYBVe+ljOuVrDba76zT+HQPaG/oSPhv16RRBAej1aYfVZo4ilWViwLRZksnr5/aVIh0P9pAAweU wxNKL+zg==; Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXY7A-009mep-Ut for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 23:43:13 +0000 Received: by mail-pl1-x636.google.com with SMTP id o16so1177501plg.5 for ; Fri, 16 Apr 2021 16:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z63PuqgJ/ggxFrYFCkXGSXN03aWadtC6tjM/hw5TpgI=; b=vJWaf7u0f0lO+hw8cBKlG2cuZhDRYRwU/bTa44oOTgVnClhioVObk0gkwEhX/oeQrM rJjnq/5YQ9g1H+6VjnrKsc8vFogu4IeMpTxHiKY7Tlw7ny4T2KapgtLKEuMcC2k8D+05 a9qXcCUoI/cmJzy2vBfSANqy0gYdOiKkzaY0//3a6n+dZFicfh9lKcySpqy1iShEB7Al 3bYdB8DVAaQ/T61eoYpfvJhFYTLP6M9egUNRbfajO351ZtUvmcUauWw9R/zlhGU7MhQB 7OL6NgceNpFPrsIC/PO8MeDceuTtbnn2k7zeRSC/x0sOV0H6iZ+WhQKaBe7hPxLBB5Y9 p2oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=z63PuqgJ/ggxFrYFCkXGSXN03aWadtC6tjM/hw5TpgI=; b=fS4i3IVVycWRnZ5h3ftd4OcQVw1EPPy7fFgR6syKphPG2kR1+QdnmjdGGGnQakwaml RtM4Y3JNer0Q9muYpfg0YN6PvLpiQiTy04dPdQu8SrtU9FNHOnkuhWoncHpyeteHzhfR kY4os68bG61bA3PvQMe+6ZiCI6GdOB7fg1d5gBmATW49F/IL1nH+IPrETnlqX2Ivxu3z P5nT7GOal9g2QTNEB+SIzu/uFuIOjCdcH3VXAM03XmqbdiEI10nHCnaHBTeiIPNqpHWB uXCw4Rpnj5jtzlaco1T4X9Ei73aP5KQuw1glei+gPJNGxEp+aiWpj2W2Cd2bKsVsBFOb yk2A== X-Gm-Message-State: AOAM5303qlloHvFNhFTYgGji+Ff3fi0FRydqhSS1lNbY8+JS+6SzSH+F gOEzhvl0+PnNQwUoQQXW1+o= X-Google-Smtp-Source: ABdhPJyLi7qnfd6nj4nrHRLXDCGHwbksuLNQLymnErRrHO0V1LQBQwcQhbCZRAhBUjDEz0r/uDyEuQ== X-Received: by 2002:a17:90a:5311:: with SMTP id x17mr11802813pjh.25.1618616587637; Fri, 16 Apr 2021 16:43:07 -0700 (PDT) Received: from localhost.localdomain (5-12-16-165.residential.rdsnet.ro. [5.12.16.165]) by smtp.gmail.com with ESMTPSA id a185sm5623947pfd.70.2021.04.16.16.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 16:43:07 -0700 (PDT) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org, Po Liu Cc: 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: [PATCH net-next 0/5] Flow control for NXP ENETC Date: Sat, 17 Apr 2021 02:42:20 +0300 Message-Id: <20210416234225.3715819-1-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_164309_040456_8FC3DD2C X-CRM114-Status: GOOD ( 15.28 ) 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 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. Vladimir Oltean (5): net: enetc: create a common enetc_pf_to_port helper dt-bindings: net: fsl: enetc: add the IERB documentation net: enetc: add a mini driver for the Integrated Endpoint Register Block arm64: dts: ls1028a: declare the Integrated Endpoint Register Block node net: enetc: add support for flow control .../devicetree/bindings/net/fsl-enetc.txt | 15 ++ .../arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 6 + drivers/net/ethernet/freescale/enetc/Kconfig | 9 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + drivers/net/ethernet/freescale/enetc/enetc.h | 16 ++ .../ethernet/freescale/enetc/enetc_ethtool.c | 18 ++ .../net/ethernet/freescale/enetc/enetc_hw.h | 9 + .../net/ethernet/freescale/enetc/enetc_ierb.c | 155 ++++++++++++++++++ .../net/ethernet/freescale/enetc/enetc_ierb.h | 20 +++ .../net/ethernet/freescale/enetc/enetc_pf.c | 95 ++++++++++- .../net/ethernet/freescale/enetc/enetc_qos.c | 16 +- 11 files changed, 349 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_ierb.c create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_ierb.h