Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3008260imw; Sun, 17 Jul 2022 23:28:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t9hhtmmp9qzc738fDebk7pTWsrBfiiHTyYQBQIuR20ajmShd9nRsPT/cbW2uyiSi5UhwIm X-Received: by 2002:a17:902:8f87:b0:16c:2c88:39ec with SMTP id z7-20020a1709028f8700b0016c2c8839ecmr27489132plo.52.1658125733005; Sun, 17 Jul 2022 23:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658125732; cv=none; d=google.com; s=arc-20160816; b=DyWN815K944n7pNwaS+4fs9w+U7QUubS6gpzGVCyTPDZEHwm4hqB1nxYrMrvBVjv8P LIQEZ0aJrpKwrUhdhP/SnSYIyOvCAMg5xk+H0Yu1PyOkNoJbWNKYj8YgcVTBrxHF0Ejy zU0KGk1SqVLBTzo394ILvTwQ4CMV56i0+7YBLIq4AOaAIHYYzHk64b/mTl65il/4XVQR HrQ3p0zx/4kip1eR58ZnbqRwT7z/OC7UDaGlkY8xoFKvw1+p6+dNU1Qv7Ufo2V8+682j usRlNp3omCxmQEHuG16FZC0Bt78IOt6kG5/J8UXw/nCpa4/VeesUVAn36INw1YC+C937 ukZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=jWfuts5DmQLXK89Hz4tzFrui7Qj6Qhn+sS/Qia41niY=; b=mqAurPdIQvff7FJX2v1JGD8+tjxdMA9Y3wizIEjenQCJ1ev5GRHUgFh51ZO72gkS2C 1BA1FD9y9hwqq4pKBSamyd6Iz//LEq6w+aBuXZ0mNLgvNGan26tI4n4Qx1Qn9I1lykLI lPAZHb+WKkcIph6skZu2KuhlV0BKd/cWEis8CWan62PO6jyPAVc8e+EqLDCswY8FClcT Ix2sa/mdc/zr+drWcVHRWHwyA5HKGYZkMzC5sQefxbNR0BDokTHv1JTxjqxj27bbkrZX iOA56g/M/sxtt57g+Ld8sWuHup9qn4jVXWJsP74O/cmFDO7Mmdz9WeA4AAN8QSR9lliT lWvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=C7jnZARt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a17090ab90800b001ec84e481c4si14005888pjr.80.2022.07.17.23.28.35; Sun, 17 Jul 2022 23:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=C7jnZARt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233360AbiGRGV1 (ORCPT + 99 others); Mon, 18 Jul 2022 02:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232243AbiGRGVA (ORCPT ); Mon, 18 Jul 2022 02:21:00 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA5B114029 for ; Sun, 17 Jul 2022 23:20:59 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 72so9743770pge.0 for ; Sun, 17 Jul 2022 23:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jWfuts5DmQLXK89Hz4tzFrui7Qj6Qhn+sS/Qia41niY=; b=C7jnZARt8+1nC40js+5cSeLpPU7wSBjO7LZX/RBp1vYVYxgCue3rkKz0Cv0ScTMa/Z wrL79Iins9Eg/fVkA000/Migtte8JkErYQMwAQFAS+s01kRjDQRofbDSvXZ1DdbhirmE 9HxADgs4FtbNEcXoaoReChlBcfAi+4/DpTChg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jWfuts5DmQLXK89Hz4tzFrui7Qj6Qhn+sS/Qia41niY=; b=BObZ3V5Q/nZXEZoczUUv5SMMZ7rz9VxC3kNfd6Oaq63rsUR9Qb6G+pcnX7q4ryZKtg hJmcoQ7iBs0P+I/RfzHUJzWd8+fAs1XoBD5F0KxF0R6KWYhjoFFYujBjTYecJ/aon17S dI99SYcNMuCU4LOGrajM+KKjkMOORppxbdHQkHUG8RWfcft00qfcZ+6JzAjbG1vjxvkI cfmIlbV9Et5KIMOUGUiMT/Wdl9/QtIy0OBPNYJguQg83veRBQF6mWdnUIvCT7uPYvnt6 qk3FnltAcPGoHGVZp6Al+u6Cd1+9dZNr0E+8a5IwRYfqIABG40VwXhketS/Ucmm6G8fg y1aA== X-Gm-Message-State: AJIora+7LgOZIqbVbKG9pZ2yoNHfOJ+T4YhK2ggP6SnOo8UoWa5DA4je 9Qi4K8QygPhwcw3W97ZPlpHCrg== X-Received: by 2002:a63:5d09:0:b0:416:18b:5846 with SMTP id r9-20020a635d09000000b00416018b5846mr23790482pgb.574.1658125259144; Sun, 17 Jul 2022 23:20:59 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id h22-20020a170902f7d600b0016c4fe627eesm8360164plw.241.2022.07.17.23.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 23:20:58 -0700 (PDT) From: Vikas Gupta To: jiri@nvidia.com, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org, stephen@networkplumber.org, edumazet@google.com, pabeni@redhat.com, ast@kernel.org, leon@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, michael.chan@broadcom.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net-next v3 0/3] add framework for selftests in devlink Date: Mon, 18 Jul 2022 11:50:29 +0530 Message-Id: <20220718062032.22426-1-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <0220707182950.29348-1-vikas.gupta@broadcom.com> References: <0220707182950.29348-1-vikas.gupta@broadcom.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000016ea2605e40e5faf" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_TVD_MIME_NO_HEADERS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000016ea2605e40e5faf Hi, This patchset adds support for selftests in the devlink framework. It adds a callback .selftests_check and .selftests_run in devlink_ops. User can add test(s) suite which is subsequently passed to the driver and driver can opt for running particular tests based on its capabilities. Patchset adds a flash based test for the bnxt_en driver. Suggested commands at user level would be as below: changes from: v2->v3: 1) After discussions with jiri@nvidia.com, passing a testmask from user to kernel is removed and a flag based arguments are adopted. This way we can have more than 32/64 selftests defined in the kernel. Below is the format from user to kernel and vice-versa. Kernel to user for show command . Users can know what all tests are supported by the driver. A return from kernel to user if driver supports TEST1, TEST4, and TEST7. ______ |NEST | |_____ |TEST1|TEST4|TEST7|... User to kernel to execute test: If user wants to execute test4, test8, test1... ______ |NEST | |_____ |TEST4|TEST8|TEST1|... After executing the tests kernel return to user. |NEST | |_____ | NEST| |NEST| |NEST| TEST4,RES4 TEST8,RES8 TEST1, RES1 2) Added dumpit in devlink for list/show command. v1->v2: Addressed the changes requested by kuba@kernel.org in patch v1. Fixed the style issues. Thanks, Vikas Vikas Gupta (3): devlink: introduce framework for selftests bnxt_en: refactor NVM APIs bnxt_en: implement callbacks for devlink selftests .../networking/devlink/devlink-selftests.rst | 38 +++ .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 60 +++++ .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 12 + include/net/devlink.h | 20 ++ include/uapi/linux/devlink.h | 29 +++ net/core/devlink.c | 216 ++++++++++++++++++ 7 files changed, 387 insertions(+), 12 deletions(-) create mode 100644 Documentation/networking/devlink/devlink-selftests.rst -- 2.31.1 --00000000000016ea2605e40e5faf Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQagYJKoZIhvcNAQcCoIIQWzCCEFcCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3BMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYD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