From patchwork Thu Jul 7 18:29:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12910062 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 D4E91C43334 for ; Thu, 7 Jul 2022 18:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236471AbiGGSco (ORCPT ); Thu, 7 Jul 2022 14:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236680AbiGGSc3 (ORCPT ); Thu, 7 Jul 2022 14:32:29 -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 CD7C76051D for ; Thu, 7 Jul 2022 11:30:21 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id a15so21039873pfv.13 for ; Thu, 07 Jul 2022 11:30:21 -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=IoTevdawFwMIDdpaSgWvET61M++fayUnC4R3kiIvUwI=; b=LJV2POLy9LsV1p0IuvIdWtaQzohUBhOjGiAK70hbNzLrMKkbZMFADH732W1GQKpK3M cP+PfQL4WGCAJQPdv4E5uR4xCT1kJ6PsJQ/p8pfvoVwhBVnG2Wcz2kK1hUnxob87oFzW KooF3YDZLMr5VO/SdfQHxOgf64eAjbwMD+pEU= 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=IoTevdawFwMIDdpaSgWvET61M++fayUnC4R3kiIvUwI=; b=x1W6nTKfQI00L4wRotIV3fuTeQwd03jivWR0n2ZMsdGfJ3dmWuZoCMVdDYZZwptQqD dC7rue1yXuz1CgTD+FOkIKLhbhGvUnqdfIfFrSxorSOsSPEqI+VbOFjYgSz4raDc5kq8 Oiwpkf7skWB9LgOMCa49puoSkgfe0M8fIz/anmW65fHV+G98fEfnK+JqTOBXL+53CLUh izeCW/a9g117g4Cno9lY+K6A/EWlHZa8rVbVM+v3EyoMmCRZEGtijOksjquXJ/KnJxLm VOK9R3JfKw2k4NuyXqJRWGRaTK20um0eHWSLGiQaTv7T45mHd5duXrYz4UiHD4NYiTOu v+TQ== X-Gm-Message-State: AJIora/4ZjhHRLUh+0jiIuv1PPTPa7naA9cGV8Kt3u4faEa8d+5bJIMK TGfCNRT1KaA0K708UTiaPgLbGw== X-Google-Smtp-Source: AGRyM1vKkaCcTNKvIJpgVHEn2bd5yukhzxals0Vm1behT2K1+aNxitbMNHZ/UD0YYF73VtTUMOGO9Q== 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> 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: 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