summaryrefslogtreecommitdiffstats
path: root/src/vnet/dpo
AgeCommit message (Expand)AuthorFilesLines
2019-06-06DVR: Control the reinject as L2 or L3 based on the output interface typeNeale Ranns2-10/+83
2019-05-16init / exit function orderingDave Barach1-4/+9
2019-04-08fixing typosJim Thompson1-1/+1
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra2-6/+6
2019-03-11dpo: migrate old MULTIARCH macros to VLIB_NODE_FNFilip Tehlar5-157/+51
2019-02-14Add -fno-common compile optionBenoƮt Ganne6-4/+8
2018-12-18MFIB: recurse resolution through an MFIB entryNeale Ranns4-0/+113
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns1-3/+3
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-3/+3
2018-11-02vlib: define minimum chained buffer segment sizeDamjan Marion1-1/+2
2018-10-23c11 safe string handling supportDave Barach8-8/+8
2018-10-16FIB: use vlib-log for debuggingNeale Ranns3-33/+39
2018-10-16Sticky Load-balanceNeale Ranns2-24/+130
2018-10-08replicate trace fixNeale Ranns1-2/+6
2018-10-01mroute routers in the stats segmentNeale Ranns1-1/+6
2018-09-20Route counters in the stats segmentNeale Ranns1-1/+10
2018-09-14BIER API and load-balancing fixesNeale Ranns1-2/+2
2018-08-30SR-MPLS: fixes and testsNeale Ranns1-1/+1
2018-08-22show command for lookup DPOsNeale Ranns1-0/+40
2018-08-03loop counter to prevent infiinte number of look ups per-packetNeale Ranns1-1/+84
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-6/+3
2018-07-11avoid using thread local storage for thread indexDamjan Marion1-1/+1
2018-06-26node functions cannot be always_inlineDamjan Marion1-10/+10
2018-05-26Fix interface-rx-dpo-l2 node to setup l2_len in vnet bufferJohn Lo1-4/+16
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach9-0/+53
2018-04-24memory leakKingwel Xie1-0/+3
2018-04-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-10/+1
2018-04-09DVR: save the rewrite length in packet meta-data for featuresNeale Ranns1-3/+9
2018-03-20FIB Interpose SourceNeale Ranns5-26/+114
2018-03-19Coverity found bugs in recent MPLS changesNeale Ranns2-2/+2
2018-03-19FIX: Fixed ip6_fib_dump api function response.Dmitry Vakhrushev2-0/+8
2018-03-15Add a helper function to fetch vlib node index for already stacked dposVijayabhaskar Katamreddy2-0/+40
2018-03-09MPLS Unifom modeNeale Ranns5-329/+1150
2018-03-05IP6 link-local tableNeale Ranns4-0/+245
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-6/+6
2018-02-06BIER: fix support for longer bit-string lengthsNeale Ranns1-1/+2
2018-01-09DVR: run L3 output featuresNeale Ranns6-436/+661
2017-12-20L2 EmulationNeale Ranns1-1/+1
2017-12-09BIER in non-MPLS netowrksNeale Ranns2-0/+11
2017-12-06Label stack size exceeded fixNeale Ranns2-1/+19
2017-11-14NULL-terminate load_balance_nsh_nodes[]Gabriel Ganne1-0/+1
2017-11-09BIERNeale Ranns5-12/+86
2017-11-03NAT64: Input feature arc on virtual interface via interface RX DPO.Ole Troan2-2/+2
2017-10-31Refactor IP input checks for re-use at MPLS dispositionNeale Ranns1-20/+54
2017-10-25L3 proxy FIB source for container networkingAndrew Yourtchenko4-3/+270
2017-10-14change format_get_indent() to use u32 instead of uwordGabriel Ganne1-1/+1
2017-10-14Source Lookup progammable via APINeale Ranns1-2/+2
2017-10-05Distributed Virtual Router SupportNeale Ranns4-1/+436
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine5-8/+8
2017-09-11FIB table add/delete APINeale Ranns2-8/+24
n> const dpo_id_t *sd_dpo; sixrd_dpo_t *sd; ASSERT(DPO_LOAD_BALANCE == dpo.dpoi_type); sd_dpo = load_balance_get_bucket(dpo.dpoi_index, 0); sd = sixrd_dpo_get (sd_dpo->dpoi_index); sd->sd_domain = ~0; dpo_copy (&dpo_v4, sd_dpo); dpo_reset (&dpo); goto route_add; } } /* first time addition of the route */ sixrd_dpo_create(FIB_PROTOCOL_IP4, *sixrd_domain_index, &dpo_v4); route_add: /* * Create ip4 route. This is a reference counted add. If the prefix * already exists and is SixRD sourced, it is now SixRD source n+1 times * and will need to be removed n+1 times. */ fib_table_entry_special_dpo_add(0, &pfx4, FIB_SOURCE_SIXRD, FIB_ENTRY_FLAG_EXCLUSIVE, &dpo_v4); dpo_reset (&dpo_v4); return 0; } /* * sixrd_delete_domain */ int sixrd_delete_domain (u32 sixrd_domain_index) { sixrd_main_t *mm = &sixrd_main; sixrd_domain_t *d; if (pool_is_free_index(mm->domains, sixrd_domain_index)) { clib_warning("SIXRD domain delete: domain does not exist: %d", sixrd_domain_index); return -1; } d = pool_elt_at_index(mm->domains, sixrd_domain_index); fib_prefix_t pfx = { .fp_proto = FIB_PROTOCOL_IP4, .fp_len = 32, .fp_addr = { .ip4 = d->ip4_src, }, }; fib_table_entry_special_remove(0, &pfx, FIB_SOURCE_SIXRD); fib_prefix_t pfx6 = { .fp_proto = FIB_PROTOCOL_IP6, .fp_len = d->ip6_prefix_len, .fp_addr = { .ip6 = d->ip6_prefix, }, }; fib_table_entry_special_remove(0, &pfx6, FIB_SOURCE_SIXRD); pool_put(mm->domains, d); return 0; } static clib_error_t * sixrd_add_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) { unformat_input_t _line_input, *line_input = &_line_input; ip4_address_t ip4_prefix; ip6_address_t ip6_prefix; ip4_address_t ip4_src; u32 ip6_prefix_len=0, ip4_prefix_len=0, sixrd_domain_index; u32 num_m_args = 0; /* Optional arguments */ u32 mtu = 0; /* Get a line of input. */ if (!unformat_user(input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat(line_input, "ip6-pfx %U/%d", unformat_ip6_address, &ip6_prefix, &ip6_prefix_len)) num_m_args++; else if (unformat(line_input, "ip4-pfx %U/%d", unformat_ip4_address, &ip4_prefix, &ip4_prefix_len)) num_m_args++; else if (unformat(line_input, "ip4-src %U", unformat_ip4_address, &ip4_src)) num_m_args++; else if (unformat(line_input, "mtu %d", &mtu)) num_m_args++; else return clib_error_return(0, "unknown input `%U'", format_unformat_error, input); } unformat_free(line_input); if (num_m_args < 3) return clib_error_return(0, "mandatory argument(s) missing"); sixrd_create_domain(&ip6_prefix, ip6_prefix_len, &ip4_prefix, ip4_prefix_len, &ip4_src, &sixrd_domain_index, mtu); return 0; } static clib_error_t * sixrd_del_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) { unformat_input_t _line_input, *line_input = &_line_input; u32 num_m_args = 0; u32 sixrd_domain_index; /* Get a line of input. */ if (! unformat_user(input, unformat_line_input, line_input)) return 0; while (unformat_check_input(line_input) != UNFORMAT_END_OF_INPUT) { if (unformat(line_input, "index %d", &sixrd_domain_index)) num_m_args++; else return clib_error_return(0, "unknown input `%U'", format_unformat_error, input); } unformat_free(line_input); if (num_m_args != 1) return clib_error_return(0, "mandatory argument(s) missing"); sixrd_delete_domain(sixrd_domain_index); return 0; } static u8 * format_sixrd_domain (u8 *s, va_list *args) { sixrd_domain_t *d = va_arg(*args, sixrd_domain_t *); sixrd_main_t *mm = &sixrd_main; s = format(s, "[%d] ip6-pfx %U/%d ip4-pfx %U/%d ip4-src %U mtu %d", d - mm->domains, format_ip6_address, &d->ip6_prefix, d->ip6_prefix_len, format_ip4_address, &d->ip4_prefix, d->ip4_prefix_len, format_ip4_address, &d->ip4_src, d->mtu); return s; } static clib_error_t * show_sixrd_domain_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) { sixrd_main_t *mm = &sixrd_main; sixrd_domain_t *d; if (pool_elts(mm->domains) == 0) vlib_cli_output(vm, "No SIXRD domains are configured..."); pool_foreach(d, mm->domains, ({vlib_cli_output(vm, "%U", format_sixrd_domain, d);})); return 0; } static clib_error_t * show_sixrd_stats_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) { sixrd_main_t *mm = &sixrd_main; sixrd_domain_t *d; int domains = 0, domaincount = 0; if (pool_elts (mm->domains) == 0) vlib_cli_output (vm, "No SIXRD domains are configured..."); pool_foreach(d, mm->domains, ({ domains += sizeof(*d); domaincount++; })); vlib_cli_output(vm, "SIXRD domains structure: %d\n", sizeof (sixrd_domain_t)); vlib_cli_output(vm, "SIXRD domains: %d (%d bytes)\n", domaincount, domains); return 0; } /* * packet trace format function */ u8 * format_sixrd_trace (u8 *s, va_list *args) { CLIB_UNUSED(vlib_main_t *vm) = va_arg (*args, vlib_main_t *); CLIB_UNUSED(vlib_node_t *node) = va_arg (*args, vlib_node_t *); sixrd_trace_t *t = va_arg (*args, sixrd_trace_t *); u32 sixrd_domain_index = t->sixrd_domain_index; s = format(s, "SIXRD domain index: %d", sixrd_domain_index); return s; } VLIB_CLI_COMMAND(sixrd_add_domain_command, static) = { .path = "sixrd add domain", .short_help = "sixrd add domain ip6-pfx <ip6-pfx> ip4-pfx <ip4-pfx> ip4-src <ip4-addr>", .function = sixrd_add_domain_command_fn, }; VLIB_CLI_COMMAND(sixrd_del_command, static) = { .path = "sixrd del domain", .short_help = "sixrd del domain index <domain>", .function = sixrd_del_domain_command_fn, }; VLIB_CLI_COMMAND(show_sixrd_domain_command, static) = { .path = "show sixrd domain", .function = show_sixrd_domain_command_fn, }; VLIB_CLI_COMMAND(show_sixrd_stats_command, static) = { .path = "show sixrd stats", .function = show_sixrd_stats_command_fn, }; /* * This routine exists to convince the vlib plugin framework that * we haven't accidentally copied a random .dll into the plugin directory. * * Also collects global variable pointers passed from the vpp engine */ clib_error_t * vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h, int from_early_init) { clib_error_t * error = 0; sixrd_main_t *mm = &sixrd_main; mm->vnet_main = vnet_get_main(); mm->vlib_main = vm; return error; } static clib_error_t * sixrd_init (vlib_main_t * vm) { sixrd_dpo_module_init (); return (NULL); } VLIB_INIT_FUNCTION (sixrd_init);