Compare commits
23 Commits
v24.02-rc2
...
v18.01
Author | SHA1 | Date | |
---|---|---|---|
|
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
|
||||
|
456
RELEASE.md
456
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 oper-rls1801-180122
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -294,25 +294,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 +304,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 +319,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 +351,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 +362,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 +423,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);
|
||||
|
||||
@ -621,7 +602,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))
|
||||
{
|
||||
|
@ -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 ();
|
||||
}
|
||||
@ -497,13 +497,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)
|
||||
{
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -288,25 +288,6 @@ geneve_decap_next_is_valid (geneve_main_t * vxm, u32 is_ip6,
|
||||
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)
|
||||
{
|
||||
@ -317,7 +298,7 @@ vtep_addr_ref (ip46_address_t * ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_set (geneve_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (&geneve_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (&geneve_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -332,7 +313,7 @@ vtep_addr_unref (ip46_address_t * ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_unset (geneve_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (&geneve_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (&geneve_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -365,7 +346,7 @@ mcast_shared_add (ip46_address_t * remote,
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (&geneve_main.mcast_shared, remote, new_ep.as_u64);
|
||||
hash_set_mem_alloc (&geneve_main.mcast_shared, remote, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -376,7 +357,7 @@ mcast_shared_remove (ip46_address_t * remote)
|
||||
adj_unlock (ep.mcast_adj_index);
|
||||
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GENEVE);
|
||||
|
||||
hash_unset_key_free (&geneve_main.mcast_shared, remote);
|
||||
hash_unset_mem_free (&geneve_main.mcast_shared, remote);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -445,8 +426,8 @@ int vnet_geneve_add_del_tunnel
|
||||
|
||||
/* copy the key */
|
||||
if (is_ip6)
|
||||
hash_set_key_copy (&vxm->geneve6_tunnel_by_key, &key6,
|
||||
t - vxm->tunnels);
|
||||
hash_set_mem_alloc (&vxm->geneve6_tunnel_by_key, &key6,
|
||||
t - vxm->tunnels);
|
||||
else
|
||||
hash_set (vxm->geneve4_tunnel_by_key, key4.as_u64, t - vxm->tunnels);
|
||||
|
||||
@ -624,7 +605,7 @@ int vnet_geneve_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (vxm->geneve4_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (&vxm->geneve6_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (&vxm->geneve6_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast (&t->remote))
|
||||
{
|
||||
|
@ -54,19 +54,8 @@ static void vl_api_gre_add_del_tunnel_t_handler
|
||||
vl_api_gre_add_del_tunnel_reply_t *rmp;
|
||||
int rv = 0;
|
||||
vnet_gre_add_del_tunnel_args_t _a, *a = &_a;
|
||||
u32 outer_fib_id;
|
||||
u32 p;
|
||||
u32 sw_if_index = ~0;
|
||||
|
||||
p = fib_table_find (!mp->is_ipv6 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6,
|
||||
ntohl (mp->outer_fib_id));
|
||||
if (p == ~0)
|
||||
{
|
||||
rv = VNET_API_ERROR_NO_SUCH_FIB;
|
||||
goto out;
|
||||
}
|
||||
outer_fib_id = p;
|
||||
|
||||
/* Check src & dst are different */
|
||||
if ((mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 16) == 0) ||
|
||||
(!mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 4) == 0))
|
||||
@ -92,7 +81,7 @@ static void vl_api_gre_add_del_tunnel_t_handler
|
||||
clib_memcpy (&(a->dst.ip6), mp->dst_address, 16);
|
||||
}
|
||||
|
||||
a->outer_fib_id = outer_fib_id;
|
||||
a->outer_fib_id = ntohl (mp->outer_fib_id);
|
||||
rv = vnet_gre_add_del_tunnel (a, &sw_if_index);
|
||||
|
||||
out:
|
||||
|
@ -270,7 +270,7 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a, u32 * sw_if_indexp)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
t =
|
||||
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
|
||||
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
|
||||
|
||||
if (NULL != t)
|
||||
return VNET_API_ERROR_INVALID_VALUE;
|
||||
@ -426,9 +426,18 @@ vnet_gre_tunnel_delete (vnet_gre_add_del_tunnel_args_t * a,
|
||||
gre_tunnel_t *t;
|
||||
gre_tunnel_key_t key;
|
||||
u32 sw_if_index;
|
||||
u32 outer_fib_index;
|
||||
|
||||
if (!a->is_ipv6)
|
||||
outer_fib_index = ip4_fib_index_from_table_id (a->outer_fib_id);
|
||||
else
|
||||
outer_fib_index = ip6_fib_index_from_table_id (a->outer_fib_id);
|
||||
|
||||
if (~0 == outer_fib_index)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
t =
|
||||
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
|
||||
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
|
||||
|
||||
if (NULL == t)
|
||||
return VNET_API_ERROR_NO_SUCH_ENTRY;
|
||||
|
@ -704,6 +704,7 @@ vnet_register_interface (vnet_main_t * vnm,
|
||||
char *tx_node_name, *output_node_name;
|
||||
|
||||
pool_get (im->hw_interfaces, hw);
|
||||
memset (hw, 0, sizeof (*hw));
|
||||
|
||||
hw_index = hw - im->hw_interfaces;
|
||||
hw->hw_if_index = hw_index;
|
||||
@ -904,19 +905,25 @@ vnet_delete_hw_interface (vnet_main_t * vnm, u32 hw_if_index)
|
||||
/* Call delete callbacks. */
|
||||
call_hw_interface_add_del_callbacks (vnm, hw_if_index, /* is_create */ 0);
|
||||
|
||||
/* Delete software interface corresponding to hardware interface. */
|
||||
vnet_delete_sw_interface (vnm, hw->sw_if_index);
|
||||
|
||||
/* Delete any sub-interfaces. */
|
||||
{
|
||||
u32 id, sw_if_index;
|
||||
/* *INDENT-OFF* */
|
||||
hash_foreach (id, sw_if_index, hw->sub_interface_sw_if_index_by_id, ({
|
||||
hash_foreach (id, sw_if_index, hw->sub_interface_sw_if_index_by_id,
|
||||
({
|
||||
vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
|
||||
u64 sup_and_sub_key =
|
||||
((u64) (si->sup_sw_if_index) << 32) | (u64) si->sub.id;
|
||||
hash_unset_mem_free (&im->sw_if_index_by_sup_and_sub, &sup_and_sub_key);
|
||||
vnet_delete_sw_interface (vnm, sw_if_index);
|
||||
}));
|
||||
hash_free (hw->sub_interface_sw_if_index_by_id);
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
/* Delete software interface corresponding to hardware interface. */
|
||||
vnet_delete_sw_interface (vnm, hw->sw_if_index);
|
||||
|
||||
{
|
||||
vnet_hw_interface_nodes_t *dn;
|
||||
|
||||
|
@ -75,24 +75,24 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
|
||||
(weight != (u32) ~ 0 ? weight : SR_SEGMENT_LIST_WEIGHT_DEFAULT);
|
||||
segment_list->segments = vec_dup (sl);
|
||||
|
||||
fib_route_path_t path = {
|
||||
.frp_proto = DPO_PROTO_MPLS,
|
||||
.frp_sw_if_index = ~0,
|
||||
.frp_fib_index = 0,
|
||||
.frp_weight = segment_list->weight,
|
||||
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
|
||||
.frp_label_stack = NULL,
|
||||
.frp_local_label = sl[0],
|
||||
};
|
||||
|
||||
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
|
||||
|
||||
fib_route_path_t *paths = NULL;
|
||||
vec_add1 (paths, path);
|
||||
|
||||
mpls_eos_bit_t eos;
|
||||
FOR_EACH_MPLS_EOS_BIT (eos)
|
||||
{
|
||||
fib_route_path_t path = {
|
||||
.frp_proto = DPO_PROTO_MPLS,
|
||||
.frp_sw_if_index = ~0,
|
||||
.frp_fib_index = 0,
|
||||
.frp_weight = segment_list->weight,
|
||||
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
|
||||
.frp_label_stack = NULL,
|
||||
.frp_local_label = sl[0],
|
||||
};
|
||||
|
||||
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
|
||||
|
||||
fib_route_path_t *paths = NULL;
|
||||
vec_add1 (paths, path);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
fib_prefix_t pfx = {
|
||||
.fp_len = 21,
|
||||
@ -109,10 +109,9 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
|
||||
(sr_policy->type == SR_POLICY_TYPE_DEFAULT ?
|
||||
FIB_ENTRY_FLAG_NONE :
|
||||
FIB_ENTRY_FLAG_MULTICAST), paths);
|
||||
vec_free (paths);
|
||||
}
|
||||
|
||||
vec_free (paths);
|
||||
|
||||
return segment_list;
|
||||
}
|
||||
|
||||
|
@ -177,22 +177,27 @@ compute_rewrite_encaps (ip6_address_t * sl)
|
||||
iph->protocol = IP_PROTOCOL_IPV6;
|
||||
iph->hop_limit = IPv6_DEFAULT_HOP_LIMIT;
|
||||
|
||||
srh = (ip6_sr_header_t *) (iph + 1);
|
||||
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
|
||||
srh->protocol = IP_PROTOCOL_IPV6;
|
||||
srh->type = ROUTING_HEADER_TYPE_SR;
|
||||
srh->segments_left = vec_len (sl) - 1;
|
||||
srh->first_segment = vec_len (sl) - 1;
|
||||
srh->length = ((sizeof (ip6_sr_header_t) +
|
||||
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
|
||||
srh->flags = 0x00;
|
||||
srh->reserved = 0x00;
|
||||
addrp = srh->segments + vec_len (sl) - 1;
|
||||
vec_foreach (this_address, sl)
|
||||
{
|
||||
clib_memcpy (addrp->as_u8, this_address->as_u8, sizeof (ip6_address_t));
|
||||
addrp--;
|
||||
}
|
||||
if (vec_len (sl) > 1)
|
||||
{
|
||||
srh = (ip6_sr_header_t *) (iph + 1);
|
||||
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
|
||||
srh->protocol = IP_PROTOCOL_IPV6;
|
||||
srh->type = ROUTING_HEADER_TYPE_SR;
|
||||
srh->segments_left = vec_len (sl) - 1;
|
||||
srh->first_segment = vec_len (sl) - 1;
|
||||
srh->length = ((sizeof (ip6_sr_header_t) +
|
||||
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
|
||||
srh->flags = 0x00;
|
||||
srh->reserved = 0x00;
|
||||
addrp = srh->segments + vec_len (sl) - 1;
|
||||
vec_foreach (this_address, sl)
|
||||
{
|
||||
clib_memcpy (addrp->as_u8, this_address->as_u8,
|
||||
sizeof (ip6_address_t));
|
||||
addrp--;
|
||||
}
|
||||
}
|
||||
|
||||
iph->dst_address.as_u64[0] = sl->as_u64[0];
|
||||
iph->dst_address.as_u64[1] = sl->as_u64[1];
|
||||
return rs;
|
||||
@ -1332,8 +1337,13 @@ encaps_processing_v4 (vlib_node_runtime_t * node,
|
||||
ip0->ip_version_traffic_class_and_flow_label =
|
||||
clib_host_to_net_u32 (0 | ((6 & 0xF) << 28) |
|
||||
((ip0_encap->tos & 0xFF) << 20));
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1816,13 +1826,37 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
ip3->payload_length =
|
||||
clib_host_to_net_u16 (b3->current_length - sizeof (ip6_header_t));
|
||||
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr1 = (void *) (ip1 + 1);
|
||||
sr2 = (void *) (ip2 + 1);
|
||||
sr3 = (void *) (ip3 + 1);
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
sr0->protocol = sr1->protocol = sr2->protocol = sr3->protocol =
|
||||
IP_PROTOCOL_IP6_NONXT;
|
||||
if (ip1->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr1 = (void *) (ip1 + 1);
|
||||
sr1->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip1->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (ip2->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr2 = (void *) (ip2 + 1);
|
||||
sr2->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip2->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (ip3->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr3 = (void *) (ip3 + 1);
|
||||
sr3->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip3->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
/* Which Traffic class and flow label do I set ? */
|
||||
//ip0->ip_version_traffic_class_and_flow_label = clib_host_to_net_u32(0|((6&0xF)<<28)|((ip0_encap->tos&0xFF)<<20));
|
||||
@ -1930,8 +1964,13 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
ip0->payload_length =
|
||||
clib_host_to_net_u16 (b0->current_length - sizeof (ip6_header_t));
|
||||
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
|
||||
PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user