Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6515387yba; Tue, 14 May 2019 08:48:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhninE8cCWSWloLfyUp8RLlezYmGLcZYSB8ZOTQbzeKoF3q91A5UutqZYD/HMG79Aneaxf X-Received: by 2002:a63:cf0d:: with SMTP id j13mr39740234pgg.433.1557848931230; Tue, 14 May 2019 08:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557848931; cv=none; d=google.com; s=arc-20160816; b=o049qYg4Nn1/Me0pVtSsxouRangNIRPZgytWc4uuq5wU5JWrRc0NrrhdzmGP9r/l5W eV6HEa9ay4aKyMx5zmqjKm+JEJg4XCbE1YOHo2qi2fovmrR/AwOSQNPKtgBeiIjoCGAy hnK+OpI4KnR7PGleJ0eQQGpvkjTIcWrYr7iqIZHFnqEM6DIYsKGxk2aG1ScF4e9nYqLl YR4SaJPSjC1/lJgkfLsWIkKJrkbaoZEK3VkrfKxFWrnU/W+RUeQUv98tFcKWmrqY0cNl wlClhfj0X2s49jnYCT2dnmTVsvNH6lsX3X+fJseEqdnjeZuUY9zsCahMBdS+tScW6HG3 ydQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=1kqwm+cZuZN0intFrBAGaVnDWlz4f+i5XCm7veoFwZ0=; b=DMA8y4fsAp9L5fG66OdA+eivGTH42lSD5rklnagFGFptTbK5wDfvrJavNPSJOiHate HifRnJ215gB8F8JVHpCvsHOhhBpXOLUlyLKahb4AQouASGi8rsGzsp23MYq+57Efyd+1 TkLZny90KY0JPXGKK3GR3R2mwZGMBJteDAqidinMJcYhcQKyn8fREoBfF1J2wtisMgVq q0C/stM0JVSykX+VR9rsuvTvLbBPWExK6dNOSIhyF4WzxAhFuzcImCpLM1BirRQZI+JZ lurWUmLUvj48VfVgL8uQZkKESWTeDnZ1HCFUv0tjKLCi1u/bf20H2+nac79occvJk3po 8RnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Etajpdh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190si7283818pga.255.2019.05.14.08.48.37; Tue, 14 May 2019 08:48:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Etajpdh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbfENPqs (ORCPT + 99 others); Tue, 14 May 2019 11:46:48 -0400 Received: from smtprelay-out1.synopsys.com ([198.182.61.142]:35820 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbfENPpm (ORCPT ); Tue, 14 May 2019 11:45: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 00A99C019E; Tue, 14 May 2019 15:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1557848732; bh=4mT+CT/Y/eN1ccimNjL9XsPYGjFtt8YEZq6/C+Bm3Mw=; h=From:To:Cc:Subject:Date:From; b=Etajpdh84QTRJ5YQGyMqZ0UIypNAEH5MUjYIISSVeujbtU4F4zHpIqz3q28QT52Ss yo+KkBRfIaZkLwDrxHwsPg1GCQwKltT1JHd2kIGs1/8jHCr3f2j6EUsZuUau28yXLG LNZYSufovBZdvR6t/NDy1eHWtbXdjADu9zB7YFGhFHfmP5CBDbf96dcE6mbHR+oyV5 vfwz2YtbTx98oHUEBGLrWpIrZbALyvMZP7Ehlf035QhGYdJYUHwJ0sg0jHslKNMCtQ ERprrCf+jkeRfyQtIQ3/qZTPbw5qwm46QG+gNLh6mGFhmuRtoCeBjYh4PtLXCDEZ/V mDZHIa6HaxgNQ== Received: from de02.synopsys.com (de02.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 10FC9A0244; Tue, 14 May 2019 15:45:39 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id 0A82A3EA09; Tue, 14 May 2019 17:45:39 +0200 (CEST) From: Jose Abreu To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jose Abreu , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue , Corentin Labbe , Andrew Lunn Subject: [RFC net-next v2 00/14] net: stmmac: Selftests Date: Tue, 14 May 2019 17:45:22 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Submitting with net-next closed for proper review and testing. ] 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 (13): 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 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 | 19 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 + .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 15 +- 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 | 4 +- .../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 846 +++++++++++++++++++++ 19 files changed, 1014 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c -- 2.7.4