summaryrefslogtreecommitdiffstats
path: root/src/vnet/unix
AgeCommit message (Expand)AuthorFilesLines
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne2-8/+41
2021-03-26vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendlyDamjan Marion1-43/+43
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-2/+2
2020-12-28vlib: add missing file template descriptionsPaul Vinciguerra1-0/+1
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-3/+3
2020-12-10misc: add a couple useful functions for gdbChristian Hopps1-0/+23
2020-11-09vlib: fix trace number accountingBenoît Ganne1-5/+3
2020-02-05vppinfra: numa vector placement supportDave Barach1-0/+15
2019-11-26misc: add gdb helpers for vlib buffersBenoît Ganne1-0/+27
2019-09-24vlib: add flag to explicitelly mark nodes which can init per-node packet traceDamjan Marion1-0/+1
2019-07-18vlib: convert frame_index into real pointersAndreas Schultz1-2/+2
2019-05-16init / exit function orderingDave Barach1-6/+6
2019-03-07gdb-helper: add gdb_show_tracesKingwel Xie1-0/+74
2019-02-09buffers: fix typoDamjan Marion1-2/+2
2019-02-06buffers: make buffer data size configurable from startup configDamjan Marion1-2/+2
2019-01-25deprecate tapcliDamjan Marion4-2018/+0
2019-01-01buffers: remove unused codeDamjan Marion1-5/+2
2018-11-17pcap-based dispatch tracerDave Barach4-515/+2
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-8/+9
2018-11-13vlib rename vlib_frame_args(...) to vlib_frame_scalar_args(..)Damjan Marion2-5/+5
2018-11-08vnet: store hw interface speed in kbps instead of using flagsDamjan Marion1-4/+2
2018-10-23c11 safe string handling supportDave Barach4-21/+21
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra2-7/+7
2018-07-26Clean up dpdk plugin rx/tx pcap tracingDave Barach2-0/+6
2018-07-23fix vector index range checksEyal Bari1-1/+1
2018-07-15VPP-1341: fix loopback interface graph arcsDave Barach1-1/+1
2018-07-11avoid using thread local storage for thread indexDamjan Marion2-4/+4
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-2/+1
2018-05-25Add interface rx pcap tracingDave Barach1-15/+13
2018-05-17Packet generator: preserve pcap file timestampsDave Barach2-0/+10
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware interf...Damjan Marion1-3/+2
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-2/+3
2018-02-23Convert a pcap file to a set of C initializersDave Barach2-1/+140
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-1/+1
2018-01-11api: remove transport specific code from handlersFlorin Coras1-21/+21
2018-01-09api: refactor vlibmemoryFlorin Coras1-7/+6
2017-12-11VPP-273 Coding standards cleanup - vnet/vnet/unixsharath reddy8-794/+947
2017-12-04tapcli: change interface nameDamjan Marion1-1/+1
2017-10-19VPP-1024: rewrite buffer trajectory tracerDave Barach1-0/+13
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach1-0/+2
2017-10-06tuntap: Introduce per thread structure to suport multi-threadsSteven2-65/+99
2017-09-28tun/tap: Bad packets sent to kernel via tun/tap interfaceSteven2-22/+29
2017-09-09move unix_file_* code to vppinfraDamjan Marion2-16/+13
2017-08-18Use correct msg ID in the sw-interface-event from TAP and VHOSTNeale Ranns1-1/+1
2017-08-11Dedicated SW Interface EventNeale Ranns1-3/+3
2017-08-11the automatic addition of IP address to the magic TAP interface should only h...Neale Ranns1-0/+21
2017-08-02Fix tcp tx buffer allocationFlorin Coras1-1/+44
2017-05-17VPP-846: tcp perf / scale / hardeningDave Barach1-1/+11
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach1-11/+1
2017-04-06Use thread local storage for thread indexDamjan Marion2-3/+3
pan>) #undef _ static_always_inline u32x16 u32x16_byte_swap (u32x16 v) { u8x64 swap = { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 }; return (u32x16) _mm512_shuffle_epi8 ((__m512i) v, (__m512i) swap); } static_always_inline u16x32 u16x32_byte_swap (u16x32 v) { u8x64 swap = { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 }; return (u16x32) _mm512_shuffle_epi8 ((__m512i) v, (__m512i) swap); } #define _(f, t) \ static_always_inline t f##_extract_lo (f v) \ { \ return (t) _mm512_extracti64x4_epi64 ((__m512i) v, 0); \ } \ static_always_inline t f##_extract_hi (f v) \ { \ return (t) _mm512_extracti64x4_epi64 ((__m512i) v, 1); \ } _ (u64x8, u64x4) _ (u32x16, u32x8) _ (u16x32, u16x16) _ (u8x64, u8x32) #undef _ static_always_inline u32 u32x16_min_scalar (u32x16 v) { return u32x8_min_scalar (u32x8_min (u32x16_extract_lo (v), u32x16_extract_hi (v))); } static_always_inline u32x16 u32x16_insert_lo (u32x16 r, u32x8 v) { return (u32x16) _mm512_inserti64x4 ((__m512i) r, (__m256i) v, 0); } static_always_inline u32x16 u32x16_insert_hi (u32x16 r, u32x8 v) { return (u32x16) _mm512_inserti64x4 ((__m512i) r, (__m256i) v, 1); } static_always_inline u64x8 u64x8_permute (u64x8 a, u64x8 b, u64x8 mask) { return (u64x8) _mm512_permutex2var_epi64 ((__m512i) a, (__m512i) mask, (__m512i) b); } #define u32x16_ternary_logic(a, b, c, d) \ (u32x16) _mm512_ternarylogic_epi32 ((__m512i) a, (__m512i) b, (__m512i) c, d) #define u8x64_insert_u8x16(a, b, n) \ (u8x64) _mm512_inserti64x2 ((__m512i) (a), (__m128i) (b), n) #define u8x64_extract_u8x16(a, n) \ (u8x16) _mm512_extracti64x2_epi64 ((__m512i) (a), n) #define u8x64_word_shift_left(a,n) (u8x64) _mm512_bslli_epi128((__m512i) a, n) #define u8x64_word_shift_right(a,n) (u8x64) _mm512_bsrli_epi128((__m512i) a, n) static_always_inline u8x64 u8x64_xor3 (u8x64 a, u8x64 b, u8x64 c) { return (u8x64) _mm512_ternarylogic_epi32 ((__m512i) a, (__m512i) b, (__m512i) c, 0x96); } static_always_inline u8x64 u8x64_reflect_u8x16 (u8x64 x) { static const u8x64 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, }; return (u8x64) _mm512_shuffle_epi8 ((__m512i) x, (__m512i) mask); } static_always_inline u8x64 u8x64_shuffle (u8x64 v, u8x64 m) { return (u8x64) _mm512_shuffle_epi8 ((__m512i) v, (__m512i) m); } #define u8x64_align_right(a, b, imm) \ (u8x64) _mm512_alignr_epi8 ((__m512i) a, (__m512i) b, imm) static_always_inline u32 u32x16_sum_elts (u32x16 sum16) { u32x8 sum8; sum16 += (u32x16) u8x64_align_right (sum16, sum16, 8); sum16 += (u32x16) u8x64_align_right (sum16, sum16, 4); sum8 = u32x16_extract_hi (sum16) + u32x16_extract_lo (sum16); return sum8[0] + sum8[4]; } #define _(t, m, p, i, e) \ static_always_inline t t##_mask_load (t a, void *p, m mask) \ { \ return (t) p##_mask_loadu_##e ((i) a, mask, p); \ } \ static_always_inline t t##_mask_load_zero (void *p, m mask) \ { \ return (t) p##_maskz_loadu_##e (mask, p); \ } \ static_always_inline void t##_mask_store (t a, void *p, m mask) \ { \ p##_mask_storeu_##e (p, mask, (i) a); \ } _ (u8x64, u64, _mm512, __m512i, epi8) _ (u8x32, u32, _mm256, __m256i, epi8) _ (u8x16, u16, _mm, __m128i, epi8) _ (u16x32, u32, _mm512, __m512i, epi16) _ (u16x16, u16, _mm256, __m256i, epi16) _ (u16x8, u8, _mm, __m128i, epi16) _ (u32x16, u16, _mm512, __m512i, epi32) _ (u32x8, u8, _mm256, __m256i, epi32) _ (u32x4, u8, _mm, __m128i, epi32) _ (u64x8, u8, _mm512, __m512i, epi64) _ (u64x4, u8, _mm256, __m256i, epi64) _ (u64x2, u8, _mm, __m128i, epi64) #undef _ #ifdef CLIB_HAVE_VEC512 #define CLIB_HAVE_VEC512_MASK_LOAD_STORE #endif #ifdef CLIB_HAVE_VEC256 #define CLIB_HAVE_VEC256_MASK_LOAD_STORE #endif #ifdef CLIB_HAVE_VEC128 #define CLIB_HAVE_VEC128_MASK_LOAD_STORE #endif static_always_inline u8x64 u8x64_splat_u8x16 (u8x16 a) { return (u8x64) _mm512_broadcast_i64x2 ((__m128i) a); } static_always_inline u32x16 u32x16_splat_u32x4 (u32x4 a) { return (u32x16) _mm512_broadcast_i64x2 ((__m128i) a); } static_always_inline u32x16 u32x16_mask_blend (u32x16 a, u32x16 b, u16 mask) { return (u32x16) _mm512_mask_blend_epi32 (mask, (__m512i) a, (__m512i) b); } static_always_inline u8x64 u8x64_mask_blend (u8x64 a, u8x64 b, u64 mask) { return (u8x64) _mm512_mask_blend_epi8 (mask, (__m512i) a, (__m512i) b); } #define _(t, m, e, p, it) \ static_always_inline m t##_is_equal_mask (t a, t b) \ { \ return p##_cmpeq_##e##_mask ((it) a, (it) b); \ } _ (u8x16, u16, epu8, _mm, __m128i) _ (u16x8, u8, epu16, _mm, __m128i) _ (u32x4, u8, epu32, _mm, __m128i) _ (u64x2, u8, epu64, _mm, __m128i) _ (u8x32, u32, epu8, _mm256, __m256i) _ (u16x16, u16, epu16, _mm256, __m256i) _ (u32x8, u8, epu32, _mm256, __m256i) _ (u64x4, u8, epu64, _mm256, __m256i) _ (u8x64, u64, epu8, _mm512, __m512i) _ (u16x32, u32, epu16, _mm512, __m512i) _ (u32x16, u16, epu32, _mm512, __m512i) _ (u64x8, u8, epu64, _mm512, __m512i) #undef _ #define _(f, t, fn, it) \ static_always_inline t t##_from_##f (f x) { return (t) fn ((it) x); } _ (u16x16, u32x16, _mm512_cvtepi16_epi32, __m256i) _ (u32x16, u16x16, _mm512_cvtusepi32_epi16, __m512i) _ (u32x8, u16x8, _mm256_cvtusepi32_epi16, __m256i) _ (u32x8, u64x8, _mm512_cvtepu32_epi64, __m256i) #undef _ #define _(vt, mt, p, it, epi) \ static_always_inline vt vt##_compress (vt a, mt mask) \ { \ return (vt) p##_maskz_compress_##epi (mask, (it) a); \ } \ static_always_inline vt vt##_expand (vt a, mt mask) \ { \ return (vt) p##_maskz_expand_##epi (mask, (it) a); \ } \ static_always_inline void vt##_compress_store (vt v, mt mask, void *p) \ { \ p##_mask_compressstoreu_##epi (p, mask, (it) v); \ } _ (u64x8, u8, _mm512, __m512i, epi64) _ (u32x16, u16, _mm512, __m512i, epi32) _ (u64x4, u8, _mm256, __m256i, epi64) _ (u32x8, u8, _mm256, __m256i, epi32) _ (u64x2, u8, _mm, __m128i, epi64) _ (u32x4, u8, _mm, __m128i, epi32) #ifdef __AVX512VBMI2__ _ (u16x32, u32, _mm512, __m512i, epi16) _ (u8x64, u64, _mm512, __m512i, epi8) _ (u16x16, u16, _mm256, __m256i, epi16) _ (u8x32, u32, _mm256, __m256i, epi8) _ (u16x8, u8, _mm, __m128i, epi16) _ (u8x16, u16, _mm, __m128i, epi8) #endif #undef _ #ifdef CLIB_HAVE_VEC256 #define CLIB_HAVE_VEC256_COMPRESS #endif #ifdef CLIB_HAVE_VEC512 #define CLIB_HAVE_VEC512_COMPRESS #endif #ifndef __AVX512VBMI2__ static_always_inline u16x16 u16x16_compress (u16x16 v, u16 mask) { return u16x16_from_u32x16 (u32x16_compress (u32x16_from_u16x16 (v), mask)); } static_always_inline u16x8 u16x8_compress (u16x8 v, u8 mask) { return u16x8_from_u32x8 (u32x8_compress (u32x8_from_u16x8 (v), mask)); } #endif static_always_inline void u32x16_transpose (u32x16 m[16]) { __m512i r[16], a, b, c, d, x, y; /* *INDENT-OFF* */ __m512i pm1 = (__m512i) (u64x8) { 0, 1, 8, 9, 4, 5, 12, 13}; __m512i pm2 = (__m512i) (u64x8) { 2, 3, 10, 11, 6, 7, 14, 15}; __m512i pm3 = (__m512i) (u64x8) { 0, 1, 2, 3, 8, 9, 10, 11}; __m512i pm4 = (__m512i) (u64x8) { 4, 5, 6, 7, 12, 13, 14, 15}; /* *INDENT-ON* */ r[0] = _mm512_unpacklo_epi32 ((__m512i) m[0], (__m512i) m[1]); r[1] = _mm512_unpacklo_epi32 ((__m512i) m[2], (__m512i) m[3]); r[2] = _mm512_unpacklo_epi32 ((__m512i) m[4], (__m512i) m[5]); r[3] = _mm512_unpacklo_epi32 ((__m512i) m[6], (__m512i) m[7]); r[4] = _mm512_unpacklo_epi32 ((__m512i) m[8], (__m512i) m[9]); r[5] = _mm512_unpacklo_epi32 ((__m512i) m[10], (__m512i) m[11]); r[6] = _mm512_unpacklo_epi32 ((__m512i) m[12], (__m512i) m[13]); r[7] = _mm512_unpacklo_epi32 ((__m512i) m[14], (__m512i) m[15]); r[8] = _mm512_unpackhi_epi32 ((__m512i) m[0], (__m512i) m[1]); r[9] = _mm512_unpackhi_epi32 ((__m512i) m[2], (__m512i) m[3]); r[10] = _mm512_unpackhi_epi32 ((__m512i) m[4], (__m512i) m[5]); r[11] = _mm512_unpackhi_epi32 ((__m512i) m[6], (__m512i) m[7]); r[12] = _mm512_unpackhi_epi32 ((__m512i) m[8], (__m512i) m[9]); r[13] = _mm512_unpackhi_epi32 ((__m512i) m[10], (__m512i) m[11]); r[14] = _mm512_unpackhi_epi32 ((__m512i) m[12], (__m512i) m[13]); r[15] = _mm512_unpackhi_epi32 ((__m512i) m[14], (__m512i) m[15]); a = _mm512_unpacklo_epi64 (r[0], r[1]); b = _mm512_unpacklo_epi64 (r[2], r[3]); c = _mm512_unpacklo_epi64 (r[4], r[5]); d = _mm512_unpacklo_epi64 (r[6], r[7]); x = _mm512_permutex2var_epi64 (a, pm1, b); y = _mm512_permutex2var_epi64 (c, pm1, d); m[0] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[8] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (a, pm2, b); y = _mm512_permutex2var_epi64 (c, pm2, d); m[4] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[12] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); a = _mm512_unpacklo_epi64 (r[8], r[9]); b = _mm512_unpacklo_epi64 (r[10], r[11]); c = _mm512_unpacklo_epi64 (r[12], r[13]); d = _mm512_unpacklo_epi64 (r[14], r[15]); x = _mm512_permutex2var_epi64 (a, pm1, b); y = _mm512_permutex2var_epi64 (c, pm1, d); m[2] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[10] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (a, pm2, b); y = _mm512_permutex2var_epi64 (c, pm2, d); m[6] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[14] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); a = _mm512_unpackhi_epi64 (r[0], r[1]); b = _mm512_unpackhi_epi64 (r[2], r[3]); c = _mm512_unpackhi_epi64 (r[4], r[5]); d = _mm512_unpackhi_epi64 (r[6], r[7]); x = _mm512_permutex2var_epi64 (a, pm1, b); y = _mm512_permutex2var_epi64 (c, pm1, d); m[1] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[9] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (a, pm2, b); y = _mm512_permutex2var_epi64 (c, pm2, d); m[5] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[13] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); a = _mm512_unpackhi_epi64 (r[8], r[9]); b = _mm512_unpackhi_epi64 (r[10], r[11]); c = _mm512_unpackhi_epi64 (r[12], r[13]); d = _mm512_unpackhi_epi64 (r[14], r[15]); x = _mm512_permutex2var_epi64 (a, pm1, b); y = _mm512_permutex2var_epi64 (c, pm1, d); m[3] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[11] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (a, pm2, b); y = _mm512_permutex2var_epi64 (c, pm2, d); m[7] = (u32x16) _mm512_permutex2var_epi64 (x, pm3, y); m[15] = (u32x16) _mm512_permutex2var_epi64 (x, pm4, y); } static_always_inline void u64x8_transpose (u64x8 m[8]) { __m512i r[8], x, y; /* *INDENT-OFF* */ __m512i pm1 = (__m512i) (u64x8) { 0, 1, 8, 9, 4, 5, 12, 13}; __m512i pm2 = (__m512i) (u64x8) { 2, 3, 10, 11, 6, 7, 14, 15}; __m512i pm3 = (__m512i) (u64x8) { 0, 1, 2, 3, 8, 9, 10, 11}; __m512i pm4 = (__m512i) (u64x8) { 4, 5, 6, 7, 12, 13, 14, 15}; /* *INDENT-ON* */ r[0] = _mm512_unpacklo_epi64 ((__m512i) m[0], (__m512i) m[1]); r[1] = _mm512_unpacklo_epi64 ((__m512i) m[2], (__m512i) m[3]); r[2] = _mm512_unpacklo_epi64 ((__m512i) m[4], (__m512i) m[5]); r[3] = _mm512_unpacklo_epi64 ((__m512i) m[6], (__m512i) m[7]); r[4] = _mm512_unpackhi_epi64 ((__m512i) m[0], (__m512i) m[1]); r[5] = _mm512_unpackhi_epi64 ((__m512i) m[2], (__m512i) m[3]); r[6] = _mm512_unpackhi_epi64 ((__m512i) m[4], (__m512i) m[5]); r[7] = _mm512_unpackhi_epi64 ((__m512i) m[6], (__m512i) m[7]); x = _mm512_permutex2var_epi64 (r[0], pm1, r[1]); y = _mm512_permutex2var_epi64 (r[2], pm1, r[3]); m[0] = (u64x8) _mm512_permutex2var_epi64 (x, pm3, y); m[4] = (u64x8) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (r[0], pm2, r[1]); y = _mm512_permutex2var_epi64 (r[2], pm2, r[3]); m[2] = (u64x8) _mm512_permutex2var_epi64 (x, pm3, y); m[6] = (u64x8) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (r[4], pm1, r[5]); y = _mm512_permutex2var_epi64 (r[6], pm1, r[7]); m[1] = (u64x8) _mm512_permutex2var_epi64 (x, pm3, y); m[5] = (u64x8) _mm512_permutex2var_epi64 (x, pm4, y); x = _mm512_permutex2var_epi64 (r[4], pm2, r[5]); y = _mm512_permutex2var_epi64 (r[6], pm2, r[7]); m[3] = (u64x8) _mm512_permutex2var_epi64 (x, pm3, y); m[7] = (u64x8) _mm512_permutex2var_epi64 (x, pm4, y); } #endif /* included_vector_avx512_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */