Compare commits
36 Commits
v23.10-rc1
...
v19.01.2-r
Author | SHA1 | Date | |
---|---|---|---|
|
67a3e2d130 | ||
|
cbd68cb711 | ||
|
3262adc55c | ||
|
d302022440 | ||
|
6342e48dc1 | ||
|
46ee286753 | ||
|
bad0bcd442 | ||
|
372a33efe8 | ||
|
7f1cc2c2c1 | ||
|
5880ec02d6 | ||
|
d0f4dec52b | ||
|
be0e482019 | ||
|
903c21b470 | ||
|
c41559afe5 | ||
|
dc2a250f06 | ||
|
4c696abc8c | ||
|
c01d7488f2 | ||
|
cd56f69af9 | ||
|
63132185d0 | ||
|
67d9475ae3 | ||
|
827d4e568b | ||
|
b659e28219 | ||
|
02da3a792c | ||
|
44f14358cf | ||
|
9124874e2e | ||
|
b2962715e6 | ||
|
38befb3a53 | ||
|
0cb68778ec | ||
|
1705599efe | ||
|
6e5f93e70d | ||
|
a74ae5886f | ||
|
af429cb381 | ||
|
46da5e33a3 | ||
|
cbb4565c88 | ||
|
48872780e8 | ||
|
3e2bc759f4 |
@ -2,3 +2,4 @@
|
||||
host=gerrit.fd.io
|
||||
port=29418
|
||||
project=vpp
|
||||
defaultbranch=stable/1901
|
||||
|
10
Makefile
10
Makefile
@ -133,8 +133,7 @@ ifeq ($(SUSE_NAME),Tumbleweed)
|
||||
RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
|
||||
endif
|
||||
ifeq ($(SUSE_ID),15.0)
|
||||
RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0 libboost_thread1_68_0-devel-1.68.0 gcc6
|
||||
RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
|
||||
RPM_SUSE_DEVEL_DEPS = libboost_headers-devel libboost_thread-devel gcc6
|
||||
else
|
||||
RPM_SUSE_DEVEL_DEPS += libboost_headers1_68_0-devel-1.68.0 gcc6
|
||||
RPM_SUSE_PYTHON_DEPS += python-virtualenv
|
||||
@ -143,8 +142,8 @@ endif
|
||||
|
||||
ifeq ($(OS_ID),opensuse-leap)
|
||||
ifeq ($(SUSE_ID),15.0)
|
||||
RPM_SUSE_DEVEL_DEPS = libboost_headers-devel libboost_thread-devel gcc6
|
||||
RPM_SUSE_PYTHON_DEPS += python2-ply python2-virtualenv
|
||||
RPM_SUSE_DEVEL_DEPS = libboost_headers-devel libboost_thread-devel gcc
|
||||
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -295,6 +294,9 @@ endif
|
||||
else ifneq ("$(wildcard /etc/redhat-release)","")
|
||||
ifeq ($(OS_ID),rhel)
|
||||
@sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
|
||||
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
|
||||
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
|
||||
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
|
||||
else ifeq ($(OS_ID),centos)
|
||||
@sudo -E yum install $(CONFIRM) centos-release-scl-rh
|
||||
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
|
||||
|
398
RELEASE.md
398
RELEASE.md
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,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 19.01](https://docs.fd.io/vpp/19.01/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 18.10](https://docs.fd.io/vpp/18.10/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 18.07](https://docs.fd.io/vpp/18.07/vpp_make_test/html)
|
||||
- [Test framework documentation for VPP 18.04](https://docs.fd.io/vpp/18.04/vpp_make_test/html)
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
import os, fnmatch, subprocess
|
||||
|
||||
starttag = 'v18.10-rc0'
|
||||
endtag = 'v18.10'
|
||||
starttag = 'v19.01-rc0'
|
||||
endtag = 'v19.01'
|
||||
emit_md = True
|
||||
apifiles = []
|
||||
|
||||
|
@ -632,7 +632,8 @@ ip_mroute::dump(std::ostream& os)
|
||||
ip_mroute::event_handler::event_handler()
|
||||
{
|
||||
OM::register_listener(this);
|
||||
inspect::register_handler({ "ip-route" }, "ip route configurations", this);
|
||||
inspect::register_handler({ "ip-mroute" },
|
||||
"ip multicast route configurations", this);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -87,16 +87,6 @@ foreach(DIR ${SUBDIRS})
|
||||
add_subdirectory(${DIR})
|
||||
endforeach()
|
||||
|
||||
##############################################################################
|
||||
# packaging
|
||||
##############################################################################
|
||||
include(cmake/pack.cmake)
|
||||
add_vpp_packaging(
|
||||
NAME "vpp"
|
||||
VENDOR "fd.io"
|
||||
DESCRIPTION "Vector Packet Processor"
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# detect if we are inside git repo and add configure dependency
|
||||
##############################################################################
|
||||
@ -105,6 +95,7 @@ execute_process(
|
||||
COMMAND git rev-parse --show-toplevel
|
||||
OUTPUT_VARIABLE VPP_GIT_TOPLEVEL_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
if (VPP_GIT_TOPLEVEL_DIR)
|
||||
|
@ -653,14 +653,19 @@ clib_error_t *
|
||||
avf_op_enable_queues (vlib_main_t * vm, avf_device_t * ad, u32 rx, u32 tx)
|
||||
{
|
||||
virtchnl_queue_select_t qs = { 0 };
|
||||
int i;
|
||||
int i = 0;
|
||||
qs.vsi_id = ad->vsi_id;
|
||||
qs.rx_queues = rx;
|
||||
qs.tx_queues = tx;
|
||||
for (i = 0; i < ad->n_rx_queues; i++)
|
||||
while (rx)
|
||||
{
|
||||
avf_rxq_t *rxq = vec_elt_at_index (ad->rxqs, i);
|
||||
avf_reg_write (ad, AVF_QRX_TAIL (i), rxq->n_enqueued);
|
||||
if (rx & (1 << i))
|
||||
{
|
||||
avf_rxq_t *rxq = vec_elt_at_index (ad->rxqs, i);
|
||||
avf_reg_write (ad, AVF_QRX_TAIL (i), rxq->n_enqueued);
|
||||
rx &= ~(1 << i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return avf_send_to_pf (vm, ad, VIRTCHNL_OP_ENABLE_QUEUES, &qs,
|
||||
sizeof (virtchnl_queue_select_t), 0, 0);
|
||||
@ -850,10 +855,8 @@ avf_device_init (vlib_main_t * vm, avf_main_t * am, avf_device_t * ad,
|
||||
if ((error = avf_op_add_eth_addr (vm, ad, 1, ad->hwaddr)))
|
||||
return error;
|
||||
|
||||
if ((error = avf_op_enable_queues (vm, ad, ad->n_rx_queues, 0)))
|
||||
return error;
|
||||
|
||||
if ((error = avf_op_enable_queues (vm, ad, 0, ad->n_tx_queues)))
|
||||
if ((error = avf_op_enable_queues (vm, ad, pow2_mask (ad->n_rx_queues),
|
||||
pow2_mask (ad->n_tx_queues))))
|
||||
return error;
|
||||
|
||||
ad->flags |= AVF_DEVICE_F_INITIALIZED;
|
||||
|
@ -411,6 +411,7 @@ no_more_desc:
|
||||
|
||||
if ((or_qw1 & AVF_RXD_ERROR_IPE) == 0)
|
||||
f->flags |= ETH_INPUT_FRAME_F_IP4_CKSUM_OK;
|
||||
vlib_frame_no_append (f);
|
||||
}
|
||||
|
||||
n_left_to_next -= n_rx_packets;
|
||||
|
@ -45,6 +45,9 @@ avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
|
||||
/* avoid ring wrap */
|
||||
n_desc_left = txq->size - clib_max (txq->next, txq->n_enqueued + 8);
|
||||
|
||||
if (n_desc_left == 0)
|
||||
return 0;
|
||||
|
||||
while (n_packets_left && n_desc_left)
|
||||
{
|
||||
u32 or_flags;
|
||||
@ -140,7 +143,7 @@ VNET_DEVICE_CLASS_TX_FN (avf_device_class) (vlib_main_t * vm,
|
||||
avf_txq_t *txq = vec_elt_at_index (ad->txqs, qid % ad->num_queue_pairs);
|
||||
u32 *buffers = vlib_frame_vector_args (frame);
|
||||
u16 n_enq, n_left;
|
||||
u16 n_retry = 5;
|
||||
u16 n_retry = 2;
|
||||
|
||||
clib_spinlock_lock_if_init (&txq->lock);
|
||||
|
||||
@ -158,10 +161,11 @@ retry:
|
||||
if (slot == 0)
|
||||
break;
|
||||
|
||||
complete_slot = slot[0];
|
||||
if (avf_tx_desc_get_dtyp (txq->descs + complete_slot) != 0x0F)
|
||||
if (avf_tx_desc_get_dtyp (txq->descs + slot[0]) != 0x0F)
|
||||
break;
|
||||
|
||||
complete_slot = slot[0];
|
||||
|
||||
clib_ring_deq (txq->rs_slots);
|
||||
}
|
||||
|
||||
|
@ -389,6 +389,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
|
||||
if (xd->flags & DPDK_DEVICE_FLAG_RX_IP4_CKSUM &&
|
||||
(or_flags & PKT_RX_IP_CKSUM_BAD) == 0)
|
||||
f->flags |= ETH_INPUT_FRAME_F_IP4_CKSUM_OK;
|
||||
vlib_frame_no_append (f);
|
||||
}
|
||||
n_left_to_next -= n_rx_packets;
|
||||
vlib_put_next_frame (vm, node, next_index, n_left_to_next);
|
||||
|
@ -366,6 +366,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
ef = vlib_frame_scalar_args (f);
|
||||
ef->sw_if_index = mif->sw_if_index;
|
||||
ef->hw_if_index = mif->hw_if_index;
|
||||
vlib_frame_no_append (f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ cat > ${1} << __EOF__
|
||||
#define VPP_BUILD_DATE "$(date)"
|
||||
#define VPP_BUILD_USER "$(whoami)"
|
||||
#define VPP_BUILD_HOST "$(hostname)"
|
||||
#define VPP_BUILD_TOPDIR "$(git rev-parse --show-toplevel)"
|
||||
#define VPP_BUILD_TOPDIR "$(git rev-parse --show-toplevel 2> /dev/null)"
|
||||
#define VPP_BUILD_VER "$(scripts/version)"
|
||||
#endif
|
||||
__EOF__
|
||||
|
@ -1700,6 +1700,11 @@ getsockopt (int fd, int level, int optname,
|
||||
else
|
||||
rv = -EFAULT;
|
||||
break;
|
||||
case TCP_CONGESTION:
|
||||
strcpy (optval, "cubic");
|
||||
*optlen = strlen ("cubic");
|
||||
rv = 0;
|
||||
break;
|
||||
default:
|
||||
LDBG (0, "ERROR: fd %d: getsockopt SOL_TCP: sid %u, "
|
||||
"optname %d unsupported!", fd, vlsh, optname);
|
||||
@ -1808,6 +1813,10 @@ setsockopt (int fd, int level, int optname,
|
||||
rv = vls_attr (vlsh, VPPCOM_ATTR_SET_TCP_KEEPINTVL,
|
||||
(void *) optval, &optlen);
|
||||
break;
|
||||
case TCP_CONGESTION:
|
||||
/* Ignore */
|
||||
rv = 0;
|
||||
break;
|
||||
default:
|
||||
LDBG (0, "ERROR: fd %d: setsockopt() SOL_TCP: vlsh %u"
|
||||
"optname %d unsupported!", fd, vlsh, optname);
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
#include <vppinfra/hash.h>
|
||||
#include <vppinfra/fifo.h>
|
||||
#include <vlib/buffer.h>
|
||||
#include <vlib/physmem_funcs.h>
|
||||
#include <vlib/main.h>
|
||||
#include <vlib/node.h>
|
||||
|
||||
/** \file
|
||||
vlib buffer access methods.
|
||||
@ -1130,131 +1134,141 @@ vlib_validate_buffer_set_in_use (vlib_buffer_t * b, u32 expected)
|
||||
#endif
|
||||
}
|
||||
|
||||
/** minimum data size of first buffer in a buffer chain */
|
||||
#define VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE (256)
|
||||
|
||||
/**
|
||||
* @brief compress buffer chain in a way where the first buffer is at least
|
||||
* VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE long
|
||||
*
|
||||
* @param[in] vm - vlib_main
|
||||
* @param[in,out] first - first buffer in chain
|
||||
* @param[in,out] discard_vector - vector of buffer indexes which were removed
|
||||
* from the chain
|
||||
*/
|
||||
always_inline void
|
||||
vlib_buffer_chain_compress (vlib_main_t * vm,
|
||||
vlib_buffer_t * first, u32 ** discard_vector)
|
||||
always_inline u32
|
||||
vlib_buffer_space_left_at_end (vlib_main_t * vm, vlib_buffer_t * b)
|
||||
{
|
||||
if (first->current_length >= VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE ||
|
||||
!(first->flags & VLIB_BUFFER_NEXT_PRESENT))
|
||||
{
|
||||
/* this is already big enough or not a chain */
|
||||
return;
|
||||
}
|
||||
/* probe free list to find allocated buffer size to avoid overfill */
|
||||
vlib_buffer_free_list_index_t index;
|
||||
vlib_buffer_free_list_t *free_list =
|
||||
vlib_buffer_get_buffer_free_list (vm, first, &index);
|
||||
|
||||
u32 want_first_size = clib_min (VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE,
|
||||
free_list->n_data_bytes -
|
||||
first->current_data);
|
||||
do
|
||||
{
|
||||
vlib_buffer_t *second = vlib_get_buffer (vm, first->next_buffer);
|
||||
u32 need = want_first_size - first->current_length;
|
||||
u32 amount_to_copy = clib_min (need, second->current_length);
|
||||
clib_memcpy_fast (((u8 *) vlib_buffer_get_current (first)) +
|
||||
first->current_length,
|
||||
vlib_buffer_get_current (second), amount_to_copy);
|
||||
first->current_length += amount_to_copy;
|
||||
second->current_data += amount_to_copy;
|
||||
second->current_length -= amount_to_copy;
|
||||
if (first->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID)
|
||||
{
|
||||
first->total_length_not_including_first_buffer -= amount_to_copy;
|
||||
}
|
||||
if (!second->current_length)
|
||||
{
|
||||
vec_add1 (*discard_vector, first->next_buffer);
|
||||
if (second->flags & VLIB_BUFFER_NEXT_PRESENT)
|
||||
{
|
||||
first->next_buffer = second->next_buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
first->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
|
||||
}
|
||||
second->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
|
||||
}
|
||||
}
|
||||
while ((first->current_length < want_first_size) &&
|
||||
(first->flags & VLIB_BUFFER_NEXT_PRESENT));
|
||||
return b->data + VLIB_BUFFER_DATA_SIZE -
|
||||
((u8 *) vlib_buffer_get_current (b) + b->current_length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief linearize buffer chain - the first buffer is filled, if needed,
|
||||
* buffers are allocated and filled, returns free space in last buffer or
|
||||
* negative on failure
|
||||
*
|
||||
* @param[in] vm - vlib_main
|
||||
* @param[in,out] first - first buffer in chain
|
||||
*/
|
||||
always_inline int
|
||||
vlib_buffer_chain_linearize (vlib_main_t * vm, vlib_buffer_t * first)
|
||||
always_inline u32
|
||||
vlib_buffer_chain_linearize (vlib_main_t * vm, vlib_buffer_t * b)
|
||||
{
|
||||
vlib_buffer_t *b = first;
|
||||
vlib_buffer_free_list_t *fl =
|
||||
vlib_buffer_get_free_list (vm, vlib_buffer_get_free_list_index (b));
|
||||
u32 buf_len = fl->n_data_bytes;
|
||||
// free buffer chain starting from the second buffer
|
||||
int free_count = (b->flags & VLIB_BUFFER_NEXT_PRESENT) != 0;
|
||||
u32 chain_to_free = b->next_buffer;
|
||||
vlib_buffer_t *db = b, *sb, *first = b;
|
||||
int is_cloned = 0;
|
||||
u32 bytes_left = 0, data_size;
|
||||
u16 src_left, dst_left, n_buffers = 1;
|
||||
u8 *dp, *sp;
|
||||
u32 to_free = 0;
|
||||
|
||||
u32 len = vlib_buffer_length_in_chain (vm, b);
|
||||
u32 free_len = buf_len - b->current_data - b->current_length;
|
||||
int alloc_len = clib_max (len - free_len, 0); //use the free len in the first buffer
|
||||
int n_buffers = (alloc_len + buf_len - 1) / buf_len;
|
||||
u32 new_buffers[n_buffers];
|
||||
if (PREDICT_TRUE ((b->flags & VLIB_BUFFER_NEXT_PRESENT) == 0))
|
||||
return 1;
|
||||
|
||||
u32 n_alloc = vlib_buffer_alloc (vm, new_buffers, n_buffers);
|
||||
if (n_alloc != n_buffers)
|
||||
data_size = VLIB_BUFFER_DATA_SIZE;
|
||||
|
||||
dst_left = vlib_buffer_space_left_at_end (vm, b);
|
||||
|
||||
while (b->flags & VLIB_BUFFER_NEXT_PRESENT)
|
||||
{
|
||||
vlib_buffer_free_no_next (vm, new_buffers, n_alloc);
|
||||
return -1;
|
||||
b = vlib_get_buffer (vm, b->next_buffer);
|
||||
if (b->n_add_refs > 0)
|
||||
is_cloned = 1;
|
||||
bytes_left += b->current_length;
|
||||
n_buffers++;
|
||||
}
|
||||
|
||||
vlib_buffer_t *s = b;
|
||||
while (s->flags & VLIB_BUFFER_NEXT_PRESENT)
|
||||
/* if buffer is cloned, create completely new chain - unless everything fits
|
||||
* into one buffer */
|
||||
if (is_cloned && bytes_left >= dst_left)
|
||||
{
|
||||
s = vlib_get_buffer (vm, s->next_buffer);
|
||||
int d_free_len = buf_len - b->current_data - b->current_length;
|
||||
ASSERT (d_free_len >= 0);
|
||||
// chain buf and split write
|
||||
u32 copy_len = clib_min (d_free_len, s->current_length);
|
||||
u8 *d = vlib_buffer_put_uninit (b, copy_len);
|
||||
clib_memcpy (d, vlib_buffer_get_current (s), copy_len);
|
||||
int rest = s->current_length - copy_len;
|
||||
if (rest > 0)
|
||||
u32 len = 0;
|
||||
u32 space_needed = bytes_left - dst_left;
|
||||
u32 tail;
|
||||
|
||||
if (vlib_buffer_alloc (vm, &tail, 1) == 0)
|
||||
return 0;
|
||||
|
||||
++n_buffers;
|
||||
len += data_size;
|
||||
b = vlib_get_buffer (vm, tail);
|
||||
|
||||
while (len < space_needed)
|
||||
{
|
||||
//prev buf is full
|
||||
ASSERT (vlib_buffer_get_tail (b) == b->data + buf_len);
|
||||
ASSERT (n_buffers > 0);
|
||||
b = vlib_buffer_chain_buffer (vm, b, new_buffers[--n_buffers]);
|
||||
//make full use of the new buffers
|
||||
b->current_data = 0;
|
||||
d = vlib_buffer_put_uninit (b, rest);
|
||||
clib_memcpy (d, vlib_buffer_get_current (s) + copy_len, rest);
|
||||
u32 bi;
|
||||
if (vlib_buffer_alloc (vm, &bi, 1) == 0)
|
||||
{
|
||||
vlib_buffer_free_one (vm, tail);
|
||||
return 0;
|
||||
}
|
||||
b->flags = VLIB_BUFFER_NEXT_PRESENT;
|
||||
b->next_buffer = bi;
|
||||
b = vlib_get_buffer (vm, bi);
|
||||
len += data_size;
|
||||
n_buffers++;
|
||||
}
|
||||
sb = vlib_get_buffer (vm, first->next_buffer);
|
||||
to_free = first->next_buffer;
|
||||
first->next_buffer = tail;
|
||||
}
|
||||
else
|
||||
sb = vlib_get_buffer (vm, first->next_buffer);
|
||||
|
||||
src_left = sb->current_length;
|
||||
sp = vlib_buffer_get_current (sb);
|
||||
dp = vlib_buffer_get_tail (db);
|
||||
|
||||
while (bytes_left)
|
||||
{
|
||||
u16 bytes_to_copy;
|
||||
|
||||
if (dst_left == 0)
|
||||
{
|
||||
if (db != first)
|
||||
db->current_data = 0;
|
||||
db->current_length = dp - (u8 *) vlib_buffer_get_current (db);
|
||||
ASSERT (db->flags & VLIB_BUFFER_NEXT_PRESENT);
|
||||
db = vlib_get_buffer (vm, db->next_buffer);
|
||||
dst_left = data_size;
|
||||
dp = db->data;
|
||||
}
|
||||
|
||||
while (src_left == 0)
|
||||
{
|
||||
ASSERT (sb->flags & VLIB_BUFFER_NEXT_PRESENT);
|
||||
sb = vlib_get_buffer (vm, sb->next_buffer);
|
||||
src_left = sb->current_length;
|
||||
sp = vlib_buffer_get_current (sb);
|
||||
}
|
||||
|
||||
bytes_to_copy = clib_min (dst_left, src_left);
|
||||
|
||||
if (dp != sp)
|
||||
{
|
||||
if (sb == db)
|
||||
bytes_to_copy = clib_min (bytes_to_copy, sp - dp);
|
||||
|
||||
clib_memcpy_fast (dp, sp, bytes_to_copy);
|
||||
}
|
||||
|
||||
src_left -= bytes_to_copy;
|
||||
dst_left -= bytes_to_copy;
|
||||
dp += bytes_to_copy;
|
||||
sp += bytes_to_copy;
|
||||
bytes_left -= bytes_to_copy;
|
||||
}
|
||||
if (db != first)
|
||||
db->current_data = 0;
|
||||
db->current_length = dp - (u8 *) vlib_buffer_get_current (db);
|
||||
|
||||
if (is_cloned && to_free)
|
||||
vlib_buffer_free_one (vm, to_free);
|
||||
else
|
||||
{
|
||||
if (db->flags & VLIB_BUFFER_NEXT_PRESENT)
|
||||
vlib_buffer_free_one (vm, db->next_buffer);
|
||||
db->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
|
||||
b = first;
|
||||
n_buffers = 1;
|
||||
while (b->flags & VLIB_BUFFER_NEXT_PRESENT)
|
||||
{
|
||||
b = vlib_get_buffer (vm, b->next_buffer);
|
||||
++n_buffers;
|
||||
}
|
||||
}
|
||||
vlib_buffer_free (vm, &chain_to_free, free_count);
|
||||
b->flags &= ~VLIB_BUFFER_TOTAL_LENGTH_VALID;
|
||||
if (b == first) /* no buffers addeed */
|
||||
b->flags &= ~VLIB_BUFFER_NEXT_PRESENT;
|
||||
ASSERT (len == vlib_buffer_length_in_chain (vm, first));
|
||||
ASSERT (n_buffers == 0);
|
||||
return buf_len - b->current_data - b->current_length;
|
||||
|
||||
first->flags &= ~VLIB_BUFFER_TOTAL_LENGTH_VALID;
|
||||
|
||||
return n_buffers;
|
||||
}
|
||||
|
||||
#endif /* included_vlib_buffer_funcs_h */
|
||||
|
@ -233,7 +233,7 @@ vlib_frame_free (vlib_main_t * vm, vlib_node_runtime_t * r, vlib_frame_t * f)
|
||||
ASSERT (nf->frame_index != frame_index);
|
||||
}
|
||||
|
||||
f->frame_flags &= ~VLIB_FRAME_IS_ALLOCATED;
|
||||
f->frame_flags &= ~(VLIB_FRAME_IS_ALLOCATED | VLIB_FRAME_NO_APPEND);
|
||||
|
||||
vec_add1 (fs->free_frame_indices, frame_index);
|
||||
ASSERT (fs->n_alloc_frames > 0);
|
||||
@ -387,9 +387,11 @@ vlib_get_next_frame_internal (vlib_main_t * vm,
|
||||
f->flags = 0;
|
||||
}
|
||||
|
||||
/* Allocate new frame if current one is already full. */
|
||||
/* Allocate new frame if current one is marked as no-append or
|
||||
it is already full. */
|
||||
n_used = f->n_vectors;
|
||||
if (n_used >= VLIB_FRAME_SIZE || (allocate_new_next_frame && n_used > 0))
|
||||
if (n_used >= VLIB_FRAME_SIZE || (allocate_new_next_frame && n_used > 0) ||
|
||||
(f->frame_flags & VLIB_FRAME_NO_APPEND))
|
||||
{
|
||||
/* Old frame may need to be freed after dispatch, since we'll have
|
||||
two redundant frames from node -> next node. */
|
||||
@ -1347,7 +1349,7 @@ dispatch_pending_node (vlib_main_t * vm, uword pending_frame_index,
|
||||
VLIB_NODE_STATE_POLLING,
|
||||
f, last_time_stamp);
|
||||
|
||||
f->frame_flags &= ~VLIB_FRAME_PENDING;
|
||||
f->frame_flags &= ~(VLIB_FRAME_PENDING | VLIB_FRAME_NO_APPEND);
|
||||
|
||||
/* Frame is ready to be used again, so restore it. */
|
||||
if (restore_frame_index != ~0)
|
||||
|
@ -438,6 +438,9 @@ typedef struct
|
||||
#define VLIB_FRAME_NO_FREE_AFTER_DISPATCH \
|
||||
VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
|
||||
|
||||
/* Don't append this frame */
|
||||
#define VLIB_FRAME_NO_APPEND (1 << 14)
|
||||
|
||||
/* This next frame owns enqueue to node
|
||||
corresponding to node_runtime_index. */
|
||||
#define VLIB_FRAME_OWNER (1 << 15)
|
||||
|
@ -242,6 +242,12 @@ vlib_get_frame (vlib_main_t * vm, uword frame_index)
|
||||
return f;
|
||||
}
|
||||
|
||||
always_inline void
|
||||
vlib_frame_no_append (vlib_frame_t * f)
|
||||
{
|
||||
f->frame_flags |= VLIB_FRAME_NO_APPEND;
|
||||
}
|
||||
|
||||
always_inline u32
|
||||
vlib_frame_index (vlib_main_t * vm, vlib_frame_t * f)
|
||||
{
|
||||
|
@ -29,6 +29,15 @@
|
||||
#include <vlib/pci/pci.h>
|
||||
#include <vlib/linux/vfio.h>
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* we keep physmem in low 38 bits of VA address space as some
|
||||
IOMMU implamentation cannot map above that range */
|
||||
#define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR (1ULL << 36)
|
||||
#else
|
||||
/* let kernel decide */
|
||||
#define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR 0
|
||||
#endif
|
||||
|
||||
clib_error_t *
|
||||
vlib_physmem_shared_map_create (vlib_main_t * vm, char *name, uword size,
|
||||
u32 log2_page_sz, u32 numa_node,
|
||||
@ -102,7 +111,11 @@ vlib_physmem_init (vlib_main_t * vm)
|
||||
CLIB_CACHE_LINE_BYTES);
|
||||
memset (p, 0, sizeof (clib_pmalloc_main_t));
|
||||
vpm->pmalloc_main = (clib_pmalloc_main_t *) p;
|
||||
clib_pmalloc_init (vpm->pmalloc_main, 0);
|
||||
|
||||
if (vpm->base_addr == 0)
|
||||
vpm->base_addr = VLIB_PHYSMEM_DEFAULT_BASE_ADDDR;
|
||||
|
||||
clib_pmalloc_init (vpm->pmalloc_main, vpm->base_addr, 0);
|
||||
|
||||
return error;
|
||||
}
|
||||
@ -151,6 +164,25 @@ VLIB_CLI_COMMAND (show_physmem_command, static) = {
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static clib_error_t *
|
||||
vlib_physmem_config (vlib_main_t * vm, unformat_input_t * input)
|
||||
{
|
||||
vlib_physmem_main_t *vpm = &vm->physmem_main;
|
||||
|
||||
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
|
||||
{
|
||||
if (unformat (input, "base-addr 0x%lx", &vpm->base_addr))
|
||||
;
|
||||
else
|
||||
return unformat_parse_error (input);
|
||||
}
|
||||
|
||||
unformat_free (input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
VLIB_EARLY_CONFIG_FUNCTION (vlib_physmem_config, "physmem");
|
||||
|
||||
/*
|
||||
* fd.io coding-style-patch-verification: ON
|
||||
*
|
||||
|
@ -56,6 +56,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
u32 flags;
|
||||
uword base_addr;
|
||||
#define VLIB_PHYSMEM_MAIN_F_HAVE_PAGEMAP (1 << 0)
|
||||
#define VLIB_PHYSMEM_MAIN_F_HAVE_IOMMU (1 << 1)
|
||||
vlib_physmem_map_t *maps;
|
||||
|
@ -40,6 +40,11 @@
|
||||
#ifndef included_vlib_physmem_funcs_h
|
||||
#define included_vlib_physmem_funcs_h
|
||||
|
||||
#include <vppinfra/clib.h>
|
||||
#include <vppinfra/clib_error.h>
|
||||
#include <vlib/physmem.h>
|
||||
#include <vlib/main.h>
|
||||
|
||||
clib_error_t *vlib_physmem_init (vlib_main_t * vm);
|
||||
clib_error_t *vlib_physmem_shared_map_create (vlib_main_t * vm, char *name,
|
||||
uword size, u32 log2_page_sz,
|
||||
|
@ -1360,7 +1360,7 @@ vlib_worker_thread_fork_fixup (vlib_fork_fixup_t which)
|
||||
#endif
|
||||
|
||||
void
|
||||
vlib_worker_thread_barrier_sync_int (vlib_main_t * vm)
|
||||
vlib_worker_thread_barrier_sync_int (vlib_main_t * vm, const char *func_name)
|
||||
{
|
||||
f64 deadline;
|
||||
f64 now;
|
||||
@ -1374,6 +1374,7 @@ vlib_worker_thread_barrier_sync_int (vlib_main_t * vm)
|
||||
|
||||
ASSERT (vlib_get_thread_index () == 0);
|
||||
|
||||
vlib_worker_threads[0].barrier_caller = func_name;
|
||||
count = vec_len (vlib_mains) - 1;
|
||||
|
||||
/* Record entry relative to last close */
|
||||
|
@ -201,9 +201,10 @@ u32 vlib_frame_queue_main_init (u32 node_index, u32 frame_queue_nelts);
|
||||
#define BARRIER_SYNC_TIMEOUT (1.0)
|
||||
#endif
|
||||
|
||||
#define vlib_worker_thread_barrier_sync(X) {vlib_worker_threads[0].barrier_caller=__FUNCTION__;vlib_worker_thread_barrier_sync_int(X);}
|
||||
#define vlib_worker_thread_barrier_sync(X) {vlib_worker_thread_barrier_sync_int(X, __FUNCTION__);}
|
||||
|
||||
void vlib_worker_thread_barrier_sync_int (vlib_main_t * vm);
|
||||
void vlib_worker_thread_barrier_sync_int (vlib_main_t * vm,
|
||||
const char *func_name);
|
||||
void vlib_worker_thread_barrier_release (vlib_main_t * vm);
|
||||
void vlib_worker_thread_node_refork (void);
|
||||
|
||||
|
@ -531,11 +531,13 @@ bond_enslave (vlib_main_t * vm, bond_enslave_args_t * args)
|
||||
ethernet_set_rx_redirect (vnm, sif_hw, 1);
|
||||
}
|
||||
|
||||
if ((bif->mode == BOND_MODE_LACP) && bm->lacp_enable_disable)
|
||||
if (bif->mode == BOND_MODE_LACP)
|
||||
{
|
||||
(*bm->lacp_enable_disable) (vm, bif, sif, 1);
|
||||
if (bm->lacp_enable_disable)
|
||||
(*bm->lacp_enable_disable) (vm, bif, sif, 1);
|
||||
}
|
||||
else
|
||||
else if (sif->port_enabled &&
|
||||
(sif_hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP))
|
||||
{
|
||||
bond_enable_collecting_distributing (vm, sif);
|
||||
}
|
||||
|
@ -104,17 +104,6 @@ bond_set_l2_mode_function (vnet_main_t * vnm,
|
||||
ethernet_set_rx_redirect (vnm, sif_hw, 1);
|
||||
}
|
||||
}
|
||||
else if ((bif_hw->l2_if_count == 0) && (l2_if_adjust == -1))
|
||||
{
|
||||
/* Just removed last L2 subinterface on this port */
|
||||
vec_foreach (sw_if_index, bif->slaves)
|
||||
{
|
||||
sif_hw = vnet_get_sup_hw_interface (vnm, *sw_if_index);
|
||||
|
||||
/* Allow ip packets to go directly to ip4-input etc */
|
||||
ethernet_set_rx_redirect (vnm, sif_hw, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -396,19 +396,21 @@ bond_sw_interface_up_down (vnet_main_t * vnm, u32 sw_if_index, u32 flags)
|
||||
if (sif)
|
||||
{
|
||||
sif->port_enabled = flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP;
|
||||
if (sif->lacp_enabled)
|
||||
return 0;
|
||||
|
||||
if (sif->port_enabled == 0)
|
||||
{
|
||||
if (sif->lacp_enabled == 0)
|
||||
{
|
||||
bond_disable_collecting_distributing (vm, sif);
|
||||
}
|
||||
bond_disable_collecting_distributing (vm, sif);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sif->lacp_enabled == 0)
|
||||
{
|
||||
bond_enable_collecting_distributing (vm, sif);
|
||||
}
|
||||
vnet_main_t *vnm = vnet_get_main ();
|
||||
vnet_hw_interface_t *hw =
|
||||
vnet_get_sup_hw_interface (vnm, sw_if_index);
|
||||
|
||||
if (hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP)
|
||||
bond_enable_collecting_distributing (vm, sif);
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,19 +431,16 @@ bond_hw_interface_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
|
||||
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
|
||||
if (sif)
|
||||
{
|
||||
if (sif->lacp_enabled)
|
||||
return 0;
|
||||
|
||||
if (!(flags & VNET_HW_INTERFACE_FLAG_LINK_UP))
|
||||
{
|
||||
if (sif->lacp_enabled == 0)
|
||||
{
|
||||
bond_disable_collecting_distributing (vm, sif);
|
||||
}
|
||||
bond_disable_collecting_distributing (vm, sif);
|
||||
}
|
||||
else
|
||||
else if (sif->port_enabled)
|
||||
{
|
||||
if (sif->lacp_enabled == 0)
|
||||
{
|
||||
bond_enable_collecting_distributing (vm, sif);
|
||||
}
|
||||
bond_enable_collecting_distributing (vm, sif);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -250,6 +250,14 @@ typedef struct
|
||||
|
||||
/* The rx queue policy (interrupt/adaptive/polling) for this queue */
|
||||
u32 mode;
|
||||
|
||||
/*
|
||||
* It contains the device queue number. -1 if it does not. The idea is
|
||||
* to not invoke vnet_hw_interface_assign_rx_thread and
|
||||
* vnet_hw_interface_unassign_rx_thread more than once for the duration of
|
||||
* the interface even if it is disconnected and reconnected.
|
||||
*/
|
||||
i16 qid;
|
||||
} vhost_user_vring_t;
|
||||
|
||||
#define VHOST_USER_EVENT_START_TIMER 1
|
||||
@ -293,9 +301,6 @@ typedef struct
|
||||
/* Whether to use spinlock or per_cpu_tx_qid assignment */
|
||||
u8 use_tx_spinlock;
|
||||
u16 *per_cpu_tx_qid;
|
||||
|
||||
/* Vector of active rx queues for this interface */
|
||||
u16 *rx_queues;
|
||||
} vhost_user_intf_t;
|
||||
|
||||
typedef struct
|
||||
|
@ -244,6 +244,9 @@ vhost_user_api_hookup (vlib_main_t * vm)
|
||||
foreach_vpe_api_msg;
|
||||
#undef _
|
||||
|
||||
/* Mark CREATE_VHOST_USER_IF as mp safe */
|
||||
am->is_mp_safe[VL_API_CREATE_VHOST_USER_IF] = 1;
|
||||
|
||||
/*
|
||||
* Set up the (msg_name, crc, message-id) table
|
||||
*/
|
||||
|
@ -402,6 +402,7 @@ vhost_user_if_input (vlib_main_t * vm,
|
||||
ef = vlib_frame_scalar_args (f);
|
||||
ef->sw_if_index = vui->sw_if_index;
|
||||
ef->hw_if_index = vui->hw_if_index;
|
||||
vlib_frame_no_append (f);
|
||||
}
|
||||
|
||||
while (n_left > 0)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user