Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4149242iog; Tue, 28 Jun 2022 10:00:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vC6A/pFusVz3wapdgKfrxYQtcVM2gXWCqWNL+p/aliV/CXL1SaqdTOjeQ6vd1uCZo1xgn8 X-Received: by 2002:a63:8641:0:b0:40d:d04d:1b22 with SMTP id x62-20020a638641000000b0040dd04d1b22mr15154909pgd.418.1656435604118; Tue, 28 Jun 2022 10:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656435604; cv=none; d=google.com; s=arc-20160816; b=uq/XK3QH06F5dQO5n+R6Q3Fy9SBod0WJgt0i27cAB3cijuglbxPx9tx7hlVC9UlS9I IhQhiR15Hp/kCKv93wzYxfYryG92KcR/yEXMH22vrslj9UcgUC79G0TFPivGH5qW7rnz r2S1cTWITwrgAzFNeOoDRakLy2ZjclnJApGyZB+BWsC6/fsORS5Gp9ShZxM5uFnS4wf+ lufcf1/e9P50eZHCdrg1UAv2D04dpM52yoRGS9YtOOK97XWDKPUR1EnL6v7ewON0QAea 8qF6C4QGg1kOZXZ3GuNBh49Y6LkzOWNjSlh4AmRsIq5l7v20qi/FGEFCCYeMbh6npM3/ 6UwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=oMGlMuniX2Rd9rBrXQYjskcY4LtsKRIZSmPT8doKsis=; b=dnvrqb/vs1mMTigzS1sSELPf+Gd93yYkRtmYtGilKhPWS0RhOBFsszxPdhFG8C1Q10 Xy7Nl0J1wu+DqvZZnoF08DwIRDhZcuUD1lL/SCZogzSlLHuq9GxMYP6axR5Mm/wnrK+J E9ieW+aTkwVfh+X/1rSadUgaplAuMliuFEmIxmRiirSDNQft2DOTLUMX1sZfp6X3YdUx HF6RcKoPZDCbVbh13qalYx4fQ7AtbaxNzN5BLM9jlhSIFOsDF2vg696NHzI/9oZHUM7s fHTgfrSBkpuZ/V2K3Mf/Q6sK/3QYVqsF+JyAnXqXSRNP7BDIgUqtxkgTb0dOWmDy1l2p Q+qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=TPVMV0Nd; 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 c21-20020a63ef55000000b00408add1cf0bsi19786118pgk.43.2022.06.28.09.59.50; Tue, 28 Jun 2022 10:00:03 -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=TPVMV0Nd; 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 S232024AbiF1Qqq (ORCPT + 99 others); Tue, 28 Jun 2022 12:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232583AbiF1QpP (ORCPT ); Tue, 28 Jun 2022 12:45:15 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AACC221F for ; Tue, 28 Jun 2022 09:43:30 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id t21so12539214pfq.1 for ; Tue, 28 Jun 2022 09:43:30 -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; bh=oMGlMuniX2Rd9rBrXQYjskcY4LtsKRIZSmPT8doKsis=; b=TPVMV0Nd2aUsZ+t5Id3dUwIakOR3NJkqgwGMfeVHVRI2fInM3oO+XTQHgHlLFvlvzs j6/rangL/2ZE80vkYX33jxIXQgiqv/jNshxkqlBoOet0y5NSspD0mLACUW83VkEg6T3z Ho/S4pWcxFfOndOZqhgTeWMb8LwLOElvOSD7s= 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; bh=oMGlMuniX2Rd9rBrXQYjskcY4LtsKRIZSmPT8doKsis=; b=5kaO5BkimYFRNLMeGOURf9musu6Ds64l1aw0sSiVyRRK/ZaCLW5TAYDi1UOT8AackD KqyTbvmiAnseqiz3AIM4SvLu4GXoza6MUVWi2WO9mePWGd8v6CJBIZpkzuL/AHK4lQy2 OPLp3fWo3hr5ZI9EiKruDyJ9W51L3T70C0kLTiwwO1ZGF9i7Iyor663yieEjRBlWtkAD uu85YUuwB1a0NcRGzaPWmFlbHgkmM2qL8UM0j2A5YAiaTbz4tzHesmArSn0IokJut5/z tHqMk9F5jDfEA/uem6fXeGQPd/0xlEqaCm4zfzp8jKAcKbGTQ2y5pv6WaMfkVZgn9efE XXoA== X-Gm-Message-State: AJIora+XZDOJushMVH0bTytveHaULGRzBbcisqt7dPXqdp7BS7k5v0SX 7Dp9l2D1F4uADYmBJXf1BpGgDQ== X-Received: by 2002:a63:b54c:0:b0:40c:7b84:4f7f with SMTP id u12-20020a63b54c000000b0040c7b844f7fmr17870316pgo.586.1656434610019; Tue, 28 Jun 2022 09:43:30 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id mn9-20020a17090b188900b001ec9d45776bsm38248pjb.42.2022.06.28.09.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 09:43:28 -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, michael.chan@broadcom.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net-next v1 0/3] add framework for selftests in devlink Date: Tue, 28 Jun 2022 22:12:38 +0530 Message-Id: <20220628164241.44360-1-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000008cda7c05e284bcda" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, MIME_HEADER_CTYPE_ONLY,MIME_NO_TEXT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,T_TVD_MIME_NO_HEADERS autolearn=no 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 --0000000000008cda7c05e284bcda Hi, This patchset adds support for selftests in the devlink framework. It adds a callback .selftests_show and .selftests_run in devlink_ops. User can provide test(s) suite as a testmask and subsequently it is passed to the driver which 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: $ devlink dev selftests run pci/0000:03:00.0 test flash results: flash test : failed $ devlink dev selftests show pci/0000:03:00.0 device suuports: flash test 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 | 39 +++++ .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 66 ++++++++ .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 +-- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 12 ++ include/net/devlink.h | 40 +++++ include/uapi/linux/devlink.h | 24 +++ net/core/devlink.c | 147 ++++++++++++++++++ 7 files changed, 340 insertions(+), 12 deletions(-) create mode 100644 Documentation/networking/devlink/devlink-selftests.rst -- 2.31.1 --0000000000008cda7c05e284bcda 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 AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTcOOcFZTXk38e aqsXsipoX1vsNurqPtnC27TWsA7pk4uKXscFjkeUE8JZu9BDKaswZygxBOPBQBwrA5+20Wxlk6k1 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK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