From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Randy Dunlap <rdunlap@xenotime.net>,
linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-crypto@vger.kernel.org
Subject: Re: [RFC 12/12] iscsi-target: Add Makefile/Kconfig and update TCM top level
Date: Fri, 04 Mar 2011 11:00:21 -0600 [thread overview]
Message-ID: <1299258022.7041.64.camel@mulgrave.site> (raw)
In-Reply-To: <1299185905.5401.405.camel@haakon2.linux-iscsi.org>
On Thu, 2011-03-03 at 12:58 -0800, Nicholas A. Bellinger wrote:
> On Thu, 2011-03-03 at 09:19 -0500, Christoph Hellwig wrote:
> > On Wed, Mar 02, 2011 at 01:32:11PM -0800, Nicholas A. Bellinger wrote:
> > > The kernel code itself that is specific to using the SSE v4.2
> > > instruction for CRC32C offload are using #ifdef CONFIG_X86 stubs in
> > > iscsi_target_login.c:iscsi_login_setup_crypto(), and !CONFIG_X86 will
> > > default to using the unoptimized 1x8 slicing soft CRC32C code. This
> > > particular piece of logic has been tested on powerpc and arm and is
> > > funcitoning as expected from the kernel level using the arch independent
> > > soft code.
> >
> > I don't think you need that code at all. The crypto code is structured
> > to prefer the optimized implementation if it is present. Just stripping
> > the x86-specific code out and always requesting the plain crc32c
> > algorithm should give you the optimized one if it is present on your
> > system.
> >
> > Please give it a try.
> >
>
> This is what I originally thought as well, but this ended up not being
> the case when the logic was originally coded up. I just tried again
> with .38-rc7 on a 5500 series machine and simply stubbing out the
> CONFIG_X86 part from iscsi_login_setup_crypto() and calling:
>
> crypto_alloc_hash("crc32c", 0, CRYPTO_ALG_ASYNC)
>
> does not automatically load and use crc32c_intel.ko when only requesting
> plain crc32c.
It sounds like there might be a bug in the crypto layer, so the Linux
way is to make it work as intended.
It's absolutely not acceptable just to pull other layer workarounds into
drivers.
> The reason for the extra crypto_alloc_hash("crc32c-intel", ...) call in
> iscsi_login_setup_crypto() is to load crc32c_intel.ko on-demand for
> cpu_has_xmm4_2 capable machines.
>
> I should mention this is with the following .config:
>
> CONFIG_CRYPTO_CRC32C=y
> CONFIG_CRYPTO_CRC32C_INTEL=m
>
> This would seem to indicate that CRC32C_INTEL needs to be compiled in
> (or at least manually loaded) for libcypto to use the optimized
> instructions when the plain crc32c is called, correct..?
That sounds right. There's probably not an autoload for this on
recognising sse instructions.
James
James
next prev parent reply other threads:[~2011-03-04 17:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 3:33 [RFC 00/12] iSCSI target v4.1.0-rc1 series Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 01/12] iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 02/12] iscsi-target: Add primary iSCSI request/response state machine logic Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 03/12] iscsi-target: Add TCM v4 compatiable ConfigFS control plane Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 04/12] iscsi-target: Add configfs fabric dependent statistics Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 05/12] iscsi-target: Add TPG and Device logic Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 06/12] iscsi-target: Add iSCSI Login Negotiation and Parameter logic Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 07/12] iscsi-target: Add CHAP Authentication support using libcrypto Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 08/12] iscsi-target: Add Sequence/PDU list + DataIN response logic Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 09/12] iscsi-target: Add iSCSI Error Recovery Hierarchy support Nicholas A. Bellinger
2011-03-02 3:33 ` [RFC 10/12] iscsi-target: Add support for task management operations Nicholas A. Bellinger
2011-03-02 3:34 ` [RFC 11/12] iscsi-target: Add misc utility and debug logic Nicholas A. Bellinger
2011-03-02 3:34 ` [RFC 12/12] iscsi-target: Add Makefile/Kconfig and update TCM top level Nicholas A. Bellinger
2011-03-02 6:32 ` Randy Dunlap
2011-03-02 21:32 ` Nicholas A. Bellinger
2011-03-02 22:45 ` Randy Dunlap
2011-03-02 23:18 ` Nicholas A. Bellinger
2011-03-03 14:19 ` Christoph Hellwig
2011-03-03 20:58 ` Nicholas A. Bellinger
2011-03-04 17:00 ` James Bottomley [this message]
2011-03-07 23:15 ` Nicholas A. Bellinger
2011-03-08 9:33 ` Herbert Xu
2011-03-10 8:02 ` Nicholas A. Bellinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299258022.7041.64.camel@mulgrave.site \
--to=james.bottomley@hansenpartnership.com \
--cc=hch@infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=rdunlap@xenotime.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®