Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4056288imw; Mon, 18 Jul 2022 21:17:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDgpnt0F1j8g1df+NEcEt+MlIDGucuQZgHf7WRL2JZyQK0bR60V2wjSrXJn5YpI77gvXOl X-Received: by 2002:a17:907:3e05:b0:71c:2ba5:1ab with SMTP id hp5-20020a1709073e0500b0071c2ba501abmr27937052ejc.93.1658204272157; Mon, 18 Jul 2022 21:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658204272; cv=none; d=google.com; s=arc-20160816; b=WTumjeMfuUQRnEek2trtyuyE2EGofQTNgmiwMOwPoW9eY7KoZtV/taz1Zf7moILZIR geq1DmxkA8keeHtFAMPkun+dgUrbh7kUygf5ftjcARF9pMyrrU71iLpvKyuWi3Ym8DDT ZZ0FAWDkt/eRKfL2tH28npoBVPspYluHZPpWxVsTevPG/vnH+OKDKtK5snKq6d9QCSlB mgLpGodi36sBlPsiwtShQMmrkMvDIpN/byn3jMABuX9HgIyvKpuvW5l5X9CFSqvasoGi oiRv6o+vLMHK920Dprm0nrsgOg675F8MKI4v595SzY1yRP9US7A1hJoVe+3tHZSRqHtR FQrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vmSPgC6M61h3ngvzI1AaJWxXdVXhmFs+GH5Qi3rWk5M=; b=fFqCnkHa+OLV9rlfOFktcUY4vd1UxiK6EgC9vE9cxfRJc6r3Ny3u/s2VrhjKz4JLuK vrPioWXDAsnauCj89fGrYlGqPVwBR5L3dWf3f1BBMiRD45xJTREuTRyQy73nq4CTsuBJ 0hOf72w58ssIxM+64mAjk8F7zNadRXfFZbGqXzvsl6e0Vk+ccvyE6RFs8yONGdrj5zYx aNiP6KOaJwn791lAKNE8PwolsfPZNSu6qMii1kp8ZasHsicVPYhfLqw7lA59EkioYOOF F4FdCzsSU1RIFG9nMwszx+5nW6jLB3pzP1gVdFFeTEmknj9VAuozj1KMHQv9B24lDIqk FKlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eKaR0lIY; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv9-20020a17090760c900b007262d1f0dd0si1629847ejc.485.2022.07.18.21.17.27; Mon, 18 Jul 2022 21:17: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=@kernel.org header.s=k20201202 header.b=eKaR0lIY; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236605AbiGSDdw (ORCPT + 99 others); Mon, 18 Jul 2022 23:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbiGSDdu (ORCPT ); Mon, 18 Jul 2022 23:33:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 247DE13F6D; Mon, 18 Jul 2022 20:33:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9F90B81894; Tue, 19 Jul 2022 03:33:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFEDDC341C0; Tue, 19 Jul 2022 03:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658201627; bh=/7TAXj0e5Cww1oAU9qPhHCO940YEfSAdOc9AORI/EVg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eKaR0lIY3nS8TDk7krLluEaovKotSfwXv7GLD6SEQebV5ZhSGLPypnD5lzCYfp5q2 r+3kPG+yZWZJ4rXOzOocNZ7jin+YAbTgAGu6+rXFmhOSLUuDYyAYGSENUFgEzCDD9V h6tkS+zAtfoXysr671Knh8ZrpIr2GpIlvJoZfjTV+jb9bOI1XutyDuqNL2SDEuRdO3 tmn6BGZOFu0t2OBZjDwgZ2K+iZ5pu5t5iGEVlyEaIBvb1czP/u3PCtnOKHKSn7oNBj fO0jkCSuA9ChaRmpiU/tIt85qprnr8dPB8GEATc10dEeKOdKsaNWx5w999pMbHavnA Dwxb1gm5cw7dA== Date: Mon, 18 Jul 2022 20:33:46 -0700 From: Jakub Kicinski To: Vikas Gupta Cc: jiri@nvidia.com, 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 Subject: Re: [PATCH net-next v3 1/3] devlink: introduce framework for selftests Message-ID: <20220718203346.6aab5c4e@kernel.org> In-Reply-To: <20220718062032.22426-2-vikas.gupta@broadcom.com> References: <0220707182950.29348-1-vikas.gupta@broadcom.com> <20220718062032.22426-1-vikas.gupta@broadcom.com> <20220718062032.22426-2-vikas.gupta@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Mon, 18 Jul 2022 11:50:30 +0530 Vikas Gupta wrote: > + for (i = 1; i < DEVLINK_SELFTEST_ATTR_MAX + 1; i++) { > + u8 res; > + > + if (nla_get_flag(tb[i])) { > + res = devlink->ops->selftest_run(devlink, i, Shouldn't we selftest_check() first to make sure the driver supports given test? > + [DEVLINK_ATTR_SELFTESTS_INFO] = { .type = NLA_NESTED }, ... = NLA_POLICY_NESTED(devlink_selftest_nl_policy),