Re: [vpp-dev] Issue in VRRP functionality when compiling with devtoolset-7 with single worker configuration

2020-08-10 Thread Matthew Smith via lists.fd.io
Hi Amit,

This patch was merged on friday to address the same issue -
https://gerrit.fd.io/r/c/vpp/+/28192.

Please try applying that patch to your build and let me know if it fixes
the problem.

Thanks,
-Matt


On Mon, Aug 10, 2020 at 12:55 AM Amit Mehra  wrote:

> Hi Matthew,
>
> Can you please confirm if this is a known issue of VRRP with devtoolset-7
> or VRRP has a dependency on devtoolset-9 and should always be compiled with
> devtoolset-9?
>
> Regards
> Amit Mehra
>
> On Fri, Aug 7, 2020 at 10:52 AM Amit Mehra via lists.fd.io  gmail@lists.fd.io> wrote:
>
>> Hi,
>>
>> I am testing the Master/Backup functionality using the vrrp plugin
>> available in vpp-20.05 but i am observing the following issue when
>> compiling using devtoolset-7 and using 1 main thread and 1 worker thread in
>> my startup.conf
>>
>> 1) Master Node is sending vrrp broadcast advertisement messages on
>> 224.0.0.18
>> 2) These broadcast messages are getting dropped by vrrp plugin of Backup
>> Node with error "VRRP_ERROR_UNKNOWN_VR"(I could see the stats for this
>> error in show error as well). It seems that mhash_get() is not able to find
>> the hash entry on worker thread.
>> 3) However, when i am giving "vrrp vr add" again for same vr_id and
>> intfc, i am observing the error "VNET_API_ERROR_ENTRY_ALREADY_EXISTS". Here
>> also it call mhash_get() and is able to find the hash entry for the same
>> key but it is on main thread.
>> 4) Also, when i am using only main thread and no worker thread, then the
>> messages are not getting dropped and things seems to work fine.
>>
>> Is there some known issue in vrrp/vpp-20.05 if testing vrrp with workers
>> when using devtoolset-7 for compilation?
>>
>> Also, when i am using devtoolset-9 and using workers in my configuration,
>> then also i am not observing any issues and it seems to work fine.
>>
>> Any suggestions or workaround for testing vrrp while using devtoolset-7
>> in multiple worker config?
>>
>> Regards
>> Amit
>> 
>>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17182): https://lists.fd.io/g/vpp-dev/message/17182
Mute This Topic: https://lists.fd.io/mt/76043759/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto

2020-08-10 Thread Damjan Marion via lists.fd.io

This issue is already fixed in master, see:
https://git.fd.io/vpp/commit/?id=415b4b0

-
Damjan


-Original Message-
From: vpp-dev@lists.fd.io 
mailto:vpp-dev@lists.fd.io>> On Behalf Of ???
Sent: lundi 10 août 2020 10:11
To: Damjan Marion (damarion) mailto:damar...@cisco.com>>
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm
icv_size 8/12 crypto

I get it, in _mm_movemask_epi8, (r == T) should be replaced with
_mm_cmpeq_epi8 (r, T)


 /* check tag */

 u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
 r = _mm_loadu_si128 ((__m128i *) tag);
 if (_mm_movemask_epi8 (r == T) != tag_mask) {// what
is this?  it will return 0, when tag_len equals 12
return 0;
}




-原始邮件-
发件人:"叶东岗" mailto:y...@wangsu.com>>
发送时间:2020-08-07 10:37:24 (星期五)
收件人: damar...@cisco.com
抄送: vpp-dev@lists.fd.io
主题: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm
icv_size 8/12 crypto






VPP19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto,
any ideas?







static_always_inline int

