Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7241245imm; Tue, 24 Jul 2018 10:41:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebLL2I0Nk3w/Rqtzzy56HOJ7FSpL1kwsW6zqdJ+Us45rr+vB6oyf/iAfX27yj1cVzeydnl X-Received: by 2002:a65:5c03:: with SMTP id u3-v6mr16459192pgr.402.1532454074834; Tue, 24 Jul 2018 10:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532454074; cv=none; d=google.com; s=arc-20160816; b=tNpkvbV/GQT+UWAJPPdqeGh9mmChO4tDr/YLpujPv1c1eG0xpmV/xneivWfv9jCP2O pUf9TxY9FR5eoQxSTZPq6mIp7cnkGbqxBBRgMDgK3t0u2jsnrm0NQ1/95VLcuSJ2NSkb DiFG7I18oaVKWPQrnTIGjk7dkIh4HWIov2EI7l/1Brji9tFY1YZCcbd4gZa0Tf9G/JaK hthjBOjGK1UtpLe2SfhZdD6+vU32z6F9nUJSijDKzFVErTh2yUNp+h9kZ4LLPP56S1AF LjxZk89ehg4Tsjna6l7rmrlXTVcRp50AcziUKMKXoBQkLed34TYko1TlgkhPaV58+xIX Za4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=eGZWxv+LwE1ih3ikFvH9S15PdxEiEv0sw85tyEDFUCo=; b=XHxvW/qeeXanbTt7M3k71UWEu+x6Gw4anouraijjk8eCZcRkapmaLgUteM8RRYH09U EXZj8KrWLQsE6y+tjnK2L1/5wl4ypZzNf0X1tng6eF7zmB42cASDeq9yUJwbNhVSISRv ckY6SgtAnzw58i78Aryen8JTHS/B2q3hsaRUxdt4mpPiQoispuK23SCW9HqFNBcK4u8Q VDRrZgNk+o5aPJC349kq1kC2s8HigLeqyXSZPKi9NfYrIClLP7p9LoZ5LmpGINex5lEL u/20anIAP0Q1uQoWwTnvRnBILYFTWYxFEQileP8fHR8MplPKqMeBcpRbOGRmBDI4imiR UpUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GIFIq1vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24-v6si11869136pgx.314.2018.07.24.10.41.00; Tue, 24 Jul 2018 10:41:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GIFIq1vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388471AbeGXSrH (ORCPT + 99 others); Tue, 24 Jul 2018 14:47:07 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37431 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388415AbeGXSrH (ORCPT ); Tue, 24 Jul 2018 14:47:07 -0400 Received: by mail-pg1-f194.google.com with SMTP id n7-v6so3393961pgq.4; Tue, 24 Jul 2018 10:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eGZWxv+LwE1ih3ikFvH9S15PdxEiEv0sw85tyEDFUCo=; b=GIFIq1vqCbvwoQA8ALuie06hKtXwxXrWpXizEDdUto4MLBLheQzAcn3ACUEIJNB2Nx dDuQPYz3ILrj2IgsfJA5LyJIHO/134/CRZZhqudYAklzgVkqdhmIl7+kBlGR+4MZ6knl un7yqOxx8Mkz1gdlmDpdSYt2vxb4QIgt/rTneCcE41RaniDYYIbk+LrBRSu/AasVNVnb aRRwSci0lUDC0PmXlQOZn9XjZmh1lBH9ICqOmZLfahmNE58SayCLy4N4YUBaj1C7r4cE V38g3MNVPvZRKQI5g+ze+pKFum9zXi8efZdg+PiiVWYvbTK+UmY++x0mAgq6t/ELKVZI KVpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eGZWxv+LwE1ih3ikFvH9S15PdxEiEv0sw85tyEDFUCo=; b=XWzDFu6V5wsbi3ZOTFdNg1HWvwEzGxC61zGKUWLfVBCqAIZPsb8LcpNZC0I0GYAGSS Qj2lmsXwlsLur30JpeeLKf9+yd2L6jNy2HBGgXAvRRRwP0SJvZPnCiXo+IQn8J8gUxqg 7LnH6RfY2ugTLrooUDbTCnUomIVlIpNWdWyz3+7bgD2HBgmwWuigi/jQA9GZxs0NtZYd WTtd/Rj9Ar7/3TeYk31L6kZ8IoeUGLQ5C2cU4TC+HZJ2rfYoVkL54ie7DDD/jAzV8xJV qkcYWMtfJO6c/EwFNV8fo7yKoqvICLj2IBGp+h3LG1UFuABHeChta5ZV+uFNFngST/yO HIrg== X-Gm-Message-State: AOUpUlHfFI951FQ89cq+uzeXjjM+LBIEziQSi1YgyTlA2qnKu9ATJz/w D7fW9udMWsYqnPzerL7dOHE= X-Received: by 2002:a62:23c2:: with SMTP id q63-v6mr18683548pfj.91.1532453973054; Tue, 24 Jul 2018 10:39:33 -0700 (PDT) Received: from gmail.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id i3-v6sm11603714pgq.35.2018.07.24.10.39.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 10:39:32 -0700 (PDT) Date: Tue, 24 Jul 2018 10:39:30 -0700 From: Eric Biggers To: Coly Li Cc: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, Greg Kroah-Hartman , Linus Torvalds , Thomas Gleixner , Kate Stewart , Andrew Morton , Randy Dunlap , Andy Shevchenko , Noah Massey Subject: Re: [PATCH v4 3/3] lib/test_crc: Add test cases for crc calculation Message-ID: <20180724173930.GA194165@gmail.com> References: <20180718165545.1622-1-colyli@suse.de> <20180718165545.1622-4-colyli@suse.de> <20180724044420.GB1944@sol.localdomain> <2feeece1-6d92-aa08-c9b6-1b0c646eed29@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2feeece1-6d92-aa08-c9b6-1b0c646eed29@suse.de> User-Agent: Mutt/1.10+35 (c786a508) (2018-06-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 25, 2018 at 12:28:15AM +0800, Coly Li wrote: > On 2018/7/24 12:44 PM, Eric Biggers wrote: > > On Thu, Jul 19, 2018 at 12:55:45AM +0800, Coly Li wrote: > >> This patch adds a kernel module to test the consistency of multiple crc > >> calculation in Linux kernel. It is enabled with CONFIG_TEST_CRC enabled. > >> > >> The test results are printed into kernel message, which look like, > >> > >> test_crc: crc64_be: FAILED (0x03d4d0d85685d9a1, expected 0x3d4d0d85685d9a1f) > >> > >> kernel 0day system has framework to check kernel message, then the above > >> result can be handled by 0day system. If crc calculation inconsistency > >> happens, it can be detected quite soon. > >> > >> lib/test_crc.c is a testing frame work for many crc consistency > >> testings. For now, there is only one test caes for crc64_be(). > > > > Are you aware there's already a CRC-32 test module: CONFIG_CRC32_SELFTEST and > > lib/crc32test.c? Confusingly, your patch uses a different naming convention for > > the new CRC-64 one, and puts the Kconfig option in a different place, and makes > > it sound like it's a generic test for all CRC implementations rather than just > > the CRC-64 one. Please use the existing convention (i.e. add > > CONFIG_CRC64_SELFTEST and lib/crc64test.c) unless you have a strong argument for > > why it should be done differently. > > > > (And I don't think it makes sense to combine all CRC tests into one module, > > since you should be able to e.g. enable just CRC32 and CRC32_SELFTEST without > > also pulling in a dependency on all the other CRC variants.) > > > > Hi Eric, > > The purpose of test_crc is to provide a unified crc calculation > consistency testing for 0day. So far it is only crc64, and I will add > more test cases later. I see there is crc-32 test module, which does > more testing then consistency check, and no unified format for 0day > system to detect. This is why people suggested me to add this test > framework. > Actually the code in crc32test is nearly the same as what you're adding for CRC-64. The CRC-32 test is longer because it's testing two different polynomials "crc32" and "crc32c" as well as combining CRC's; neither of those is relevant for CRC-64 yet, as you've implemented just one polynomial and there is no function provided to combine CRC64's yet. The CRC-32 test also tests performance, but if you don't believe CRC performance should be tested, then you should remove the performance test from the existing module rather than implementing a brand new test module just to remove the performance test... I still don't understand why you decided to do things differently for CRC-64, when there were already CRC-32 tests that used a certain convention for the Kconfig option, filename, etc. It's inconsistent and confusing. Again, please use the existing convention unless you have a strong argument for why it should be done differently. (And if you do want to do things differently, the existing test should be converted first.) - Eric