From patchwork Fri May 24 08:20:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 1104687 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="Mzx7ypak"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 459K7c6nWHz9s7h for ; Fri, 24 May 2019 18:20:44 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389585AbfEXIUn (ORCPT ); Fri, 24 May 2019 04:20:43 -0400 Received: from dc2-smtprelay2.synopsys.com ([198.182.61.142]:38330 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389566AbfEXIUm (ORCPT ); Fri, 24 May 2019 04:20:42 -0400 Received: from mailhost.synopsys.com (dc2-mailhost2.synopsys.com [10.12.135.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 64DF2C012D; Fri, 24 May 2019 08:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1558686027; bh=pTugxC0xi6tYCnoQGaHnrYQc67+/MuULJSrDVJlby38=; h=From:To:Cc:Subject:Date:From; b=Mzx7ypakxqoo6XQJtzXNgeTfh9n4JMJk1vFytFhri/GuK8SVtfuxaG1exRQkNF41o BjcIMqm+8Xt5d7PrxO3I5bzWiVYC55vuqUKfQvZGqfk4uhwiQi45Ezu6xiiS1NXe/X XHIX0TPBF1HTyrNco8jghEYfoc5rUxrF7xARQUQKPxSQWoAOT0E7JWI165rjNULOGw Yi8zvTCllYxW3J2R5llFRraOjIXCim+HJsw5Pg/rge2b2ntkXcL1WKLTcxzreG5/Gg kOY+SMwQQtDYAbVeAjid319HKIGaxDfYH2Ju8EoQ3SUhPIN7gTJFk7hr+TDVpsYIQZ vOCQafWJqhW2w== Received: from de02.synopsys.com (germany.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 686A2A00AA; Fri, 24 May 2019 08:20:36 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id 4A8853FAE9; Fri, 24 May 2019 10:20:35 +0200 (CEST) From: Jose Abreu To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Jose Abreu , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue , Corentin Labbe , Andrew Lunn Subject: [PATCH net-next v2 00/18] net: stmmac: Improvements and Selftests Date: Fri, 24 May 2019 10:20:08 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org [ Thanks to the introducion of selftests this series ended up being a misc of improvements and the selftests additions per-se. ] This introduces selftests support in stmmac driver. We add 9 basic sanity checks and MAC loopback support for all cores within the driver. This way more tests can easily be added in the future and can be run in virtually any MAC/GMAC/QoS/XGMAC platform. Having this we can find regressions and missing features in the driver while at the same time we can check if the IP is correctly working. We have been using this for some time now and I do have more tests to submit in the feature. My experience is that although writing the tests adds more development time, the gain results are obvious. I let this feature optional within the driver under a Kconfig option. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Corentin Labbe Cc: Andrew Lunn Corentin Labbe (1): net: ethernet: stmmac: dwmac-sun8i: Enable control of loopback Jose Abreu (17): net: stmmac: Add MAC loopback callback to HWIF net: stmmac: dwmac100: Add MAC loopback support net: stmmac: dwmac1000: Add MAC loopback support net: stmmac: dwmac4/5: Add MAC loopback support net: stmmac: dwxgmac2: Add MAC loopback support net: stmmac: Switch MMC functions to HWIF callbacks net: stmmac: dwmac1000: Also pass control frames while in promisc mode net: stmmac: dwmac4/5: Also pass control frames while in promisc mode net: stmmac: dwxgmac2: Also pass control frames while in promisc mode net: stmmac: Introduce selftests support net: stmmac: dwmac1000: Fix Hash Filter net: stmmac: dwmac1000: Clear unused address entries net: stmmac: dwmac4/5: Fix Hash Filter net: stmmac: dwmac4/5: Do not disable whole RX in dma_stop_rx() net: stmmac: dwxgmac2: Do not disable whole RX in dma_stop_rx() net: stmmac: dwmac4/5: Clear unused address entries net: stmmac: Prevent missing interrupts when running NAPI drivers/net/ethernet/stmicro/stmmac/Kconfig | 9 + drivers/net/ethernet/stmicro/stmmac/Makefile | 2 + drivers/net/ethernet/stmicro/stmmac/common.h | 1 + drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 13 + drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 1 + .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 22 +- .../net/ethernet/stmicro/stmmac/dwmac100_core.c | 13 + drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 3 + drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 29 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c | 4 - drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 + .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 15 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 4 - drivers/net/ethernet/stmicro/stmmac/hwif.c | 9 + drivers/net/ethernet/stmicro/stmmac/hwif.h | 21 + drivers/net/ethernet/stmicro/stmmac/mmc.h | 4 - drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 13 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 22 + .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 8 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 850 +++++++++++++++++++++ 21 files changed, 1029 insertions(+), 23 deletions(-) create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c