From patchwork Tue Jun 28 16:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12898565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDAF6C433EF for ; Tue, 28 Jun 2022 16:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234788AbiF1Qqa (ORCPT ); Tue, 28 Jun 2022 12:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbiF1QpP (ORCPT ); Tue, 28 Jun 2022 12:45:15 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC8F1267 for ; Tue, 28 Jun 2022 09:43:30 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 68so12706134pgb.10 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=+MUga+MCrIfdpvjiymozAyZI2p2NNL3FWiLnGebOq9w=; b=hio2unkXiGno529Cf68PNABUpMYZM4ygupsa07i6LuKQuOZXoUqtjndRob7/IEX0jT /zD6PLYoTLZD6lzJq5PtI03Ldcw4hpOKApdwC2n7zhgYmepriWkgVwh0iDG7bLyenWsY 16NYR2XbYf/iEODdUvTLfGkYivE3Xi/U/LreE= 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=+MUga+MCrIfdpvjiymozAyZI2p2NNL3FWiLnGebOq9w=; b=Jk1Fg7tttxeB4NxzBw7Ut0X14DRK7Sp3EMYsgyutsdcA7gXMsPSVRKl2hbTFpXVfG5 +A4eY8KI/9p/MxpN3BDAw+ZBZvMHmLxVJlK7xZn7GkNn4ih4b9cVPZ/F/B9QLw5vFRxa OVn0NB5R/CbBqfxFRg0T3UvlStrrPfxsZlrq452fdpT4g7XtyTcuutyFzKZhq3Qj7V4Z mQMV1BVrEOrHzgGjvvpm+zS42t4gauXDyJGQv94npEV/dz+XAFzNvOpLt/IX76pzj3Zx 0lCM8gnMFcyJGzwFm3oGtN8VRJjN/1w5nyeXOPIqTPaQMecBqkez0Nv/xUrt7J+zkXwf 36VQ== X-Gm-Message-State: AJIora+9yhqaPlTFci303+vLTqqjWoZmoZIEELhC0DCAegzt41BfL+lG qKl1entuHyyAq6ecc4Ui3lX/GA== X-Google-Smtp-Source: AGRyM1uOhHUIhgMKnuW245g6qVFuJ4cXVdvY9axOOAGTQUZV37QV1bINSLUokCWzmSpZKTUogx/izA== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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