aes_gcm (const u8 * in, u8 * out, const u8 * addt, const u8 * iv, u8
* tag,
u32 data_bytes, u32 aad_bytes, u8 tag_len, aes_gcm_key_data_t * kd,
int aes_rounds, int is_encrypt)
{
 int i;
 __m128i r, Y0, T = { };
 ghash_data_t _gd, *gd = &_gd;

 _mm_prefetch (iv, _MM_HINT_T0);
 _mm_prefetch (in, _MM_HINT_T0);
 _mm_prefetch (in + CLIB_CACHE_LINE_BYTES, _MM_HINT_T0);

 /* calculate ghash for AAD - optimized for ipsec common cases */
 if (aad_bytes == 8)
   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 8);
 else if (aad_bytes == 12)
   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 12);
 else
   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, aad_bytes);

 /* initalize counter */
 Y0 = _mm_loadu_si128 ((__m128i *) iv);
 Y0 = _mm_insert_epi32 (Y0, clib_host_to_net_u32 (1), 3);

 /* ghash and encrypt/edcrypt  */
 if (is_encrypt)
   T = aesni_gcm_enc (T, kd, Y0, in, out, data_bytes, aes_rounds);
 else
   T = aesni_gcm_dec (T, kd, Y0, in, out, data_bytes, aes_rounds);

 _mm_prefetch (tag, _MM_HINT_T0);

 /* Finalize ghash */
 r[0] = data_bytes;
 r[1] = aad_bytes;

 /* bytes to bits */
 r <<= 3;

 /* interleaved computation of final ghash and E(Y0, k) */
 ghash_mul_first (gd, r ^ T, kd->Hi[0]);
 r = kd->Ke[0] ^ Y0;
 for (i = 1; i < 5; i += 1)
   r = _mm_aesenc_si128 (r, kd->Ke[i]);
 ghash_reduce (gd);
 ghash_reduce2 (gd);
 for (; i < 9; i += 1)
   r = _mm_aesenc_si128 (r, kd->Ke[i]);
 T = ghash_final (gd);
 for (; i < aes_rounds; i += 1)
   r = _mm_aesenc_si128 (r, kd->Ke[i]);
 r = _mm_aesenclast_si128 (r, kd->Ke[aes_rounds]);
 T = aesni_gcm_bswap (T) ^ r;

 /* tag_len 16 -> 0 */
 tag_len &= 0xf;

 if (is_encrypt)
   {
 /* store tag */
 if (tag_len)
aesni_gcm_store_partial ((__m128i *) tag, T,   (1 << tag_len) - 1);
// must be tag_en
 else
_mm_storeu_si128 ((__m128i *) tag, T);
   }
 else
   {
 /* check tag */
 u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
 r = _mm_loadu_si128 ((__m128i *) tag);
 if (_mm_movemask_epi8 (r == T) != tag_mask) {
// what is this?  it will return 0, when tag_len equals 12
return 0;
 }
   }
 return 1;
}





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17181): https://lists.fd.io/g/vpp-dev/message/17181
Mute This Topic: https://lists.fd.io/mt/76100481/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto

2020-08-10 Thread Benoit Ganne (bganne) via lists.fd.io
Hi,

Thanks for digging into this issue! Could you propose a patch and associated 
unit tests in gerrit?

Best
ben

> -Original Message-
> From: vpp-dev@lists.fd.io  On Behalf Of ???
> Sent: lundi 10 août 2020 10:11
> To: Damjan Marion (damarion) 
> Cc: vpp-dev@lists.fd.io
> Subject: Re: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm
> icv_size 8/12 crypto
> 
> I get it, in _mm_movemask_epi8, (r == T) should be replaced with
> _mm_cmpeq_epi8 (r, T)
> 
> 
>   /* check tag */
> 
>   u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
>   r = _mm_loadu_si128 ((__m128i *) tag);
>   if (_mm_movemask_epi8 (r == T) != tag_mask) {// what
> is this?  it will return 0, when tag_len equals 12
> return 0;
>  }
> 
> 
> 
> 
>   -原始邮件-
>   发件人:"叶东岗" 
>   发送时间:2020-08-07 10:37:24 (星期五)
>   收件人: damar...@cisco.com
>   抄送: vpp-dev@lists.fd.io
>   主题: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm
> icv_size 8/12 crypto
> 
> 
> 
> 
> 
> 
>   VPP19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto,
> any ideas?
> 
> 
> 
> 
> 
> 
> 
>   static_always_inline int
> 
>   aes_gcm (const u8 * in, u8 * out, const u8 * addt, const u8 * iv, u8
> * tag,
>   u32 data_bytes, u32 aad_bytes, u8 tag_len, aes_gcm_key_data_t * kd,
>   int aes_rounds, int is_encrypt)
>   {
> int i;
> __m128i r, Y0, T = { };
> ghash_data_t _gd, *gd = &_gd;
> 
> _mm_prefetch (iv, _MM_HINT_T0);
> _mm_prefetch (in, _MM_HINT_T0);
> _mm_prefetch (in + CLIB_CACHE_LINE_BYTES, _MM_HINT_T0);
> 
> /* calculate ghash for AAD - optimized for ipsec common cases */
> if (aad_bytes == 8)
>   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 8);
> else if (aad_bytes == 12)
>   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 12);
> else
>   T = aesni_gcm_ghash (T, kd, (__m128i *) addt, aad_bytes);
> 
> /* initalize counter */
> Y0 = _mm_loadu_si128 ((__m128i *) iv);
> Y0 = _mm_insert_epi32 (Y0, clib_host_to_net_u32 (1), 3);
> 
> /* ghash and encrypt/edcrypt  */
> if (is_encrypt)
>   T = aesni_gcm_enc (T, kd, Y0, in, out, data_bytes, aes_rounds);
> else
>   T = aesni_gcm_dec (T, kd, Y0, in, out, data_bytes, aes_rounds);
> 
> _mm_prefetch (tag, _MM_HINT_T0);
> 
> /* Finalize ghash */
> r[0] = data_bytes;
> r[1] = aad_bytes;
> 
> /* bytes to bits */
> r <<= 3;
> 
> /* interleaved computation of final ghash and E(Y0, k) */
> ghash_mul_first (gd, r ^ T, kd->Hi[0]);
> r = kd->Ke[0] ^ Y0;
> for (i = 1; i < 5; i += 1)
>   r = _mm_aesenc_si128 (r, kd->Ke[i]);
> ghash_reduce (gd);
> ghash_reduce2 (gd);
> for (; i < 9; i += 1)
>   r = _mm_aesenc_si128 (r, kd->Ke[i]);
> T = ghash_final (gd);
> for (; i < aes_rounds; i += 1)
>   r = _mm_aesenc_si128 (r, kd->Ke[i]);
> r = _mm_aesenclast_si128 (r, kd->Ke[aes_rounds]);
> T = aesni_gcm_bswap (T) ^ r;
> 
> /* tag_len 16 -> 0 */
> tag_len &= 0xf;
> 
> if (is_encrypt)
>   {
> /* store tag */
> if (tag_len)
>   aesni_gcm_store_partial ((__m128i *) tag, T,   (1 << tag_len) - 1);
> // must be tag_en
> else
>   _mm_storeu_si128 ((__m128i *) tag, T);
>   }
> else
>   {
> /* check tag */
> u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
> r = _mm_loadu_si128 ((__m128i *) tag);
> if (_mm_movemask_epi8 (r == T) != tag_mask) {
> // what is this?  it will return 0, when tag_len equals 12
>   return 0;
> }
>   }
> return 1;
>   }
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17180): https://lists.fd.io/g/vpp-dev/message/17180
Mute This Topic: https://lists.fd.io/mt/76100481/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto

