Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4269530imw; Tue, 19 Jul 2022 03:26:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1spKYS/umTxaUX3QBfhgmOSMTKbDzHSayuBU0m4ZytY2AcWR5yEm/JtTj7vDXEA8tEusDlS X-Received: by 2002:aa7:8c51:0:b0:525:4141:fe5e with SMTP id e17-20020aa78c51000000b005254141fe5emr32602592pfd.51.1658226403057; Tue, 19 Jul 2022 03:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658226403; cv=none; d=google.com; s=arc-20160816; b=Oc8Y5tBQjobLzWL4Y0A1ReTyMqGiMJwbllmUg0aPQdi74uRCScAajxaP4qRQmbr/gN +3vvxoEDHPqFWHZ6qEZIvV60ppR/5N281jZFu2fNDtkD2b0AVZUlQjeN5/w4So+EBA8I wTjRe9zNMUrgO4s9VCDFOZecZJ84r9jvycr646AL8+Vbr5YoiNwFwwNgzR+pfd1lIzPK n6LXv/GNow+pW9Ii/hDyRn4mTC8kX82rwIfT40EB8y9uC1Bn+EvfGa1QpHru9bxYlach jidawKRv48qPzmNBPpX6WX3IllHwL6rMIIxaTiK3yp4sGiA8JLEue6NthsMYYGS2Hj3Z ncEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HZD7T1gxtEeAzeoFFsALVdksuXlmXNfVHNJZv3styWM=; b=qNsdcGUCLpQND1Hoh9e9jyj0Qn5pkGo1C0U+KYrOc6Sp8kr6E9FNDyzg2bdHiFapuv lKIKJfKwJ/ZI9jHjMg4IfbBNwv28BLaDSpUUrjHACaMkzALIGbjlvsNf2wAb8T6NUnzl yh5F+oJksxQ44CBUdCJ2JoUnKidta6ftuvy858eO+n4uss5PHbJyhBUG3jCVh9wnQ18k CL/K8MUuAgbq0PZiN5GgOO5QItx+fb+ThHJu+CJU0c3W1mGdodCAmjtj9X4ayLnKpujX q9q54SCO9xbMKAVn1jKFM3A1P4n4mGrKA2UDEWmOGzvcWjr7ifj7Pe8p8yuFG13XUyt6 bZMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=gQOKSAVX; 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 m9-20020a655649000000b00412406f1e2dsi2039139pgs.420.2022.07.19.03.26.28; Tue, 19 Jul 2022 03:26:42 -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=gQOKSAVX; 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 S234893AbiGSKSY (ORCPT + 99 others); Tue, 19 Jul 2022 06:18:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbiGSKSU (ORCPT ); Tue, 19 Jul 2022 06:18:20 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CFA71EADB for ; Tue, 19 Jul 2022 03:18:19 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id o7so23944733lfq.9 for ; Tue, 19 Jul 2022 03:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HZD7T1gxtEeAzeoFFsALVdksuXlmXNfVHNJZv3styWM=; b=gQOKSAVXqpEysN/1h60akxKzcdBV6RwTwZMVqIJiYdg2DIKxFZc7njyVrMWb8ImTeY nxvun71LjKPLM8LiDsaz7S7BGU7KijqNYaV/DJho3gAna3857+lJ/fx5jfU1U3MWgMhs rGmIFUMCt3cgUeEGUNDDZeK1tUrxVRTTve2Pg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HZD7T1gxtEeAzeoFFsALVdksuXlmXNfVHNJZv3styWM=; b=AdqcBMJ2+fRk4O7mraDnuTkcVQPmmDNiMrLByFwIUICDAmZ+7cUkPfD8BDMWsFwiK9 o4jSLXQC6KlRi/gOcj1jQhL47hauY8mKfnEzjkePAwicOttQ3MgFBfchbW2hGiQ/wsyU 5jeExYs5W4ekn4STUONRVh9cn+JIDXW4jKMb7pLReqrwy86dxr2tjl3LUoRQrzNlYRYI E2DqQKHbiXX4aYhZdkbl7bL/USMSz98XVe4TXm0XmuocE+wNk/Vk+VQjMucjIVNzVevL T0K6YdZfoK6qoVnvyduz2omRqZKq9AvgpZvkfp7qmztLe7b2JKVwe6bXkFrmzKPC5Z4y eRNg== X-Gm-Message-State: AJIora8+vC/9I/HWC2tH9V4BuOnZ1csNvDOdSPMWlNUlBFzT7zc5VbVa OUzC0r4pB6nE/tGx+euDiCjYY7HnL0F6j/NhM2S8nQ== X-Received: by 2002:a05:6512:230f:b0:489:676f:2705 with SMTP id o15-20020a056512230f00b00489676f2705mr16467995lfu.419.1658225897846; Tue, 19 Jul 2022 03:18:17 -0700 (PDT) MIME-Version: 1.0 References: <0220707182950.29348-1-vikas.gupta@broadcom.com> <20220718062032.22426-1-vikas.gupta@broadcom.com> <20220718062032.22426-2-vikas.gupta@broadcom.com> <20220718203346.6aab5c4e@kernel.org> In-Reply-To: <20220718203346.6aab5c4e@kernel.org> From: Vikas Gupta Date: Tue, 19 Jul 2022 15:48:05 +0530 Message-ID: Subject: Re: [PATCH net-next v3 1/3] devlink: introduce framework for selftests To: Jakub Kicinski Cc: Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , dsahern@kernel.org, stephen@networkplumber.org, Eric Dumazet , pabeni@redhat.com, ast@kernel.org, leon@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, Michael Chan , Andrew Gospodarek Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000009d8dbd05e425cd2c" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE 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 --0000000000009d8dbd05e425cd2c Content-Type: text/plain; charset="UTF-8" Hi Jakub, On Tue, Jul 19, 2022 at 9:03 AM Jakub Kicinski wrote: > > 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? Yes, I`ll add selftest_check() here rather than letting the driver return SKIP. Thanks, Vikas > > > + [DEVLINK_ATTR_SELFTESTS_INFO] = { .type = NLA_NESTED }, > > ... = NLA_POLICY_NESTED(devlink_selftest_nl_policy), --0000000000009d8dbd05e425cd2c 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 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK4qsEtj09JS4+mhi0CTCrCnXAzum3tgcH cHRg0prcSzzEUDQWoFxyuqwiwhHu3sPQNmFOMwIDAQABo4IB2jCCAdYwDgYDVR0PAQH/BAQDAgGG MGAGA1UdJQRZMFcGCCsGAQUFBwMCBggrBgEFBQcDBAYKKwYBBAGCNxQCAgYKKwYBBAGCNwoDBAYJ KwYBBAGCNxUGBgorBgEEAYI3CgMMBggrBgEFBQcDBwYIKwYBBQUHAxEwEg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