lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 10:32:13 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Boaz Harrosh <bharrosh@...asas.com>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
	netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] [CRYPTO] tcrypt: Move sg_init_table out of timing
	loops

On Tue, Oct 30 2007, Boaz Harrosh wrote:
> On Mon, Oct 29 2007 at 22:16 +0200, Jens Axboe <jens.axboe@...cle.com> wrote:
> > On Fri, Oct 26 2007, Herbert Xu wrote:
> >> [CRYPTO] tcrypt: Move sg_init_table out of timing loops
> >>
> >> This patch moves the sg_init_table out of the timing loops for hash
> >> algorithms so that it doesn't impact on the speed test results.
> > 
> > Wouldn't it be better to just make sg_init_one() call sg_init_table?
> > 
> > diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
> > index 4571231..ccc55a6 100644
> > --- a/include/linux/scatterlist.h
> > +++ b/include/linux/scatterlist.h
> > @@ -202,28 +202,6 @@ static inline void __sg_mark_end(struct scatterlist *sg)
> >  }
> >  
> >  /**
> > - * sg_init_one - Initialize a single entry sg list
> > - * @sg:		 SG entry
> > - * @buf:	 Virtual address for IO
> > - * @buflen:	 IO length
> > - *
> > - * Notes:
> > - *   This should not be used on a single entry that is part of a larger
> > - *   table. Use sg_init_table() for that.
> > - *
> > - **/
> > -static inline void sg_init_one(struct scatterlist *sg, const void *buf,
> > -			       unsigned int buflen)
> > -{
> > -	memset(sg, 0, sizeof(*sg));
> > -#ifdef CONFIG_DEBUG_SG
> > -	sg->sg_magic = SG_MAGIC;
> > -#endif
> > -	sg_mark_end(sg, 1);
> > -	sg_set_buf(sg, buf, buflen);
> > -}
> > -
> > -/**
> >   * sg_init_table - Initialize SG table
> >   * @sgl:	   The SG table
> >   * @nents:	   Number of entries in table
> > @@ -247,6 +225,24 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
> >  }
> >  
> >  /**
> > + * sg_init_one - Initialize a single entry sg list
> > + * @sg:		 SG entry
> > + * @buf:	 Virtual address for IO
> > + * @buflen:	 IO length
> > + *
> > + * Notes:
> > + *   This should not be used on a single entry that is part of a larger
> > + *   table. Use sg_init_table() for that.
> > + *
> > + **/
> > +static inline void sg_init_one(struct scatterlist *sg, const void *buf,
> > +			       unsigned int buflen)
> > +{
> > +	sg_init_table(sg, 1);
> > +	sg_set_buf(sg, buf, buflen);
> > +}
> > +
> > +/**
> >   * sg_phys - Return physical address of an sg entry
> >   * @sg:	     SG entry
> >   *
> > 
> Yes please submit this patch. scsi-ml is full of sg_init_one, specially
> on the error recovery path.

Will do.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