Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp244704imm; Tue, 21 Aug 2018 18:44:02 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx0zdqQ9nZTFqwdv6S3dnss+k1Vp1iPZRzRGaWPPGvgoFX0i+j8DgcR1ioCZ0ADe4PAk5ie X-Received: by 2002:a62:129a:: with SMTP id 26-v6mr55726320pfs.102.1534902242185; Tue, 21 Aug 2018 18:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534902242; cv=none; d=google.com; s=arc-20160816; b=bfRar3nvx4oKgegXwSxiXMdLsRXaJgWdndyi9NV9QW3kjmWKqecyE1WY4gyn6tfOXx wIn/VvBbhJbB26RFcfTA4QqMB5M0TVO+7/5H28tYPj1LQDuT4I+l6IRcD98DceW5jwzm 6NBIya64bqQhjoJBwDEyJxiwtEcD78OueWdJTJs/J+i23UhbSeqnRlbvbsi63sLLLbCV dLaxGV49MHHQf/tZrYEN/CMtGjx+QsiijljyxTHDimckfwUaPX633KNkud9hPqMprZFg 6wweqWiYNjpNWi2lvm319bp20VgP180Dyr2vd6boxSbRLZpVocmRghNrK5cfcwuMQbmD r40w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature:arc-authentication-results; bh=1BXj+iGG6JrPfuliedGsb0oZivCyaDi2jmgf9bSaol8=; b=FizOQ5nbhF5QSMfVvfMzLH91lh7yt3dYcVhT8eir9HWrpMAQFwW6BEynsZfT+ccLDC l0z2Sc/tGxgnbzERxjx8yFhkm8xx3v7DpZmrjyyMFWYro0eB87eN4NkQdFH3yi+/8tEp ZadClG8YLOgQng1X7xU8H6Z/C0KKC+j0fr2YM0fRcaz11LCJ/NtZhQyFYRTjUZpn5Mgp FqLInL1Cd0ZtGXgCGPRURmtSklXm8lc+mJ42ToxU4w//yi3B1HPDNbR31f1nSY/o59Fk zhk7o4G5rSjHwmzyAI5UgKBrZef7nj6ft/2le7pX1RPGyoc40d9cReyIAeg12h9gUURX vbqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Jv0venbz; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26-v6si390405pfn.111.2018.08.21.18.43.47; Tue, 21 Aug 2018 18:44:02 -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=@oracle.com header.s=corp-2018-07-02 header.b=Jv0venbz; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727655AbeHVFD0 (ORCPT + 99 others); Wed, 22 Aug 2018 01:03:26 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:40834 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbeHVFD0 (ORCPT ); Wed, 22 Aug 2018 01:03:26 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7M1eEGr030350; Wed, 22 Aug 2018 01:40:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=1BXj+iGG6JrPfuliedGsb0oZivCyaDi2jmgf9bSaol8=; b=Jv0venbzCx9ZBg6rD9jO5ewWpLGUTD1HCFSHSBzyme7WUo5JZ2VpMyyKb8zC8VAxm6Rm CNVRvuPoQ7E62zLaVjO+5DM1EkMRImv4E1VybAyh37eNKf/km9Q4zVfDZuMh/PBqLbLf d9z/EOS+x6GeiqOVB5qZIVSk/9IbT3UNt+9Hcz3nIFLow7DCUUAthhZ6flY/v73/C//p pawT6OO8Oc3PS8vl5+Dw1FjITfwAHUNapz0gAlWTgvLl/3iSGJwUYm4Fi3dKP9vuMfJc gHAnsCfDwVfWozY27ih6qUc1rof6xdHrdr0fdqaw4hTIlZvEPDy7tk5NHmRa/ZQTYMVW 4Q== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2kxavtqwmh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Aug 2018 01:40:43 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7M1eb5O026222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Aug 2018 01:40:38 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7M1eb0k001995; Wed, 22 Aug 2018 01:40:37 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Aug 2018 18:40:37 -0700 To: "Martin K. Petersen" Cc: Jeff Lien , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, herbert@gondor.apana.org.au, tim.c.chen@linux.intel.com, david.darrington@wdc.com, jeff.furlong@wdc.com Subject: Re: [PATCH] Performance Improvement in CRC16 Calculations. From: "Martin K. Petersen" Organization: Oracle Corporation References: <1533928331-21303-1-git-send-email-jeff.lien@wdc.com> Date: Tue, 21 Aug 2018 21:40:34 -0400 In-Reply-To: (Martin K. Petersen's message of "Sat, 11 Aug 2018 11:36:20 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8992 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808220016 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > These days we obviously use the hardware-accelerated CRC calculation > so the software table approach mostly serves as a reference > implementation. I was puzzled as to why WDC's tests did not seem to use the hardware- accelerated CRC calculation whereas tests on my end worked fine. Turns out this is due to an unfortunate side effect of how the crypto subsystem works. When crc-t10dif is initialized, the crypto infrastructure will pick the algorithm with the highest priority currently registered. Both block and SCSI will cause crc-t10dif to be compiled as a built-in so this selection happens very early. If crct10dif-pclmul is compiled as a module it will not be available at the time the T10 CRC library is initialized. And thus the block layer integrity code will be stuck with the sluggish table CRC. The workaround is to build with CONFIG_CRYPTO_CRCT10DIF_PCLMUL=y. However, it seems like a bit of a deficiency in crypto that there is no way to upgrade existing transformations if higher priority algorithms become available. btrfs and a few others work around this issue by not using the generic lib/ CRC functions (which defeats the purpose of having these in the first place). Instead they are registering their own transformation at a later time where any accelerator modules are more likely to be loaded. Anyway. Just a heads up to people that wonder why the table algorithm is being exercised despite their hardware supporting CRC acceleration. -- Martin K. Petersen Oracle Linux Engineering