2020-08-10 Thread 叶东岗
I get it, in _mm_movemask_epi8, (r == T) should be replaced with _mm_cmpeq_epi8 
(r, T)


  /* check tag */

  u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
  r = _mm_loadu_si128 ((__m128i *) tag);
  if (_mm_movemask_epi8 (r == T) != tag_mask) {// what is 
this?  it will return 0, when tag_len equals 12
return 0;
 }


-原始邮件-
发件人:"叶东岗" 
发送时间:2020-08-07 10:37:24 (星期五)
收件人: damar...@cisco.com
抄送: vpp-dev@lists.fd.io
主题: [vpp-dev] vpp19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto






VPP19.08.2 crypto_ia32 do not support aes-gcm icv_size 8/12 crypto,  any ideas?







static_always_inline int

aes_gcm (const u8 * in, u8 * out, const u8 * addt, const u8 * iv, u8 * tag,
u32 data_bytes, u32 aad_bytes, u8 tag_len, aes_gcm_key_data_t * kd,
int aes_rounds, int is_encrypt)
{
  int i;
  __m128i r, Y0, T = { };
  ghash_data_t _gd, *gd = &_gd;

  _mm_prefetch (iv, _MM_HINT_T0);
  _mm_prefetch (in, _MM_HINT_T0);
  _mm_prefetch (in + CLIB_CACHE_LINE_BYTES, _MM_HINT_T0);

  /* calculate ghash for AAD - optimized for ipsec common cases */
  if (aad_bytes == 8)
T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 8);
  else if (aad_bytes == 12)
T = aesni_gcm_ghash (T, kd, (__m128i *) addt, 12);
  else
T = aesni_gcm_ghash (T, kd, (__m128i *) addt, aad_bytes);

  /* initalize counter */
  Y0 = _mm_loadu_si128 ((__m128i *) iv);
  Y0 = _mm_insert_epi32 (Y0, clib_host_to_net_u32 (1), 3);

  /* ghash and encrypt/edcrypt  */
  if (is_encrypt)
T = aesni_gcm_enc (T, kd, Y0, in, out, data_bytes, aes_rounds);
  else
