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: 423721 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 AA886C433B4 for ; Fri, 16 Apr 2021 23:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87356611AB for ; Fri, 16 Apr 2021 23:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234856AbhDPXnd (ORCPT ); Fri, 16 Apr 2021 19:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhDPXnd (ORCPT ); Fri, 16 Apr 2021 19:43:33 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 224AAC061574; Fri, 16 Apr 2021 16:43:08 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id h20so14791104plr.4; 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=os+07w05Ff1Lv4IQfGt6iIdh766M6hTeWWq+CacEPSyVv5pYx7K+gGEXEHYW2B0OBQ kPm7v0UTlDiEBt1YLddmUjcAG3CE+/FMfMJoANRljVB/V3eEeUbMGYQ3MXLIkhanlKDF YWkWHbns6nkNx5lrZKJ0VyaPSjtN9m92IyX+I6rMPYU+Fv7/Y3aMSYZ8vvkcjswG4CLJ 2Hk7RRtSSWwEo2QJF0IOjb3cebk9T5PDHuEcjRUw5L3vhDQL2u17RKQkfrxuUbvgzkHF FYdlb0M7RRlt2Gnq8PMBj8I9XensjRLmyACNI3gbRzcUDovLeOI+0r13sn0Bb2w4AU74 ND5g== X-Gm-Message-State: AOAM5332SXzukETi//MnuThcshktsE0sQcGxKLct6cJG6H0Gy8lqQdZ8 q1dGtLiLrbyIA23ZXM7N/qM= 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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