<div dir="ltr"><div>Has this patch been merged in the end?<br></div>Is sheepdog using ssse3 and avx to speed up checksum calculation?<br><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013-09-09 11:51 GMT+02:00 MORITA Kazutaka <span dir="ltr"><<a href="mailto:morita.kazutaka@lab.ntt.co.jp" target="_blank">morita.kazutaka@lab.ntt.co.jp</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At Mon, 9 Sep 2013 17:45:17 +0800,<br>
<div><div class="h5">Liu Yuan wrote:<br>
><br>
> On Mon, Sep 09, 2013 at 06:15:24PM +0900, MORITA Kazutaka wrote:<br>
> > At Thu,  5 Sep 2013 18:47:52 +0800,<br>
> > Liu Yuan wrote:<br>
> > ><br>
> > > This doesn't change the sha1 algorithm. This patch tries to make use of intel's<br>
> > > ssse3 and avx for sha1 acceleration.<br>
> > ><br>
> > > Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
> > > ---<br>
> > >  include/sha1.h   |   11 +-<br>
> > >  lib/Makefile.am  |    2 +-<br>
> > >  lib/sha1.c       |  159 +++++++++++++--<br>
> > >  lib/sha1_ssse3.S |  564 ++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
> > >  4 files changed, 721 insertions(+), 15 deletions(-)<br>
> > >  create mode 100644 lib/sha1_ssse3.S<br>
> > ><br>
> > > diff --git a/include/sha1.h b/include/sha1.h<br>
> > > index a778aea..9ae70b5 100644<br>
> > > --- a/include/sha1.h<br>
> > > +++ b/include/sha1.h<br>
> > > @@ -23,9 +23,14 @@ struct sha1_ctx {<br>
> > >   uint8_t buffer[SHA1_BLOCK_SIZE];<br>
> > >  };<br>
> > ><br>
> > > -void sha1_init(void *ctx);<br>
> > > -void sha1_update(void *ctx, const uint8_t *data, unsigned int len);<br>
> > > -void sha1_final(void *ctx, uint8_t *out);<br>
> > > +typedef void (*sha1_init_func_t)(void *);<br>
> > > +typedef void (*sha1_update_func_t)(void *, const uint8_t *, unsigned int);<br>
> > > +typedef void (*sha1_final_func_t)(void *, uint8_t *);<br>
> > > +<br>
> > > +sha1_init_func_t sha1_init;<br>
> > > +sha1_update_func_t sha1_update;<br>
> > > +sha1_final_func_t sha1_final;<br>
> > > +<br>
> > >  const char *sha1_to_hex(const unsigned char *sha1);<br>
> > >  void sha1_from_buffer(const void *buf, size_t size, unsigned char *sha1);<br>
> > ><br>
> > > diff --git a/lib/Makefile.am b/lib/Makefile.am<br>
> > > index 22edf6e..2fa84be 100644<br>
> > > --- a/lib/Makefile.am<br>
> > > +++ b/lib/Makefile.am<br>
> > > @@ -5,7 +5,7 @@ INCLUDES                = -I$(top_builddir)/include -I$(top_srcdir)/include<br>
> > >  noinst_LIBRARIES = libsheepdog.a<br>
> > ><br>
> > >  libsheepdog_a_SOURCES    = event.c logger.c net.c util.c rbtree.c strbuf.c \<br>
> > > -                   sha1.c option.c work.c sockfd_cache.c<br>
> > > +                   sha1.c option.c work.c sockfd_cache.c sha1_ssse3.S<br>
> ><br>
> > This can be compiled only on x86_64.  Can you add ifdef and make other<br>
> > architectures use the old code?<br>
> ><br>
><br>
> See patch 1/2 and __sha1_init, which implement your suggestion.<br>
<br>
</div></div>But this Makefile links sha1_ssse3.S anyway and I got a compile error<br>
at least on i386.<br>
<br>
Thanks,<br>
<br>
Kazutaka<br>
<div class="HOEnZb"><div class="h5">--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>