T = aesni_gcm_dec (T, kd, Y0, in, out, data_bytes, aes_rounds);

  _mm_prefetch (tag, _MM_HINT_T0);

  /* Finalize ghash */
  r[0] = data_bytes;
  r[1] = aad_bytes;

  /* bytes to bits */
  r <<= 3;

  /* interleaved computation of final ghash and E(Y0, k) */
  ghash_mul_first (gd, r ^ T, kd->Hi[0]);
  r = kd->Ke[0] ^ Y0;
  for (i = 1; i < 5; i += 1)
r = _mm_aesenc_si128 (r, kd->Ke[i]);
  ghash_reduce (gd);
  ghash_reduce2 (gd);
  for (; i < 9; i += 1)
r = _mm_aesenc_si128 (r, kd->Ke[i]);
  T = ghash_final (gd);
  for (; i < aes_rounds; i += 1)
r = _mm_aesenc_si128 (r, kd->Ke[i]);
  r = _mm_aesenclast_si128 (r, kd->Ke[aes_rounds]);
  T = aesni_gcm_bswap (T) ^ r;

  /* tag_len 16 -> 0 */
  tag_len &= 0xf;

  if (is_encrypt)
{
  /* store tag */
  if (tag_len)
aesni_gcm_store_partial ((__m128i *) tag, T,   (1 << tag_len) - 1); // must 
be tag_en
  else
_mm_storeu_si128 ((__m128i *) tag, T);
}
  else
{
  /* check tag */
  u16 tag_mask = tag_len ? (1 << tag_len) - 1 : 0x;
  r = _mm_loadu_si128 ((__m128i *) tag);
  if (_mm_movemask_epi8 (r == T) != tag_mask) {// what is 
this?  it will return 0, when tag_len equals 12
return 0;
  }
}
  return 1;
}

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17179): https://lists.fd.io/g/vpp-dev/message/17179
Mute This Topic: https://lists.fd.io/mt/76100481/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] #vpp-memif Send packets out on physical interface controlled by vpp(DPDK) once they are received through memif

2020-08-10 Thread Benoit Ganne (bganne) via lists.fd.io
> But I am having trouble figuring out routing or ABF in former case. Once I
> send packet back to VPP after processing from my application, how VPP can
> send it out on physical interface. I have two physical interfaces.
> Normally packets flow between two using link routes automatically. Both
> interfaces have IP address from different subnets.

You should be able to use different VRF for each interface: 1 VRF with ABF for 
physical interfaces (packets rx on physical interfaces will use ABF to select 
destination) and another "classic" VRF for memif interfaces (packets rx on 
memif interfaces wil use classic LPM routing).

Best
ben
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17178): https://lists.fd.io/g/vpp-dev/message/17178
Mute This Topic: https://lists.fd.io/mt/76099289/21656
Mute #vpp-memif: https://lists.fd.io/g/fdio+vpp-dev/mutehashtag/vpp-memif
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] #vpp-memif Send packets out on physical interface controlled by vpp(DPDK) once they are received through memif

2020-08-10 Thread techiek7
[Edited Message Follows]

Thanks.

But I am having trouble figuring out routing or ABF in former case. Once I send 
packet back to VPP after processing from my application, how VPP can send it 
out on physical interface. I have two physical interfaces. Normally packets 
flow between two using link routes automatically. Both interfaces have IP 
address from different subnets.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17177): https://lists.fd.io/g/vpp-dev/message/17177
Mute This Topic: https://lists.fd.io/mt/76099289/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] #vpp-memif Send packets out on physical interface controlled by vpp(DPDK) once they are received through memif

2020-08-10 Thread techiek7
Thanks.

But I am having trouble figuring out routing or ABF in former case. Once I send 
packet back to VPP after processing from my application, how VPP can send it 
out on physical interface.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17177): https://lists.fd.io/g/vpp-dev/message/17177
Mute This Topic: https://lists.fd.io/mt/76099289/21656
Mute #vpp-memif: https://lists.fd.io/g/fdio+vpp-dev/mutehashtag/vpp-memif
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] #vpp-memif Send packets out on physical interface controlled by vpp(DPDK) once they are received through memif

2020-08-10 Thread Benoit Ganne (bganne) via lists.fd.io
> How do I send packets out on a physical interface after I received them
> through libmemif in non-vpp application from VPP(DPDK)? Do I need to send
> them back to vpp so that VPP can send them out on a physical interface.

If the physical interface is managed by VPP, yes, as you cannot share physical 
interfaces.
Otherwise you have the option to manage the physical interface directly from 
your app with eg. DPDK.

Best
ben
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#17176): https://lists.fd.io/g/vpp-dev/message/17176
Mute This Topic: https://lists.fd.io/mt/76099289/21656
Mute #vpp-memif: https://lists.fd.io/g/fdio+vpp-dev/mutehashtag/vpp-memif
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-