Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4063646imw; Thu, 7 Jul 2022 12:05:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/K8LnZCj037egtrQTu4ZvUUv6zjbFzymIZAO4pd/ooJ8YPRFJI0XT7mqYq+bsrGuKmOqF X-Received: by 2002:a17:907:9005:b0:715:76ce:4476 with SMTP id ay5-20020a170907900500b0071576ce4476mr45614690ejc.560.1657220756441; Thu, 07 Jul 2022 12:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657220756; cv=none; d=google.com; s=arc-20160816; b=0G1iYKqbWWlZdaHSkwWNGcQ3Gi6Rol+fGfIatMYk1NB+6Hm8knlht8lm8rgCoXknHG BNyeZ7BHmHEC/XtJQGxNPr+8oZ596TFkJNtlA8BJ+PH6xpmUT1k917XsemmDLwQCitSx /BMKJJNLjfdv+TN/f3cK/VMthLFSfrGy7Big/WlorrdSsurjdss/CifgcyEDRK6LBZmC ZA49R2TjAA94GVaMCTJfCy8KDGgztf9/+LvxZwwY/VRfXhUs0ZWeNKXu/8F0Ead8ac/J Db02t5uP6Q94xYz+MHjlU+ax2zc3eq/oUi5wBGc0AC5o2vtiKbg79/9qVamAKFAQwRJt cG6g== 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=FMXaeeHJRjtd/qFKDHLbVZTtDXkg+iViRoPn59jf6Y0=; b=LjUZCX+YjFsPZvcqiZTrO26qx+yL+oQQlqqIfuHdEsrNT9znJis2KKIYW0edh3RiC3 YIGMiCpau/R54ZU122gmOOiQfC6p6S30vBaU5mLM4berDXVhvd267Wbqm6Zq9LmGNK+f d2Zcuev5tDCxxFUmRrjb+rQaB6/u9ydKIsfyzWR6Ql4NiQTCVfrKpJQndbXdFM50+Xjh 3kCZdf+/+y22Nk9q+E/bwPyYGQqJSJUSDE+DLo3AjXAyp7RIqv004KRw30PzWEfUFCXV FKfaO5hP78acMO0UIeJG9l26LLRjOqMA4srqBISSbSZNJdcX8wjeDuOpg5ZfRGIBfoM8 rM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Sz+DeJ4+; 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 s14-20020a170906284e00b0070ed5373a2csi45518826ejc.298.2022.07.07.12.05.03; Thu, 07 Jul 2022 12:05:55 -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=Sz+DeJ4+; 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 S236301AbiGGScr (ORCPT + 99 others); Thu, 7 Jul 2022 14:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236690AbiGGSca (ORCPT ); Thu, 7 Jul 2022 14:32:30 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A48F6053A for ; Thu, 7 Jul 2022 11:30:22 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id x184so7689593pfx.2 for ; Thu, 07 Jul 2022 11:30:22 -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=FMXaeeHJRjtd/qFKDHLbVZTtDXkg+iViRoPn59jf6Y0=; b=Sz+DeJ4+Jfo5gufLieJYhL59vH5Fy4FFyCyAY85WGqXQI8LYN0KTGaBYX/7MfUdO3s v1mqRuzETAzhQ/Cgr/CIwNvf6s+UQncWuaRFacNM628XyEdaB6kPRy/9cje8osM+Y95o wrmdm1GhyzPyeg5MoQjrbrhtKnREULJQRNzis= 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=FMXaeeHJRjtd/qFKDHLbVZTtDXkg+iViRoPn59jf6Y0=; b=z6vhuZIRnAE2XorQSGcmT4rAN6CoRI+SQW9qiyNW2Gd3i8G6FMtkLQMHToJ2oErofv wL7H86HjZ7H6Kutx5k3lBjFRz9akXMpACljZjRfOLSuSGCjCs9vA3K5Gf/eNMOTWWd0+ 4fef9K+tRMHqiYFvJnLEOmpL0IIwElLP9BPIee24kTqeBZKAm6mwsLoa3jOdgNU8cMuc Y/Iua46c0siJBZOMWBLc7H4h5utvi/z9klpO4ZbFcz+ydL5ZG5Ky4dOWWvtR/cvixhCV 17kzhnmhFC5jEdY28Mlomy0TbfVQf+/FWFu55BydDGY/RL398DnD2cuSvD8UDYy4pibs 0xQA== X-Gm-Message-State: AJIora+Jq3o31eibkB8r1qGKvyJeNsvo/t1bdAc6aVDCCMFsykuE+z7R 5mNNKriYidpHcRW5tFxWCldqhg== X-Received: by 2002:a17:902:efc6:b0:16b:dd12:4d30 with SMTP id ja6-20020a170902efc600b0016bdd124d30mr26159881plb.29.1657218616284; Thu, 07 Jul 2022 11:30:16 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id pj9-20020a17090b4f4900b001ef92e0e7c1sm7132234pjb.10.2022.07.07.11.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 11:30:15 -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 v2 0/3] add framework for selftests in devlink Date: Thu, 7 Jul 2022 23:59:47 +0530 Message-Id: <20220707182950.29348-1-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220628164241.44360-1-vikas.gupta@broadcom.com> References: <20220628164241.44360-1-vikas.gupta@broadcom.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000fa89a505e33b4687" X-Spam-Status: No, score=-2.7 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_SCC_BODY_TEXT_LINE,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 --000000000000fa89a505e33b4687 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: changes from: 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 | 34 +++++ .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 61 ++++++++ .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 +-- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 12 ++ include/net/devlink.h | 30 ++++ include/uapi/linux/devlink.h | 26 ++++ net/core/devlink.c | 144 ++++++++++++++++++ 7 files changed, 319 insertions(+), 12 deletions(-) create mode 100644 Documentation/networking/devlink/devlink-selftests.rst -- 2.31.1 --000000000000fa89a505e33b4687 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/czkALg3sgTcOOcF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