Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1138557rwd; Thu, 1 Jun 2023 10:59:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/7yqI29RkO6whU7D06GTeLBEdGlexVDh2rm93AhRpn5yF2e37arS2m6eziNlOH9MTV/pH X-Received: by 2002:a05:6a20:1611:b0:110:390f:6806 with SMTP id l17-20020a056a20161100b00110390f6806mr8426824pzj.57.1685642373543; Thu, 01 Jun 2023 10:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685642373; cv=none; d=google.com; s=arc-20160816; b=bcof441X2f00ldYa087ZsrubkDnoJJRfTv89tJ3d+ZXlF5DiE4Pa2vKko3ZJieEoEb ayPZ7KOwFuHXipwD4oDcd1gN0SR0/nbj7GsP4Oj1T8+KMqfHWEVZ0WgbLfK8Ekg+zdxW SWPW+qBBXzj3I2gMcSknG4Y5WvXqskYMl4dt4037LNaneAFFEIkCxhkLCe8MxOZ/oiXP Y0Y92AFO4X85XXy94WBbGuxoEDDRQ209p+v2EPMnGPLHWmuqYC3GqE+4wMpBIwXvZp1K F3GNv+yyGUcrMyhEnY1vXCjX8IQJe0+RaFhH0QWLpqZDx0IRNUudQCEbo0Yv5FWe7tqG Twpw== 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=Ksxxe5Ab/aa0NhcpGK3Hae63YAO7c0sC09nbT5XHMeE=; b=YPvafFOkzu3PBh5GPaCTPRfp+5RFMRXwWKAuWQZs44hGOBpkhC08+0S1a5Hq6x+iOr Tn0eBDsGH/w/B8GchhF+YTB5dBGuExTxUjSUfoWKivG8ukZVOqPJ04HJOjtrEAauGpxp 7/rc0EeG9ECARg9+ksAYglVwjQt/m9oqVPbTB/p78YL2WBZmM9QGS7FyxZEQbtH4XF7X FwEk8quSd0bCUNqAKazDt0zmpDEMxwdenBzTkmk9D9QZmFBxsvlgm9IGr7ht5NSXSrC2 YhB+zgD/om8j6JeNaGUUVDg/k3hSbFRmCGEmmwOgz2c67XBwYGOFseB1282Yq0D0rCoI je+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LIn4UV/P"; 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 z11-20020a6552cb000000b005309e5e80e7si3188557pgp.255.2023.06.01.10.59.21; Thu, 01 Jun 2023 10:59:33 -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="LIn4UV/P"; 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 S232656AbjFARP2 (ORCPT + 99 others); Thu, 1 Jun 2023 13:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232633AbjFARPU (ORCPT ); Thu, 1 Jun 2023 13:15:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DAA819D for ; Thu, 1 Jun 2023 10:15:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3A36F6481C for ; Thu, 1 Jun 2023 17:15:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06855C433EF; Thu, 1 Jun 2023 17:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685639715; bh=QfAZcd+QCdE7N/hMns1wsimPjoZruesbkhbU/kUhZRk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LIn4UV/P7WgWduHTuZ0c1iI3s6nt1m7E1jgUbW0nOhv/DTJsV1vqpAIJoBupS0Atx AqeebYcwXjYAwkIzc9xY9H/2NicvfGv59NgdCe0HNHWsshKhdIPFjk8PoFzn+hcQZ5 AtMBSonHzBFAOZF3wti2uPz3Qhs79m+y8T1mXApr3BwvmYXzU0y/FBRqXor2HY8a6c CTZKrpve3wSvLgy/YjNYjdRJS+Fvu+d4dzgyjF39kEFZwdI4Q15Rad/58BPmZQw3St wFnVYpAxHVYo+wp2QOOryb9jeP75jFYNKQ2gcTQq3jnPGsrlVMwm7fArAG0nkSkMyz DYXGLui2oeAHg== Date: Thu, 1 Jun 2023 10:15:14 -0700 From: Jakub Kicinski To: Anjali Kulkarni Cc: "davem@davemloft.net" , Eric Dumazet , "pabeni@redhat.com" , Evgeniy Polyakov , Christian Brauner , "johannes@sipsolutions.net" , "ecree.xilinx@gmail.com" , "leon@kernel.org" , "keescook@chromium.org" , "socketcan@hartkopp.net" , "petrm@nvidia.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH v4 5/6] connector/cn_proc: Performance improvements Message-ID: <20230601101514.775c631a@kernel.org> In-Reply-To: References: <20230331235528.1106675-1-anjali.k.kulkarni@oracle.com> <20230331235528.1106675-6-anjali.k.kulkarni@oracle.com> <20230601092533.05270ab1@kernel.org> <20230601094827.60bd8db1@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 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,T_SCC_BODY_TEXT_LINE 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 Thu, 1 Jun 2023 16:53:07 +0000 Anjali Kulkarni wrote: > > Is it possible to recode the sample so the format can be decided based > > on cmd line argument? To be honest samples are kinda dead, it'd be best > > if the code was rewritten to act as a selftest. > > Yes, I can recode to use a cmd line argument. Where would a selftest > be committed? The path flow is the same as for the sample, the file just goes to tools/testing/selftests rather than samples/. > This is kind of a self test in the sense that this is > working code to test the other kernel code. What else is needed to > make it a selftest? Not much, really. I think the requirement is to exit with a non-zero return code on failure, which you already do. 0 means success; 1 means failure; 2 means skip, IIRC. The main work in your case would be that the selftest needs to do its checking and exit, so the stimuli must be triggered automatically. (You can use a bash script to drive the events.)