This commit is contained in:
Joseph Henry 2018-01-09 10:00:01 -08:00
commit 09e4ab9aa1
4 changed files with 8 additions and 16 deletions

View File

@ -47,7 +47,7 @@ static inline void ZT_FAST_MEMCPY(void *a,const void *b,unsigned long k)
{ {
char *aa = reinterpret_cast<char *>(a); char *aa = reinterpret_cast<char *>(a);
const char *bb = reinterpret_cast<const char *>(b); const char *bb = reinterpret_cast<const char *>(b);
while (likely(k >= 128)) { while (k >= 64) {
__m128 t1 = _mm_loadu_ps(reinterpret_cast<const float *>(bb)); __m128 t1 = _mm_loadu_ps(reinterpret_cast<const float *>(bb));
__m128 t2 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 16)); __m128 t2 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 16));
__m128 t3 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 32)); __m128 t3 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 32));
@ -56,19 +56,11 @@ static inline void ZT_FAST_MEMCPY(void *a,const void *b,unsigned long k)
_mm_storeu_ps(reinterpret_cast<float *>(aa + 16),t2); _mm_storeu_ps(reinterpret_cast<float *>(aa + 16),t2);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 32),t3); _mm_storeu_ps(reinterpret_cast<float *>(aa + 32),t3);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 48),t4); _mm_storeu_ps(reinterpret_cast<float *>(aa + 48),t4);
t1 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 64)); bb += 64;
t2 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 80)); aa += 64;
t3 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 96)); k -= 64;
t4 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 112));
_mm_storeu_ps(reinterpret_cast<float *>(aa + 64),t1);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 80),t2);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 96),t3);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 112),t4);
bb += 128;
aa += 128;
k -= 128;
} }
while (likely(k >= 16)) { while (k >= 16) {
__m128 t1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(bb)); __m128 t1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(bb));
_mm_storeu_si128(reinterpret_cast<__m128i *>(aa),t1); _mm_storeu_si128(reinterpret_cast<__m128i *>(aa),t1);
bb += 16; bb += 16;

View File

@ -72,7 +72,7 @@
#define ZT_BINDER_REFRESH_PERIOD 30000 #define ZT_BINDER_REFRESH_PERIOD 30000
// Max number of bindings // Max number of bindings
#define ZT_BINDER_MAX_BINDINGS 128 #define ZT_BINDER_MAX_BINDINGS 256
namespace ZeroTier { namespace ZeroTier {

View File

@ -621,7 +621,7 @@ static int testPacket()
return -1; return -1;
} }
a.armor(salsaKey,true,0); a.armor(salsaKey,true);
if (!a.dearmor(salsaKey)) { if (!a.dearmor(salsaKey)) {
std::cout << "FAIL (encrypt-decrypt/verify)" << std::endl; std::cout << "FAIL (encrypt-decrypt/verify)" << std::endl;
return -1; return -1;

View File

@ -585,7 +585,7 @@ public:
} else break; } else break;
++fno; ++fno;
} }
if ( (trustedPathId != 0) && ((trustedPathNetwork.ss_family == AF_INET)||(trustedPathNetwork.ss_family == AF_INET6)) && (trustedPathNetwork.ipScope() != InetAddress::IP_SCOPE_GLOBAL) && (trustedPathNetwork.netmaskBits() > 0) ) { if ( (trustedPathId != 0) && ((trustedPathNetwork.ss_family == AF_INET)||(trustedPathNetwork.ss_family == AF_INET6)) && (trustedPathNetwork.netmaskBits() > 0) ) {
ppc[trustedPathNetwork].trustedPathId = trustedPathId; ppc[trustedPathNetwork].trustedPathId = trustedPathId;
ppc[trustedPathNetwork].mtu = 0; // use default ppc[trustedPathNetwork].mtu = 0; // use default
} }