Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1897160pxb; Sat, 2 Oct 2021 00:32:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsEnurbedzI9nRVpPEOMXFQ1xh/DHEPkY4IldLD5rpmjBypGmahGzrP6FQ+Es3RaKxdGwP X-Received: by 2002:a17:906:8e0c:: with SMTP id rx12mr2738481ejc.423.1633159973573; Sat, 02 Oct 2021 00:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633159973; cv=none; d=google.com; s=arc-20160816; b=S+mdfdm2gsiNaN2BePrJ3dRizwJAxeWPQ3ttQxBbpEIzRkO8fxmmN8JH08lnj+gUv8 4ZuMp6hzOB5lsB/zCP4rbXaBrbTKB0R69rF3fcwC+mNlUZ7feOc4vSXgezOR8/brWhuk jfsW0ClB6IyjokNsMj2x8WuAiFYn38NitluQVoMURDfByh8DdYa1SsOmHNqbghHRA+BN j5sNR13O7qW6oCKmZQ6bHs32l4qhSXAp+GR4rwO6TWlMkDIm85KNe54ASMpfQc/tO3T0 P7nHndqGIriuAq02QweiznOhc1pMWxymuSMvZ3Aju/KvH+VQtUL7k8wv8F6eVYfNsHZ6 /eeg== 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=SEyWrW3EkUXpbblyqwDbIe+TSvswhgnVquW9bvHGEDo=; b=Vy4ANpnbax13ZLbZvEaJaXGfnKOf6h2fROxAoxhlupXMJObns5fTAMMjOaevXFaJY/ JdwPtqIy13z7rAZDg6RTiIxvRd9oJAlm/RBNvoon9e74aZ3esaZWukgsWYPSIMTpOu0x xGyF1uXeCTAmprYjWUKMHwEVOhheuk2OEcqcN2oqePkU6uir6fCx96ZruOCWwD70taHW NGYdmNMbqeJgiS6xqbe5iRlmaPbEWcjnSJuot86B3RpESWhrItGpyPv+vTk2AfNjpMlP IbssqBWIxLFpmfbt287CrHoBn/RGhjMXF18dktResmHoQg25NgH1CITgUV7O6/Bt2LWP 34Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XkoG0bFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si6541156edr.413.2021.10.02.00.32.29; Sat, 02 Oct 2021 00:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XkoG0bFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231941AbhJBHbs (ORCPT + 99 others); Sat, 2 Oct 2021 03:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbhJBHbr (ORCPT ); Sat, 2 Oct 2021 03:31:47 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B06C0613E9 for ; Sat, 2 Oct 2021 00:30:02 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id d26so19027785wrb.6 for ; Sat, 02 Oct 2021 00:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SEyWrW3EkUXpbblyqwDbIe+TSvswhgnVquW9bvHGEDo=; b=XkoG0bFn0gX2zWP2nn1SI38wac2/wdfWpErZfHN1iWHA/jZ+Qe0o0xN2Kpp+6pS11R JMmHIsgPYAGyzh/MQbwbcOiFv0PYGXPAReniWhSXKOQm6ivxvcaNSRqekVd6/IPSvGY2 AJNsBNLCl+VRLnhBdPkhJ30dWFlNkrO8EJj3E373Nn7XiKbelmhUjcyLXLdP9RplEViT Is/WCu1GhAqK1U267eLgxZKMDQMN36AFN1TXskCBrM9qG1FJL8eGynsWZyxiGRxy1n5o qXbfMekVfE2Pd9OijPwM9S8/hKDPcGeNiuv6etjY+NDTg8gv9hS0G1Jew7wF4JJkZ541 cdHw== 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=SEyWrW3EkUXpbblyqwDbIe+TSvswhgnVquW9bvHGEDo=; b=39CDuOb9IC2cMy+TE3AcYmJaz+dM+vM2wH30tIERnidiiIoOwCboUCN9r8O4dS6n5y 3Z1BfOd+BKRr3EdPiAwQw55JmigodpFiWEjzmVT6pObE+km9rMhUM6kXn+WqcBOvACzQ s+UDjGqmShtuSygRsmujwCcNoGeTaZA4udjUwNtEZAtTyusYscUgAR1sVRsC8wDhS2bX 9QLclGz6TLKEqpO6p65ItOwNWoZ84mk428AVdvDWpjnb1fbrG42B7KEzMK0fBvnNdjmB j9HWb9dGO3jta0ExDAYsiJ71h6mpeW3Gu1Ceu5wYUmp0SS6vayvoyeKW8N9QKG46yJk0 iQaA== X-Gm-Message-State: AOAM530n4Wg7l4Ba0BZSOicBaB8SXZURlikTPr3k/UrwWJ79WHOIPuL9 IszoiV0mgfAYAREGYilnUNE2Dv+isFFYQTWaFg54ww== X-Received: by 2002:a5d:4882:: with SMTP id g2mr2007616wrq.399.1633159800517; Sat, 02 Oct 2021 00:30:00 -0700 (PDT) MIME-Version: 1.0 References: <20210926223322.848641-1-isabellabdoamaral@usp.br> In-Reply-To: <20210926223322.848641-1-isabellabdoamaral@usp.br> From: David Gow Date: Sat, 2 Oct 2021 15:29:49 +0800 Message-ID: Subject: Re: [PATCH v2 0/5] test_hash.c: refactor into KUnit To: Isabella Basso Cc: Geert Uytterhoeven , ferreiraenzoa@gmail.com, augusto.duraes33@gmail.com, Brendan Higgins , Daniel Latypov , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , KUnit Development , ~lkcamp/patches@lists.sr.ht, rodrigosiqueiramelo@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 6:33 AM Isabella Basso wrote: > > We refactored the lib/test_hash.c file into KUnit as part of the student > group LKCAMP [1] introductory hackathon for kernel development. > > This test was pointed to our group by Daniel Latypov [2], so its full > conversion into a pure KUnit test was our goal in this patch series, but > we ran into many problems relating to it not being split as unit tests, > which complicated matters a bit, as the reasoning behind the original > tests is quite cryptic for those unfamiliar with hash implementations. > > Some interesting developments we'd like to highlight are: > > - In patch 1/5 we noticed that there was an unused define directive that > could be removed. > - In patch 4/5 we noticed how stringhash and hash tests are all under > the lib/test_hash.c file, which might cause some confusion, and we > also broke those kernel config entries up. > > Overall KUnit developments have been made in the other patches in this > series: > > In patches 2/5, 3/5 and 5/5 we refactored the lib/test_hash.c > file so as to make it more compatible with the KUnit style, whilst > preserving the original idea of the maintainer who designed it (i.e. > George Spelvin), which might be undesirable for unit tests, but we > assume it is enough for a first patch. > > This is our first patch series so we hope our contributions are > interesting and also hope to get some useful criticism from the > community. :) > > Changes since V1: > - Fixed compilation on parisc and m68k. > - Fixed whitespace mistakes. > - Renamed a few functions. > - Refactored globals into struct for test function params, thus removing > a patch. > - Reworded some commit messages. > > [1] - https://lkcamp.dev/ > [2] - https://lore.kernel.org/linux-kselftest/CAGS_qxojszgM19u=3HLwFgKX5bm5KhywvsSunuBAt5RtR+GyxQ@mail.gmail.com/ > Thanks: I've gone through this new revision, and it still works fine, and my prior comments have been addressed. The commit messages in particular are much clearer, thank you! I've reviewed the various patches and left a few comments here and there, but there's nothing too drastic. I'm pretty happy with this from the KUnit side, but it would be ideal if someone with more knowledge of the hash functions looked over it. Unfortunately, George's email is bouncing, and no-one else has made any particularly major changes to this. My only remaining comment on the tests themselves is that it'd be nice to have them split up further into more, smaller tests. Given that it's a port of an existing test, though, I understand the desire not to change things too drastically. We also need to work out how this is going to go upstream: does it go through the kunit branch (via Shuah's kselftest repo), or directly to Linus (who's handled most of the other recent-ish changes here. Brendan, any thoughts? Cheers, -- David > Isabella Basso (5): > hash.h: remove unused define directive > test_hash.c: split test_int_hash into arch-specific functions > test_hash.c: split test_hash_init > lib/Kconfig.debug: properly split hash test kernel entries > test_hash.c: refactor into kunit > > include/linux/hash.h | 5 +- > lib/Kconfig.debug | 28 ++++- > lib/Makefile | 3 +- > lib/test_hash.c | 247 +++++++++++++++++-------------------- > tools/include/linux/hash.h | 5 +- > 5 files changed, 139 insertions(+), 149 deletions(-) > > -- > 2.33.0 >