Compare commits
33 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f13bac295d | ||
|
67d7825149 | ||
|
0eacf49ffa | ||
|
1247ece8d2 | ||
|
1c986cb3b8 | ||
|
5e150a06a8 | ||
|
cba3675fab | ||
|
a7effa1b07 | ||
|
92b15bcea4 | ||
|
a1a382bb2b | ||
|
9d21268d0a | ||
|
7722efe8cd | ||
|
1eb970d160 | ||
|
1539400f14 | ||
|
7f5bec647c | ||
|
ec941ecb86 | ||
|
d8a998e74b | ||
|
977b0a5bd7 | ||
|
bbdfeaebf2 | ||
|
9a5e61d775 | ||
|
fd66de0f31 | ||
|
d01f4e76bd | ||
|
c287cd550b | ||
|
f453a10cd4 | ||
|
2b97ac55ed | ||
|
12bf52bae2 | ||
|
eeafbef61d | ||
|
43ad007a0c | ||
|
37aa1ffae6 | ||
|
848b47c70e | ||
|
72247c8032 | ||
|
1f720c3b19 | ||
|
8c2bacde4f |
@ -2,3 +2,4 @@
|
||||
host=gerrit.fd.io
|
||||
port=29418
|
||||
project=vpp
|
||||
defaultbranch=stable/1801
|
||||
|
466
RELEASE.md
466
RELEASE.md
File diff suppressed because it is too large
Load Diff
@ -48,10 +48,13 @@ endif
|
||||
|
||||
vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
vpp_debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
|
||||
vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
vpp_TAG_CXXFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
|
||||
vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
|
@ -245,6 +245,8 @@ tag_var_with_added_space_fn = $(if $($(TAG)_TAG_$(1)),$($(TAG)_TAG_$(1)) )
|
||||
# TAG=debug for debugging
|
||||
debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
|
||||
@ -537,6 +539,8 @@ configure_ldflags_fn = \
|
||||
CONFIGURE_ENV = \
|
||||
$(if $(call configure_var_fn,CPPFLAGS), \
|
||||
CPPFLAGS="$(CPPFLAGS) $(call configure_var_fn,CPPFLAGS)") \
|
||||
$(if $(call configure_var_fn,CXXFLAGS), \
|
||||
CXXFLAGS="$(CXXFLAGS) $(call configure_var_fn,CXXFLAGS)") \
|
||||
$(if $(call configure_var_fn,CFLAGS), \
|
||||
CFLAGS="$(CFLAGS) $(call configure_var_fn,CFLAGS)") \
|
||||
$(if $(call configure_var_fn,CCASFLAGS), \
|
||||
|
@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo oper-171218
|
||||
echo rls1801
|
||||
|
@ -3,6 +3,7 @@ Test Framework Documentation {#test_framework_doc}
|
||||
|
||||
PyDoc generated documentation for the "make test" framework is available for the following releases
|
||||
|
||||
- [Test framework documentation for VPP 18.01](https://docs.fd.io/vpp/18.01/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 17.10](https://docs.fd.io/vpp/17.10/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 17.04](https://docs.fd.io/vpp/17.04/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 17.01](https://docs.fd.io/vpp/17.01/vpp_make_test/html)
|
||||
|
@ -17,3 +17,5 @@ Several modules provide operational, dataplane-user focused documentation.
|
||||
- @subpage srv6_doc
|
||||
- @subpage srmpls_doc
|
||||
- @subpage nat64_doc
|
||||
- @subpage vcl_ldpreload_doc
|
||||
- @subpage kp_plugin_doc
|
||||
|
@ -15,7 +15,9 @@
|
||||
*------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file */
|
||||
/** @file
|
||||
* @defgroup libmemif
|
||||
*/
|
||||
|
||||
#ifndef _LIBMEMIF_H_
|
||||
#define _LIBMEMIF_H_
|
||||
@ -78,7 +80,7 @@ typedef enum
|
||||
|
||||
/**
|
||||
* @defgroup MEMIF_FD_EVENT Types of events that need to be watched for specific fd.
|
||||
*
|
||||
* @ingroup libmemif
|
||||
* @{
|
||||
*/
|
||||
|
||||
@ -99,6 +101,7 @@ typedef enum
|
||||
typedef void *memif_conn_handle_t;
|
||||
/**
|
||||
* @defgroup CALLBACKS Callback functions definitions
|
||||
* @ingroup libmemif
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
@ -135,6 +138,7 @@ typedef int (memif_interrupt_t) (memif_conn_handle_t conn, void *private_ctx,
|
||||
|
||||
/**
|
||||
* @defgroup ARGS_N_BUFS Connection arguments and buffers
|
||||
* @ingroup libmemif
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
@ -193,6 +197,7 @@ typedef struct
|
||||
|
||||
/**
|
||||
* @defgroup MEMIF_DETAILS Memif details structs
|
||||
* @ingroup libmemif
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
@ -256,6 +261,7 @@ typedef struct
|
||||
|
||||
/**
|
||||
* @defgroup API_CALLS Api calls
|
||||
* @ingroup libmemif
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
15
extras/scripts/list_api_changes.py
Executable file
15
extras/scripts/list_api_changes.py
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
import os, fnmatch, subprocess
|
||||
starttag = 'v18.01-rc0'
|
||||
endtag = 'v18.01-rc2'
|
||||
apifiles = []
|
||||
for root, dirnames, filenames in os.walk('.'):
|
||||
for filename in fnmatch.filter(filenames, '*.api'):
|
||||
apifiles.append(os.path.join(root, filename))
|
||||
for f in apifiles:
|
||||
commits = subprocess.check_output(['git', 'log',
|
||||
'--oneline', starttag + '..' + endtag,
|
||||
f])
|
||||
if commits:
|
||||
print f
|
||||
print commits
|
@ -1,4 +1,4 @@
|
||||
# vcl-ldpreload a LD_PRELOAD library that uses the VPP Communications Library (VCL).
|
||||
# vcl-ldpreload: a LD_PRELOAD library that uses the VPP Communications Library (VCL). {#vcl_ldpreload_doc}
|
||||
|
||||
User can LD_PRELOAD any application that uses POSIX socket API.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
AC_INIT([vpp], [18.01], [vpp-dev@fd.io])
|
||||
AC_INIT([vpp], [18.01.1], [vpp-dev@fd.io])
|
||||
LT_INIT
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
|
@ -158,6 +158,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
|
||||
u32 iv_size;
|
||||
u16 orig_sz;
|
||||
u8 trunc_size;
|
||||
u16 rewrite_len;
|
||||
struct rte_mbuf *mb0 = 0;
|
||||
struct rte_crypto_op *op;
|
||||
u16 res_idx;
|
||||
@ -267,6 +268,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
|
||||
|
||||
if (sa0->is_tunnel)
|
||||
{
|
||||
rewrite_len = 0;
|
||||
if (!is_ipv6 && !sa0->is_tunnel_ip6) /* ip4inip4 */
|
||||
{
|
||||
/* in tunnel mode send it back to FIB */
|
||||
@ -344,7 +346,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
|
||||
else /* transport mode */
|
||||
{
|
||||
priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT;
|
||||
u16 rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
|
||||
rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
|
||||
u16 adv = sizeof (esp_header_t) + iv_size;
|
||||
vlib_buffer_advance (b0, -adv - rewrite_len);
|
||||
u8 *src = ((u8 *) ih0) - rewrite_len;
|
||||
@ -393,11 +395,13 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
|
||||
if (is_ipv6)
|
||||
{
|
||||
u16 len = b0->current_length - sizeof (ip6_header_t);
|
||||
oh6_0->ip6.payload_length = clib_host_to_net_u16 (len);
|
||||
oh6_0->ip6.payload_length =
|
||||
clib_host_to_net_u16 (len - rewrite_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
oh0->ip4.length = clib_host_to_net_u16 (b0->current_length);
|
||||
oh0->ip4.length =
|
||||
clib_host_to_net_u16 (b0->current_length - rewrite_len);
|
||||
oh0->ip4.checksum = ip4_header_checksum (&oh0->ip4);
|
||||
}
|
||||
|
||||
|
@ -97,14 +97,6 @@ format_gtpu_name (u8 * s, va_list * args)
|
||||
return format (s, "gtpu_tunnel%d", dev_instance);
|
||||
}
|
||||
|
||||
static uword
|
||||
dummy_interface_tx (vlib_main_t * vm,
|
||||
vlib_node_runtime_t * node, vlib_frame_t * frame)
|
||||
{
|
||||
clib_warning ("you shouldn't be here, leaking buffers...");
|
||||
return frame->n_vectors;
|
||||
}
|
||||
|
||||
static clib_error_t *
|
||||
gtpu_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
|
||||
{
|
||||
@ -120,7 +112,6 @@ VNET_DEVICE_CLASS (gtpu_device_class,static) = {
|
||||
.name = "GTPU",
|
||||
.format_device_name = format_gtpu_name,
|
||||
.format_tx_trace = format_gtpu_encap_trace,
|
||||
.tx_function = dummy_interface_tx,
|
||||
.admin_up_down_function = gtpu_interface_admin_up_down,
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
@ -294,25 +285,6 @@ gtpu_decap_next_is_valid (gtpu_main_t * gtm, u32 is_ip6, u32 decap_next_index)
|
||||
return decap_next_index < r->n_next_nodes;
|
||||
}
|
||||
|
||||
static void
|
||||
hash_set_key_copy (uword ** h, void *key, uword v)
|
||||
{
|
||||
size_t ksz = hash_header (*h)->user;
|
||||
void *copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_unset_key_free (uword ** h, void *key)
|
||||
{
|
||||
hash_pair_t *hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
static uword
|
||||
vtep_addr_ref (ip46_address_t * ip)
|
||||
{
|
||||
@ -323,7 +295,7 @@ vtep_addr_ref (ip46_address_t * ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_set (gtpu_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (>pu_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (>pu_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -338,7 +310,7 @@ vtep_addr_unref (ip46_address_t * ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_unset (gtpu_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (>pu_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (>pu_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -370,7 +342,7 @@ mcast_shared_add (ip46_address_t * dst, fib_node_index_t mfei, adj_index_t ai)
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (>pu_main.mcast_shared, dst, new_ep.as_u64);
|
||||
hash_set_mem_alloc (>pu_main.mcast_shared, dst, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -381,7 +353,7 @@ mcast_shared_remove (ip46_address_t * dst)
|
||||
adj_unlock (ep.mcast_adj_index);
|
||||
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GTPU);
|
||||
|
||||
hash_unset_key_free (>pu_main.mcast_shared, dst);
|
||||
hash_unset_mem_free (>pu_main.mcast_shared, dst);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -442,8 +414,8 @@ int vnet_gtpu_add_del_tunnel
|
||||
|
||||
/* copy the key */
|
||||
if (is_ip6)
|
||||
hash_set_key_copy (>m->gtpu6_tunnel_by_key, &key6,
|
||||
t - gtm->tunnels);
|
||||
hash_set_mem_alloc (>m->gtpu6_tunnel_by_key, &key6,
|
||||
t - gtm->tunnels);
|
||||
else
|
||||
hash_set (gtm->gtpu4_tunnel_by_key, key4.as_u64, t - gtm->tunnels);
|
||||
|
||||
@ -481,6 +453,11 @@ int vnet_gtpu_add_del_tunnel
|
||||
hi = vnet_get_hw_interface (vnm, hw_if_index);
|
||||
}
|
||||
|
||||
/* Set gtpu tunnel output node */
|
||||
u32 encap_index = !is_ip6 ?
|
||||
gtpu4_encap_node.index : gtpu6_encap_node.index;
|
||||
vnet_set_interface_output_node (vnm, hw_if_index, encap_index);
|
||||
|
||||
t->hw_if_index = hw_if_index;
|
||||
t->sw_if_index = sw_if_index = hi->sw_if_index;
|
||||
|
||||
@ -500,8 +477,6 @@ int vnet_gtpu_add_del_tunnel
|
||||
|
||||
fib_node_init (&t->node, gtm->fib_node_type);
|
||||
fib_prefix_t tun_dst_pfx;
|
||||
u32 encap_index = !is_ip6 ?
|
||||
gtpu4_encap_node.index : gtpu6_encap_node.index;
|
||||
vnet_flood_class_t flood_class = VNET_FLOOD_CLASS_TUNNEL_NORMAL;
|
||||
|
||||
fib_prefix_from_ip46_addr (&t->dst, &tun_dst_pfx);
|
||||
@ -592,9 +567,6 @@ int vnet_gtpu_add_del_tunnel
|
||||
flood_class = VNET_FLOOD_CLASS_TUNNEL_MASTER;
|
||||
}
|
||||
|
||||
/* Set gtpu tunnel output node */
|
||||
hi->output_node_index = encap_index;
|
||||
|
||||
vnet_get_sw_interface (vnet_get_main (), sw_if_index)->flood_class =
|
||||
flood_class;
|
||||
}
|
||||
@ -621,7 +593,7 @@ int vnet_gtpu_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (gtm->gtpu4_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (>m->gtpu6_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (>m->gtpu6_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast (&t->dst))
|
||||
{
|
||||
|
@ -1462,14 +1462,10 @@ ixge_rx_queue_no_wrap (ixge_main_t * xm,
|
||||
to_add -= 2;
|
||||
|
||||
#if 0
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, bi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, bi1));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, fi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, fi1));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi1));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi1));
|
||||
#endif
|
||||
|
||||
b0 = vlib_get_buffer (vm, bi0);
|
||||
@ -1680,10 +1676,8 @@ ixge_rx_queue_no_wrap (ixge_main_t * xm,
|
||||
to_add -= 1;
|
||||
|
||||
#if 0
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, bi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
|
||||
vlib_buffer_is_known (vm, fi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi0));
|
||||
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi0));
|
||||
#endif
|
||||
|
||||
b0 = vlib_get_buffer (vm, bi0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Kube-proxy plugin for VPP
|
||||
# Kube-proxy plugin for VPP {#kp_plugin_doc}
|
||||
|
||||
## Overview
|
||||
|
||||
|
@ -136,12 +136,12 @@ l2_emulation_cli (vlib_main_t * vm,
|
||||
}
|
||||
|
||||
/*?
|
||||
* Configure l2 emualtion.
|
||||
* Configure l2 emulation.
|
||||
* When the interface is in L2 mode, configure the extraction of L3
|
||||
* packets out of the L2 path and into the L3 path.
|
||||
*
|
||||
* @cliexpar
|
||||
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]
|
||||
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]}
|
||||
* @cliexend
|
||||
?*/
|
||||
/* *INDENT-OFF* */
|
||||
@ -179,7 +179,7 @@ l2_emulation_show (vlib_main_t * vm,
|
||||
* packets out of the L2 path and into the L3 path.
|
||||
*
|
||||
* @cliexpar
|
||||
* @cliexstart{show interface l2 l2-emulation
|
||||
* @cliexstart{show interface l2 l2-emulation}
|
||||
* @cliexend
|
||||
?*/
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -1582,7 +1582,7 @@ int snat_set_workers (uword * bitmap)
|
||||
clib_bitmap_foreach (i, bitmap,
|
||||
({
|
||||
vec_add1(sm->workers, i);
|
||||
sm->per_thread_data[i].snat_thread_index = j;
|
||||
sm->per_thread_data[sm->first_worker_index + i].snat_thread_index = j;
|
||||
j++;
|
||||
}));
|
||||
|
||||
@ -2726,6 +2726,7 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
|
||||
snat_session_t *s;
|
||||
int i;
|
||||
u32 proto;
|
||||
u32 next_worker_index = 0;
|
||||
|
||||
/* first try static mappings without port */
|
||||
if (PREDICT_FALSE (pool_elts (sm->static_mappings)))
|
||||
@ -2841,7 +2842,10 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
|
||||
}
|
||||
|
||||
/* worker by outside port */
|
||||
return (u32) ((clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread);
|
||||
next_worker_index = sm->first_worker_index;
|
||||
next_worker_index +=
|
||||
sm->workers[(clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread];
|
||||
return next_worker_index;
|
||||
}
|
||||
|
||||
static clib_error_t *
|
||||
|
@ -202,7 +202,7 @@ nat64_get_worker_out2in (ip4_header_t * ip)
|
||||
/* worker by outside port (TCP/UDP) */
|
||||
port = clib_net_to_host_u16 (port);
|
||||
if (port > 1024)
|
||||
return (u32) ((port - 1024) / sm->port_per_thread);
|
||||
return nm->sm->first_worker_index + ((port - 1024) / sm->port_per_thread);
|
||||
|
||||
return vlib_get_thread_index ();
|
||||
}
|
||||
@ -232,6 +232,8 @@ nat64_init (vlib_main_t * vm)
|
||||
nm->tcp_est_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT;
|
||||
nm->tcp_incoming_syn_timeout = SNAT_TCP_INCOMING_SYN;
|
||||
|
||||
nm->total_enabled_count = 0;
|
||||
|
||||
/* Set up the interface address add/del callback */
|
||||
cb4.function = nat64_ip4_add_del_interface_address_cb;
|
||||
cb4.function_opaque = 0;
|
||||
@ -430,6 +432,12 @@ nat64_add_del_interface (u32 sw_if_index, u8 is_inside, u8 is_add)
|
||||
interface->flags |= NAT_INTERFACE_FLAG_IS_INSIDE;
|
||||
else
|
||||
interface->flags |= NAT_INTERFACE_FLAG_IS_OUTSIDE;
|
||||
|
||||
nm->total_enabled_count++;
|
||||
vlib_process_signal_event (nm->sm->vlib_main,
|
||||
nm->nat64_expire_walk_node_index,
|
||||
NAT64_CLEANER_RESCHEDULE, 0);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -443,6 +451,8 @@ nat64_add_del_interface (u32 sw_if_index, u8 is_inside, u8 is_add)
|
||||
~NAT_INTERFACE_FLAG_IS_OUTSIDE;
|
||||
else
|
||||
pool_put (nm->interfaces, interface);
|
||||
|
||||
nm->total_enabled_count--;
|
||||
}
|
||||
|
||||
if (!is_inside)
|
||||
@ -497,13 +507,17 @@ nat64_alloc_out_addr_and_port (u32 fib_index, snat_protocol_t proto,
|
||||
snat_main_t *sm = nm->sm;
|
||||
snat_session_key_t k;
|
||||
u32 ai;
|
||||
u32 worker_index = 0;
|
||||
int rv;
|
||||
|
||||
k.protocol = proto;
|
||||
|
||||
if (sm->num_workers > 1)
|
||||
worker_index = thread_index - sm->first_worker_index;
|
||||
|
||||
rv =
|
||||
sm->alloc_addr_and_port (nm->addr_pool, fib_index, thread_index, &k, &ai,
|
||||
sm->port_per_thread, thread_index);
|
||||
sm->port_per_thread, worker_index);
|
||||
|
||||
if (!rv)
|
||||
{
|
||||
@ -1160,6 +1174,8 @@ VLIB_REGISTER_NODE (nat64_expire_worker_walk_node, static) = {
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static vlib_node_registration_t nat64_expire_walk_node;
|
||||
|
||||
/**
|
||||
* @brief Centralized process to drive per worker expire walk.
|
||||
*/
|
||||
@ -1167,8 +1183,12 @@ static uword
|
||||
nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
vlib_frame_t * f)
|
||||
{
|
||||
nat64_main_t *nm = &nat64_main;
|
||||
vlib_main_t **worker_vms = 0, *worker_vm;
|
||||
int i;
|
||||
uword event_type, *event_data = 0;
|
||||
|
||||
nm->nat64_expire_walk_node_index = nat64_expire_walk_node.index;
|
||||
|
||||
if (vec_len (vlib_mains) == 0)
|
||||
vec_add1 (worker_vms, vm);
|
||||
@ -1184,8 +1204,28 @@ nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
|
||||
while (1)
|
||||
{
|
||||
vlib_process_wait_for_event_or_clock (vm, 10.0);
|
||||
vlib_process_get_events (vm, NULL);
|
||||
if (nm->total_enabled_count)
|
||||
{
|
||||
vlib_process_wait_for_event_or_clock (vm, 10.0);
|
||||
event_type = vlib_process_get_events (vm, &event_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
vlib_process_wait_for_event (vm);
|
||||
event_type = vlib_process_get_events (vm, &event_data);
|
||||
}
|
||||
|
||||
switch (event_type)
|
||||
{
|
||||
case ~0:
|
||||
break;
|
||||
case NAT64_CLEANER_RESCHEDULE:
|
||||
break;
|
||||
default:
|
||||
clib_warning ("unknown event %u", event_type);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < vec_len (worker_vms); i++)
|
||||
{
|
||||
worker_vm = worker_vms[i];
|
||||
@ -1197,8 +1237,6 @@ nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static vlib_node_registration_t nat64_expire_walk_node;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
VLIB_REGISTER_NODE (nat64_expire_walk_node, static) = {
|
||||
.function = nat64_expire_walk_fn,
|
||||
|
@ -39,6 +39,11 @@ typedef enum
|
||||
#undef _
|
||||
} nat64_tcp_ses_state_t;
|
||||
|
||||
enum
|
||||
{
|
||||
NAT64_CLEANER_RESCHEDULE = 1,
|
||||
} nat64_cleaner_process_event_e;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ip6_address_t prefix;
|
||||
@ -99,6 +104,11 @@ typedef struct
|
||||
u32 tcp_est_timeout;
|
||||
u32 tcp_incoming_syn_timeout;
|
||||
|
||||
/* Total count of interfaces enabled */
|
||||
u32 total_enabled_count;
|
||||
/* The process node which orcherstrates the cleanup */
|
||||
u32 nat64_expire_walk_node_index;
|
||||
|
||||
ip4_main_t *ip4_main;
|
||||
snat_main_t *sm;
|
||||
} nat64_main_t;
|
||||
|
@ -150,10 +150,11 @@ pppoe_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0)
|
||||
{
|
||||
pppoe_header_t *pppoe0;
|
||||
|
||||
pppoe0 = vlib_buffer_get_current (b0);
|
||||
pppoe0 = vlib_buffer_get_current (b0) + sizeof (ethernet_header_t);
|
||||
|
||||
pppoe0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0)
|
||||
- sizeof (pppoe_header_t)
|
||||
+ sizeof (pppoe0->ppp_proto)
|
||||
- sizeof (ethernet_header_t));
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ vlib_validate_buffer_helper (vlib_main_t * vm,
|
||||
vlib_buffer_known_state_t k;
|
||||
u8 *msg, *result;
|
||||
|
||||
k = vlib_buffer_is_known (vm, b->next_buffer);
|
||||
k = vlib_buffer_is_known (b->next_buffer);
|
||||
if (k != VLIB_BUFFER_KNOWN_ALLOCATED)
|
||||
return format (0, "next 0x%x: %U",
|
||||
b->next_buffer, format_vlib_buffer_known_state, k);
|
||||
@ -243,7 +243,7 @@ vlib_validate_buffers (vlib_main_t * vm,
|
||||
goto done;
|
||||
}
|
||||
|
||||
k = vlib_buffer_is_known (vm, bi);
|
||||
k = vlib_buffer_is_known (bi);
|
||||
if (k != known_state)
|
||||
{
|
||||
msg = format (0, "is %U; expected %U",
|
||||
@ -317,7 +317,7 @@ vlib_buffer_validate_alloc_free (vlib_main_t * vm,
|
||||
|
||||
bi = b[0];
|
||||
b += 1;
|
||||
known = vlib_buffer_is_known (vm, bi);
|
||||
known = vlib_buffer_is_known (bi);
|
||||
if (known != expected_state)
|
||||
{
|
||||
ASSERT (0);
|
||||
@ -328,8 +328,7 @@ vlib_buffer_validate_alloc_free (vlib_main_t * vm,
|
||||
}
|
||||
|
||||
vlib_buffer_set_known_state
|
||||
(vm, bi,
|
||||
is_free ? VLIB_BUFFER_KNOWN_FREE : VLIB_BUFFER_KNOWN_ALLOCATED);
|
||||
(bi, is_free ? VLIB_BUFFER_KNOWN_FREE : VLIB_BUFFER_KNOWN_ALLOCATED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -580,7 +579,7 @@ vlib_buffer_fill_free_list_internal (vlib_main_t * vm,
|
||||
bi[i] = vlib_get_buffer_index (vm, b);
|
||||
|
||||
if (CLIB_DEBUG > 0)
|
||||
vlib_buffer_set_known_state (vm, bi[i], VLIB_BUFFER_KNOWN_FREE);
|
||||
vlib_buffer_set_known_state (bi[i], VLIB_BUFFER_KNOWN_FREE);
|
||||
b = vlib_buffer_next_contiguous (b, fl->n_data_bytes);
|
||||
}
|
||||
|
||||
|
@ -222,9 +222,9 @@ void vlib_buffer_validate_alloc_free (vlib_main_t * vm, u32 * buffers,
|
||||
expected_state);
|
||||
|
||||
always_inline vlib_buffer_known_state_t
|
||||
vlib_buffer_is_known (vlib_main_t * vm, u32 buffer_index)
|
||||
vlib_buffer_is_known (u32 buffer_index)
|
||||
{
|
||||
vlib_buffer_main_t *bm = vm->buffer_main;
|
||||
vlib_buffer_main_t *bm = vlib_global_main.buffer_main;
|
||||
|
||||
clib_spinlock_lock (&bm->buffer_known_hash_lockp);
|
||||
uword *p = hash_get (bm->buffer_known_hash, buffer_index);
|
||||
@ -233,11 +233,11 @@ vlib_buffer_is_known (vlib_main_t * vm, u32 buffer_index)
|
||||
}
|
||||
|
||||
always_inline void
|
||||
vlib_buffer_set_known_state (vlib_main_t * vm,
|
||||
u32 buffer_index,
|
||||
vlib_buffer_set_known_state (u32 buffer_index,
|
||||
vlib_buffer_known_state_t state)
|
||||
{
|
||||
vlib_buffer_main_t *bm = vm->buffer_main;
|
||||
vlib_buffer_main_t *bm = vlib_global_main.buffer_main;
|
||||
|
||||
clib_spinlock_lock (&bm->buffer_known_hash_lockp);
|
||||
hash_set (bm->buffer_known_hash, buffer_index, state);
|
||||
clib_spinlock_unlock (&bm->buffer_known_hash_lockp);
|
||||
|
@ -350,7 +350,7 @@ vl_api_bier_imp_add_t_handler (vl_api_bier_imp_add_t * mp)
|
||||
/* *INDENT-OFF* */
|
||||
REPLY_MACRO2 (VL_API_BIER_IMP_ADD_REPLY,
|
||||
({
|
||||
rmp->bi_index = bii;
|
||||
rmp->bi_index = ntohl (bii);
|
||||
}));
|
||||
/* *INDENT-OM* */
|
||||
}
|
||||
|
@ -239,6 +239,7 @@ show_bier_bift_cmd (vlib_main_t * vm,
|
||||
if (NULL == bier_bift_table)
|
||||
{
|
||||
vlib_cli_output(vm, "no BIFT entries");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (~0 == set)
|
||||
|
@ -390,7 +390,7 @@ error:
|
||||
close (vif->tap_fd);
|
||||
if (vif->fd != -1)
|
||||
close (vif->fd);
|
||||
vec_foreach_index (i, vif->vrings) virtio_vring_free (vif, i);
|
||||
vec_foreach_index (i, vif->vrings) virtio_vring_free (vm, vif, i);
|
||||
memset (vif, 0, sizeof (virtio_if_t));
|
||||
pool_put (vim->interfaces, vif);
|
||||
|
||||
@ -429,7 +429,7 @@ tap_delete_if (vlib_main_t * vm, u32 sw_if_index)
|
||||
if (vif->fd != -1)
|
||||
close (vif->fd);
|
||||
|
||||
vec_foreach_index (i, vif->vrings) virtio_vring_free (vif, i);
|
||||
vec_foreach_index (i, vif->vrings) virtio_vring_free (vm, vif, i);
|
||||
vec_free (vif->vrings);
|
||||
|
||||
hash_unset (tm->dev_instance_by_interface_id, vif->id);
|
||||
|
@ -88,7 +88,7 @@ format_virtio_tx_trace (u8 * s, va_list * args)
|
||||
return s;
|
||||
}
|
||||
|
||||
static_always_inline void
|
||||
inline void
|
||||
virtio_free_used_desc (vlib_main_t * vm, virtio_vring_t * vring)
|
||||
{
|
||||
u16 used = vring->desc_in_use;
|
||||
|
@ -134,20 +134,41 @@ error:
|
||||
return err;
|
||||
}
|
||||
|
||||
clib_error_t *
|
||||
virtio_vring_free (virtio_if_t * vif, u32 idx)
|
||||
static_always_inline void
|
||||
virtio_free_rx_buffers (vlib_main_t * vm, virtio_vring_t * vring)
|
||||
{
|
||||
u16 used = vring->desc_in_use;
|
||||
u16 next = vring->desc_next;
|
||||
u16 mask = vring->size - 1;
|
||||
|
||||
while (used)
|
||||
{
|
||||
vlib_buffer_free (vm, &vring->buffers[next], 1);
|
||||
next = (next + 1) & mask;
|
||||
used--;
|
||||
}
|
||||
}
|
||||
|
||||
clib_error_t *
|
||||
virtio_vring_free (vlib_main_t * vm, virtio_if_t * vif, u32 idx)
|
||||
{
|
||||
//TODO free buffers and indirect descriptor allocs
|
||||
virtio_vring_t *vring = vec_elt_at_index (vif->vrings, idx);
|
||||
|
||||
clib_file_del_by_index (&file_main, vring->call_file_index);
|
||||
close (vring->kick_fd);
|
||||
close (vring->call_fd);
|
||||
if (vring->used)
|
||||
{
|
||||
if ((idx & 1) == 1)
|
||||
virtio_free_used_desc (vm, vring);
|
||||
else
|
||||
virtio_free_rx_buffers (vm, vring);
|
||||
clib_mem_free (vring->used);
|
||||
}
|
||||
if (vring->desc)
|
||||
clib_mem_free (vring->desc);
|
||||
if (vring->avail)
|
||||
clib_mem_free (vring->avail);
|
||||
if (vring->used)
|
||||
clib_mem_free (vring->used);
|
||||
clib_file_del_by_index (&file_main, vring->call_file_index);
|
||||
close (vring->kick_fd);
|
||||
close (vring->call_fd);
|
||||
vec_free (vring->buffers);
|
||||
return 0;
|
||||
}
|
||||
|
@ -128,7 +128,9 @@ extern vlib_node_registration_t virtio_input_node;
|
||||
|
||||
clib_error_t *virtio_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 idx,
|
||||
u16 sz);
|
||||
clib_error_t *virtio_vring_free (virtio_if_t * vif, u32 idx);
|
||||
clib_error_t *virtio_vring_free (vlib_main_t * vm, virtio_if_t * vif,
|
||||
u32 idx);
|
||||
extern void virtio_free_used_desc (vlib_main_t * vm, virtio_vring_t * vring);
|
||||
|
||||
#endif /* _VNET_DEVICES_VIRTIO_VIRTIO_H_ */
|
||||
|
||||
|
@ -1123,6 +1123,12 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
|
||||
&arp0->ip4_over_ethernet[0]);
|
||||
goto drop1;
|
||||
}
|
||||
else if (arp0->opcode ==
|
||||
clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request) &&
|
||||
(dst_is_local0 == 0))
|
||||
{
|
||||
goto drop1;
|
||||
}
|
||||
|
||||
send_reply:
|
||||
/* Send a reply.
|
||||
|
@ -737,29 +737,26 @@ int
|
||||
vnet_delete_sub_interface (u32 sw_if_index)
|
||||
{
|
||||
vnet_main_t *vnm = vnet_get_main ();
|
||||
vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
|
||||
int rv = 0;
|
||||
|
||||
if (pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index))
|
||||
return VNET_API_ERROR_INVALID_SW_IF_INDEX;
|
||||
|
||||
|
||||
vnet_interface_main_t *im = &vnm->interface_main;
|
||||
vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
|
||||
|
||||
if (si->type == VNET_SW_INTERFACE_TYPE_SUB ||
|
||||
si->type == VNET_SW_INTERFACE_TYPE_P2P)
|
||||
{
|
||||
vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
|
||||
vnet_interface_main_t *im = &vnm->interface_main;
|
||||
vnet_hw_interface_t *hi = vnet_get_sup_hw_interface (vnm, sw_if_index);
|
||||
u64 sup_and_sub_key =
|
||||
((u64) (si->sup_sw_if_index) << 32) | (u64) si->sub.id;
|
||||
|
||||
hash_unset_mem (im->sw_if_index_by_sup_and_sub, &sup_and_sub_key);
|
||||
hash_unset_mem_free (&im->sw_if_index_by_sup_and_sub, &sup_and_sub_key);
|
||||
hash_unset (hi->sub_interface_sw_if_index_by_id, si->sub.id);
|
||||
vnet_delete_sw_interface (vnm, sw_if_index);
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = VNET_API_ERROR_INVALID_SUB_SW_IF_INDEX;
|
||||
}
|
||||
rv = VNET_API_ERROR_INVALID_SUB_SW_IF_INDEX;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user