aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer.h
AgeCommit message (Expand)AuthorFilesLines
2020-11-24buffers: add page-size configNathan Skrzypczak1-0/+1
2020-11-13vlib: vlib_buffer_t should be always 128 bytes, not 2 cachelinesDamjan Marion1-4/+8
2020-04-28vlib: use flexible array in vlib_buffer for GCC-10Benoît Ganne1-1/+1
2019-11-18session: Increasing the Header lengthe sizeSrikanth Akula1-1/+0
2019-10-31vlib: only dump 1st buffer in chain by defaultBenoît Ganne1-1/+1
2019-10-28vlib: don't use vector for keeping buffer indices in the poolDamjan Marion1-2/+6
2019-06-24vlib: packet tracer support for pkt thread handoffsDave Barach1-2/+40
2019-03-28Punt InfraNeale Ranns1-2/+9
2019-03-04buffers: support cases where numa node memory is not availableDamjan Marion1-1/+3
2019-02-06buffers: make buffer data size configurable from startup configDamjan Marion1-1/+3
2019-01-30buffers: major cleanup and improvementsDamjan Marion1-88/+34
2019-01-24buffers: fix vector typesDamjan Marion1-2/+2
2019-01-23buffers: wrap vlib_buffer_t to union and expose vector typesDamjan Marion1-75/+84
2019-01-20buffers: remove VLIB_BUFFER_DEFAULT_FREE_LIST macro and fl->n_data_bytesDamjan Marion1-4/+0
2019-01-20buffers: remove vlib_buffer_delete_free_listDamjan Marion1-3/+0
2019-01-20buffers: keep buffer_main in vlib_main_tDamjan Marion1-10/+1
2019-01-19buffers: remove free-list information from buffer metadataDamjan Marion1-10/+6
2019-01-18deprecate clib_memcpy64_x4Damjan Marion1-3/+7
2019-01-01buffers: remove unused codeDamjan Marion1-60/+1
2018-12-04Add VNET_BUFFER_F_AVAIL definitionsDave Barach1-0/+1
2018-11-20dhcp4:(VPP-1483) linearize chained packets before handlingEyal Bari1-1/+1
2018-11-18add vlib_prefetch_buffer_data(...) macroDamjan Marion1-0/+2
2018-11-02vlib: define minimum chained buffer segment sizeDamjan Marion1-0/+11
2018-10-23Numa-aware, growable physical memory allocator (pmalloc)Damjan Marion1-12/+4
2018-10-22vlib: introduce vlib_buffer_get_{pa,va,current_va,current_pa} inlinesDamjan Marion1-0/+12
2018-09-03Deprecate old buffer replication schemeDamjan Marion1-12/+2
2018-04-27A bit of buffer metadata reshuffling to accommodate flow_idDamjan Marion1-12/+5
2018-04-09plugins: unload plugin if early init failsDamjan Marion1-0/+4
2018-03-14vlib: internal buffer manager reworkDamjan Marion1-30/+27
2018-03-05vlib: vfio code reworkDamjan Marion1-0/+1
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-23/+44
2017-11-27vlib: make vlib_buffer_alloc inline functionDamjan Marion1-8/+4
2017-11-13dpdk: introduce AVX512 variants of node functionsDamjan Marion1-9/+15
2017-10-25vlib: add support for multiple buffer poolsDamjan Marion1-4/+14
2017-10-19VPP-1024: rewrite buffer trajectory tracerDave Barach1-2/+7
2017-09-07vlib physmem reworkDamjan Marion1-1/+2
2017-08-30Thread safe internal buffer manager, take twoDamjan Marion1-0/+6
2017-07-27Thread safe internal buffer managerDamjan Marion1-0/+2
2017-07-17Fix unlinking of /dev/shm files.Dave Wallace1-9/+9
2017-07-14Introduce l{2,3,4}_hdr_offset fields in the buffer metadataDamjan Marion1-18/+22
2017-07-10vlib: store buffer memory information in the buffer_mainDamjan Marion1-6/+26
2017-05-03Fix vnet unit testsFilip Tehlar1-0/+12
2017-03-01VPP-598: tcp stack initial commitDave Barach1-0/+68
2017-03-01Fix buffer template copyDave Barach1-0/+2
2017-02-28vlib: add buffer cloning supportDamjan Marion1-1/+3
2017-02-27vlib: add VLIB_BUFFER_EXT_HDR_VALID flagDamjan Marion1-0/+2
2017-02-06vlib: remove algned/unaligned buffers schemeDamjan Marion1-11/+2
2017-01-14vlib: add buffer and thread callbacksDamjan Marion1-16/+29
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+417
unction (pg_main_t * pg, pg_stream_t * s, pg_edit_group_t * g, u32 * packets, u32 n_packets) { vlib_main_t *vm = vlib_get_main (); u32 ip_offset; ip_offset = g->start_byte_offset; switch (g->edit_function_opaque) { case IP4_PG_EDIT_LENGTH: compute_length_and_or_checksum (vm, packets, n_packets, ip_offset, IP4_PG_EDIT_LENGTH); break; case IP4_PG_EDIT_CHECKSUM: compute_length_and_or_checksum (vm, packets, n_packets, ip_offset, IP4_PG_EDIT_CHECKSUM); break; case IP4_PG_EDIT_LENGTH | IP4_PG_EDIT_CHECKSUM: compute_length_and_or_checksum (vm, packets, n_packets, ip_offset, IP4_PG_EDIT_LENGTH | IP4_PG_EDIT_CHECKSUM); break; default: ASSERT (0); break; } } typedef struct { pg_edit_t ip_version, header_length; pg_edit_t tos; pg_edit_t length; pg_edit_t fragment_id, fragment_offset; /* Flags together with fragment offset. */ pg_edit_t mf_flag, df_flag, ce_flag; pg_edit_t ttl; pg_edit_t protocol; pg_edit_t checksum; pg_edit_t src_address, dst_address; } pg_ip4_header_t; static inline void pg_ip4_header_init (pg_ip4_header_t * p) { /* Initialize fields that are not bit fields in the IP header. */ #define _(f) pg_edit_init (&p->f, ip4_header_t, f); _(tos); _(length); _(fragment_id); _(ttl); _(protocol); _(checksum); _(src_address); _(dst_address); #undef _ /* Initialize bit fields. */ pg_edit_init_bitfield (&p->header_length, ip4_header_t, ip_version_and_header_length, 0, 4); pg_edit_init_bitfield (&p->ip_version, ip4_header_t, ip_version_and_header_length, 4, 4); pg_edit_init_bitfield (&p->fragment_offset, ip4_header_t, flags_and_fragment_offset, 0, 13); pg_edit_init_bitfield (&p->mf_flag, ip4_header_t, flags_and_fragment_offset, 13, 1); pg_edit_init_bitfield (&p->df_flag, ip4_header_t, flags_and_fragment_offset, 14, 1); pg_edit_init_bitfield (&p->ce_flag, ip4_header_t, flags_and_fragment_offset, 15, 1); } uword unformat_pg_ip4_header (unformat_input_t * input, va_list * args) { pg_stream_t *s = va_arg (*args, pg_stream_t *); pg_ip4_header_t *p; u32 group_index; p = pg_create_edit_group (s, sizeof (p[0]), sizeof (ip4_header_t), &group_index); pg_ip4_header_init (p); /* Defaults. */ pg_edit_set_fixed (&p->ip_version, 4); pg_edit_set_fixed (&p->header_length, sizeof (ip4_header_t) / sizeof (u32)); pg_edit_set_fixed (&p->tos, 0); pg_edit_set_fixed (&p->ttl, 64); pg_edit_set_fixed (&p->fragment_id, 0); pg_edit_set_fixed (&p->fragment_offset, 0); pg_edit_set_fixed (&p->mf_flag, 0); pg_edit_set_fixed (&p->df_flag, 0); pg_edit_set_fixed (&p->ce_flag, 0); p->length.type = PG_EDIT_UNSPECIFIED; p->checksum.type = PG_EDIT_UNSPECIFIED; if (unformat (input, "%U: %U -> %U", unformat_pg_edit, unformat_ip_protocol, &p->protocol, unformat_pg_edit, unformat_ip4_address, &p->src_address, unformat_pg_edit, unformat_ip4_address, &p->dst_address)) goto found; if (!unformat (input, "%U:", unformat_pg_edit, unformat_ip_protocol, &p->protocol)) goto error; found: /* Parse options. */ while (1) { if (unformat (input, "version %U", unformat_pg_edit, unformat_pg_number, &p->ip_version)) ; else if (unformat (input, "header-length %U", unformat_pg_edit, unformat_pg_number, &p->header_length)) ; else if (unformat (input, "tos %U", unformat_pg_edit, unformat_pg_number, &p->tos)) ; else if (unformat (input, "length %U", unformat_pg_edit, unformat_pg_number, &p->length)) ; else if (unformat (input, "checksum %U", unformat_pg_edit, unformat_pg_number, &p->checksum)) ; else if (unformat (input, "ttl %U", unformat_pg_edit, unformat_pg_number, &p->ttl)) ; else if (unformat (input, "fragment id %U offset %U", unformat_pg_edit, unformat_pg_number, &p->fragment_id, unformat_pg_edit, unformat_pg_number, &p->fragment_offset)) { int i; for (i = 0; i < ARRAY_LEN (p->fragment_offset.values); i++) pg_edit_set_value (&p->fragment_offset, i, pg_edit_get_value (&p->fragment_offset, i) / 8); } /* Flags. */ else if (unformat (input, "mf") || unformat (input, "MF")) pg_edit_set_fixed (&p->mf_flag, 1); else if (unformat (input, "df") || unformat (input, "DF")) pg_edit_set_fixed (&p->df_flag, 1); else if (unformat (input, "ce") || unformat (input, "CE")) pg_edit_set_fixed (&p->ce_flag, 1); /* Can't parse input: try next protocol level. */ else break; } { ip_main_t *im = &ip_main; ip_protocol_t protocol; ip_protocol_info_t *pi; pi = 0; if (p->protocol.type == PG_EDIT_FIXED) { protocol = pg_edit_get_value (&p->protocol, PG_EDIT_LO); pi = ip_get_protocol_info (im, protocol); } if (pi && pi->unformat_pg_edit && unformat_user (input, pi->unformat_pg_edit, s)) ; else if (!unformat_user (input, unformat_pg_payload, s)) goto error; if (p->length.type == PG_EDIT_UNSPECIFIED && s->min_packet_bytes == s->max_packet_bytes && group_index + 1 < vec_len (s->edit_groups)) { pg_edit_set_fixed (&p->length, pg_edit_group_n_bytes (s, group_index)); } /* Compute IP header checksum if all edits are fixed. */ if (p->checksum.type == PG_EDIT_UNSPECIFIED) { ip4_header_t fixed_header, fixed_mask, cmp_mask; /* See if header is all fixed and specified except for checksum field. */ clib_memset (&cmp_mask, ~0, sizeof (cmp_mask)); cmp_mask.checksum = 0; pg_edit_group_get_fixed_packet_data (s, group_index, &fixed_header, &fixed_mask); if (!memcmp (&fixed_mask, &cmp_mask, sizeof (cmp_mask))) pg_edit_set_fixed (&p->checksum, clib_net_to_host_u16 (ip4_header_checksum (&fixed_header))); } p = pg_get_edit_group (s, group_index); if (p->length.type == PG_EDIT_UNSPECIFIED || p->checksum.type == PG_EDIT_UNSPECIFIED) { pg_edit_group_t *g = pg_stream_get_group (s, group_index); g->edit_function = ip4_pg_edit_function; g->edit_function_opaque = 0; if (p->length.type == PG_EDIT_UNSPECIFIED) g->edit_function_opaque |= IP4_PG_EDIT_LENGTH; if (p->checksum.type == PG_EDIT_UNSPECIFIED) g->edit_function_opaque |= IP4_PG_EDIT_CHECKSUM; } return 1; } error: /* Free up any edits we may have added. */ pg_free_edit_group (s); return 0; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */