Compare commits

...

23 Commits

Author SHA1 Message Date
Dave Wallace
9d21268d0a 18.01 Release Notes
Change-Id: I2493a6135aecb4e2eead20a71dcb9ca16834cd63
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-24 06:22:24 +00:00
Dave Wallace
7722efe8cd Script to list patches that changed api files.
- Add Ole Troan's script from vpp-dev email:
  https://lists.fd.io/pipermail/vpp-dev/2017-October/007037.html

Change-Id: I0cbf5118169dc25f0edd659a5a9f5cde8619f780
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-24 06:08:57 +00:00
Dave Wallace
1eb970d160 docs: Clean up TOC
Change-Id: I5415c002a431d84372f56d4a77dc2aabd6ef55f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-23 17:47:02 -05:00
Jan Gelety
1539400f14 Update CSIT tests 180110 -> 180122
- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I3c81303dc7959da3593240a6da1309843aff8369
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-01-22 08:31:43 +01:00
John Lo
7f5bec647c Sub-Interface deletion not cleanup hash's properly (VPP-1136)
On deleting sub-interfaces, functions vnet_delete_sub_interface()
and vnet_delete_hw_interface() are not cleaning up sub-interface
related hash tables and memory properly.

Change-Id: I17c7c4b2078c062c77bfe48889beb677610035ca
Signed-off-by: John Lo <loj@cisco.com>
2018-01-18 18:52:46 -05:00
Radu Nicolau
ec941ecb86 VPP-1122 dpdk/ipsec: fix transport mode pkt len
Change-Id: I6eef2ca258ff5b4aa9b21b98543d814633e295af
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-17 17:17:38 +00:00
Steven
d8a998e74b tapv2: deleting tap interface may leak buffers (VPP-1124)
Buffers may be allocated for indirect descriptors by tx thread and
they are freed when tx thread is invoked in the next invocation.
This is to allow the recipient (kernel) to have a chance to process
them. But if the tap interface is deleted, the tx thread may not yet
be called to clean up the indirect descriptors' buffers. In that case,
we need to remove them without waiting for the tx thread to be called.
Failure to do so may cause buffers leak when the tap interface is deleted.

For the RX ring, leakage also exists for vring->buffers when the interface
is removed.

Change-Id: I3df313a0e60334776b19daf51a9f5bf20dfdc489
Signed-off-by: Steven <sluong@cisco.com>
2018-01-11 19:51:07 +00:00
Jan Gelety
977b0a5bd7 Use csit rls1801 operational branch in vpp stable/1801
Change-Id: Ie5824b4efe7930816a4312d7d3f541a86db5a2f0
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-01-11 08:55:19 +01:00
Billy McFall
bbdfeaebf2 VPP-1131: doxygen: Documentation for Debug CLI stops at src/plugin/l2e
Change-Id: I3ce014da7b514aa766a90cacddd76cd2247406a8
Signed-off-by: Billy McFall <bmcfall@redhat.com>
2018-01-10 17:00:51 -05:00
Neale Ranns
9a5e61d775 makefile set CXXFLAGS so they are propageted to sub-builds
Change-Id: I55d9953851062f7106c66701d46bcd9073cf1ee4
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit 5ee623e789261552eb9460be10f34793d40b6575)
2018-01-10 18:42:43 +00:00
Pablo Camarillo
fd66de0f31 VPP-1120 SRv6 bug with SID list containing only one SID and no srh
Packets with a SR policy of one SID list create a malformed packet.
Outer IPv6 header points to a routing extension header that does not
exist since the SID list contains only one SID.

Change-Id: I1effee0457453bab95706a8a24fdabfbd843d5b7
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-10 08:40:37 +01:00
Pablo Camarillo
d01f4e76bd VPP-1113 SR MPLS path.frp_label_stack
provide one label stack per fib_table_entry_path_add2 call. otherwise multiple mheap releases take place.

Change-Id: I475ca1b801fc85dddda0b540c69ad628a274df7f
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-09 21:37:11 +00:00
Hongjun Ni
c287cd550b VPP-1119: PPPoE's destination MAC was overwritten
Change-Id: I6ae99c00e76058654f2c5e71377e9fd1bd13b47b
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2018-01-09 17:13:00 +00:00
Neale Ranns
f453a10cd4 BIER: missing endian swap for imposition object in API return
Change-Id: Iddd754d00ace3d042336e5c2c40431566275051a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit eea537a288721b867d65b736363ab3f71ba6116c)
2018-01-09 17:02:17 +00:00
Neale Ranns
2b97ac55ed test: consolidate the multiple versions of send_and_*
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 52fae862646e25bac6d1cd11b9fc7ac77299bc25)
2018-01-09 17:01:21 +00:00
Neale Ranns
12bf52bae2 BIER: crash in show command when no tables are present
Change-Id: Ie291468ea9d05c47cefe39c4ff7fea3e016bacf2
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 0e8cb6c475b616a3296b08d25bcaa1eed3ab0084)
2018-01-09 17:00:39 +00:00
John Lo
eeafbef61d GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
Follow up fix - vl_api_gre_add_del_tunnel_t_handler should pass
outer_fib_id from API message to vnet_gre_add_del_tunnel() and
not convert it to fib_index, since vnet_gre_add_del_tunnel()
already perform the lookup to get fib_index from fib_id.

Change-Id: I24967a97f82ce018ddef596e556bd3eb1706cb63
Signed-off-by: John Lo <loj@cisco.com>
2018-01-08 23:19:18 -05:00
Matus Fabian
43ad007a0c NAT: fixed get_worker_out2in bug (VPP-1116)
Change-Id: I5e080d69f28661cc0b1846885d5001526b54fbd9
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-08 09:20:24 +00:00
zhaoqingling
37aa1ffae6 VPP-1110 BVI reply ARP that doesn't request BVI loacl IP.
Change-Id: I66ae618edaa12c2b4e4afe276da689673b02c9cd
Signed-off-by: zhaoqingling <zhao.qingling@zte.com.cn>
(cherry picked from commit b4c42cdc6bbbf464f3f0034b2b39d4e20fd23a25)
2018-01-07 19:39:49 +00:00
John Lo
848b47c70e Unify/cleanup usage of hash_set/unset_mem by tunnels (VPP-1117)
Move the functions hash_set_key_copy() and hash_unset_key_free()
which are dupilicated in various tunnel support code modules to
hash.h as hash_set_mem_alloc() and hash_unset_mem_free() to be
used by all.

Change-Id: I40723cabe29072ab7feb1804c221f28606d8e4fe
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit e6bfeab1c352ae73a19361c038e2a06a58c035db)
2018-01-06 17:34:04 +00:00
John Lo
72247c8032 GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
The code path in src/vnet/gre/interface.c uses fib_id as a
component to generate hash key for GRE tunnel. This should be
fib_index as the GRE rx/decap data path will be using fib_index
to generate the hash key to lookup the GRE tunnel.

Change-Id: Ia7f0892d84f9dac79223a6e016775892b61eb5fb
Signed-off-by: John Lo <loj@cisco.com>
2018-01-06 00:22:54 -05:00
Neale Ranns
1f720c3b19 VOM: NAT coverity found bugs
Change-Id: Ic55ad2e0a1435f552ce84ed1a9b1981191bc178b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 842eb22e5d5a7e11114fe093eeccafb080e9aa8b)
2018-01-04 11:56:46 +00:00
Dave Wallace
8c2bacde4f Initial changes for stable/1801 branch
This patch adds an entry for the defaultbranch
in .gitreview

Change-Id: I280cc0fb36a913cc5b26d2815d8429e18b8edde1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-03 15:23:14 -05:00
47 changed files with 782 additions and 422 deletions

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/1801

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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), \

View File

@ -1,2 +1,2 @@
#!/bin/sh
echo oper-171218
echo oper-rls1801-180122

View File

@ -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

View File

@ -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
*
* @{
*/

View 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

View File

@ -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.

View File

@ -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);
}

View File

@ -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 (&gtpu_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&gtpu_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 (&gtpu_main.vtep6, &ip->ip6);
hash_unset_mem_free (&gtpu_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 (&gtpu_main.mcast_shared, dst, new_ep.as_u64);
hash_set_mem_alloc (&gtpu_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 (&gtpu_main.mcast_shared, dst);
hash_unset_mem_free (&gtpu_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 (&gtm->gtpu6_tunnel_by_key, &key6,
t - gtm->tunnels);
hash_set_mem_alloc (&gtm->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 (&gtm->gtpu6_tunnel_by_key, &key6);
hash_unset_mem_free (&gtm->gtpu6_tunnel_by_key, &key6);
if (!ip46_address_is_multicast (&t->dst))
{

View File

@ -1,4 +1,4 @@
# Kube-proxy plugin for VPP
# Kube-proxy plugin for VPP {#kp_plugin_doc}
## Overview

View File

@ -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* */

View File

@ -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 *

View File

@ -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)
{

View File

@ -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));
}

View File

@ -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* */
}

View File

@ -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)

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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_ */

View File

@ -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.

View File

@ -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;
}

View File

@ -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))
{

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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