aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
AgeCommit message (Expand)AuthorFilesLines
2019-04-19FIB: recursion casues path reallocNeale Ranns1-1/+12
2019-04-08fixing typosJim Thompson4-11/+11
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra10-30/+30
2019-03-26FIB: do debug before remvoing last sourceNeale Ranns1-2/+2
2019-03-26ADJ: midchain delegate to performing stackingNeale Ranns1-2/+0
2019-03-22ADJ: more thorough link up checkNeale Ranns1-5/+5
2019-03-12FIB: path parsing, table-id not fib-index (VPP-1586)Neale Ranns1-1/+11
2019-03-12FIB: crash when deleting default routeNeale Ranns1-9/+0
2019-02-19VPP-1568:when entry src cover change, recursive-loop fib still can not work.mu.duojiao1-0/+9
2019-02-15FIB: pass a copy the walk contextNeale Ranns1-1/+3
2019-02-07IPSEC: no second lookup after tunnel encapNeale Ranns1-1/+3
2019-01-24add "Mtrie mheap usage" in "show ip fib memory"Lollita Liu1-2/+9
2019-01-07VOM: mroutesNeale Ranns1-0/+4
2018-12-24FIB: adj src assert fix part 2Neale Ranns1-1/+8
2018-12-23FIB: remove assert from adj srcNeale Ranns1-1/+0
2018-12-20FIB: encode the label stack in the FIB path during table dumpNeale Ranns8-16/+134
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns2-19/+22
2018-12-07FIB recusrion loop checks traverse midchain adjacenciesNeale Ranns1-2/+14
2018-12-03move [m]fib and BIER tests to unittest pluginNeale Ranns1-10551/+0
2018-10-29Fixing Exclusive dpo path issues added when via rpathVijayabhaskar Katamreddy1-4/+18
2018-10-27FIB: Sources must be keep in priority order, so re-sort after a vec_delNeale Ranns1-0/+2
2018-10-25Trivial: Cleanup missing va_ends.Paul Vinciguerra2-5/+9
2018-10-23c11 safe string handling supportDave Barach11-20/+20
2018-10-16FIB: use vlib-log for debuggingNeale Ranns11-96/+186
2018-10-16Sticky Load-balanceNeale Ranns4-16/+367
2018-10-08Adding Multipath support for exclusive DPO based fib path entries via rpathVijayabhaskar Katamreddy2-2/+16
2018-10-01Source VRF SelectNeale Ranns2-0/+34
2018-10-01mroute routers in the stats segmentNeale Ranns1-2/+2
2018-09-25FIB: recusrive paths must lock the table to prevent its deletionNeale Ranns2-0/+9
2018-09-20UDP-Encap: name counters for the stats segmentNeale Ranns1-1/+1
2018-09-20Route counters in the stats segmentNeale Ranns4-0/+31
2018-09-19GRE: fix 4o6 and 6o4 adj stackingNeale Ranns2-0/+21
2018-09-10vxlan-gbp: Add support for vxlan gbpMohsin Kazmi1-0/+2
2018-08-31FIB path CLI fix for lookup-table IDsNeale Ranns1-0/+12
2018-08-29Consolidate table->index conversion in fib-path CLI processingNeale Ranns1-1/+14
2018-08-2832/64 shmem bihash interoperabilityDave Barach1-4/+5
2018-08-27Adjacency walks protected by 'walk in progress' flagNeale Ranns1-0/+1
2018-08-27IGMP: enable command on cliNeale Ranns1-2/+1
2018-08-22IPIP and SIXRD tunnels create API needs table-IDs not fib-indexesNeale Ranns2-0/+6
2018-08-10Use IP address types on UDP encap APINeale Ranns2-0/+44
2018-07-30FIB: return entry prefix by const reference to avoid the copyNeale Ranns8-48/+31
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-0/+8
2018-07-16Adjacency-BFD: assume BFD down on createNeale Ranns1-2/+1
2018-07-10FIB path dump: fix next-hop-table ID for recursive routesNeale Ranns2-2/+3
2018-07-09IGMP improvementsNeale Ranns1-6/+0
2018-07-04IP FIB dump - incorrect table-ID for deag pathsNeale Ranns1-1/+1
2018-07-04Remove unused members from ip4_fib_tNeale Ranns2-9/+3
2018-07-04add 'src-lookup' keyword for FIB pathsNeale Ranns1-0/+4
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach5-3/+10
2018-04-30FIB: elide cover walk for insert of host routeNeale Ranns3-3/+25
)); } } while (n_packets >= 1) { u32 pi0; vlib_buffer_t *p0; ip4_header_t *ip0; ip_csum_t sum0; pi0 = packets[0]; p0 = vlib_get_buffer (vm, pi0); n_packets -= 1; packets += 1; ip0 = (void *) (p0->data + ip_header_offset); if (flags & IP4_PG_EDIT_LENGTH) ip0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, p0) - ip_header_offset); if (flags & IP4_PG_EDIT_CHECKSUM) { ASSERT (ip4_header_bytes (ip0) == sizeof (ip0[0])); ip0->checksum = 0; ip4_partial_header_checksum_x1 (ip0, sum0); ip0->checksum = ~ip_csum_fold (sum0); ASSERT (ip0->checksum == ip4_header_checksum (ip0)); } } } static void ip4_pg_edit_function (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: */