Compare commits

...

36 Commits

Author SHA1 Message Date
Joe Zhou
67a3e2d130 assign flood_class to vnet_sw_interface_t template in subif api handle function
Change-Id: I352f4a4adcf8771c21530657efcaecb532416612
Signed-off-by: Joe Zhou <zhouyoucn@qq.com>
(cherry picked from commit 715f94ed94638ea883f919361bff7a3f46fd1d1b)
2019-03-07 14:32:53 +00:00
Dave Wallace
cbd68cb711 19.01.1 Release Notes
Change-Id: Id71e0ce821e84634d24a550188d0ed5ed7164849
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-03-06 15:56:36 -05:00
Damjan Marion
3262adc55c cmake: fix out-of-git-tree build
Cherry picked from master: 6077c97a

JIRA: VPP-1577

Change-Id: Ib94637ec09799c23f3179599b54a2be6e2768425
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-05 12:08:05 -05:00
Artem Belov
d302022440 Fix vpp crashing when attempting to run in kubernetes Pod
mmap does not fail but writing to mapped memory is causing sigbus.

Change-Id: I5135f32eede67fccb4aaa07a501cd262d254ed8d
Signed-off-by: Artem Belov <artem.belov@xored.com>
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
(cherry picked from commit f6defa113e2e10a70c5a92ce7e14b7a532154409)
2019-03-02 09:20:05 +00:00
Florin Coras
6342e48dc1 tcp: allow future acks if in window
Change-Id: I84ad1830b8db43f6031cf2876cd94f6a71216b83
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5fd3210be3a043c12c598df3d75dbe0aa606bfe5)
2019-03-01 23:26:33 +00:00
Neale Ranns
46ee286753 IPSEC: crash on SA dump when SA are bound to tunnels
Change-Id: I1c8256af838e6d4f371549ca91b8b0a4c0c44c65
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-02-28 12:46:07 +00:00
Damjan Marion
bad0bcd442 Fix crash in barrier sync when vlib_worker_threads is zero
Change-Id: I6819dd9dbfc15c17740bdb98b51bdd639ef8c4d2
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 8343ee5665942353e57ee074da62b9d07c1c510b)
2019-02-27 15:25:21 +00:00
Klement Sekera
372a33efe8 buffer chain linearization
Rewrite vlib_buffer_chain_linearize function so that it works as intended.
Linearize buffer chains coming out of reassembly to work around some
dpdk-tx issues. Note that this is not a complete workaround
as a sufficiently large packet will still cause the resulting chain to
be too long.

Drop features from reassembly code which relies on knowing which and how
many buffers were freed during linearization, buffer counts and tracing
capabilities for these cases.

Change-Id: Ic65de53ecb5c78cd96b178033f6a576ab4060ed1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-02-27 12:48:13 +01:00
Ed Kern
7f1cc2c2c1 Makefile: correct opensuse 15.0 dep naming
This covers both naming option for opensuse leap15
dep package naming

Change-Id: I2ade004e44e75c08afde0f3af42b33cd97ce0ebc
Signed-off-by: Ed Kern <ejk@cisco.com>
2019-02-27 12:48:08 +01:00
Steven Luong
5880ec02d6 vhost: VPP stalls with vhost performing control plane actions [VPP-1572]
Symptom
-------
With NDR traffic blasting at VPP, bringing up a new VM with vhost
connection to VPP causes packet drops. I am able to recreate this
problem easily using a simple setup like this.

TREX-------------- switch ---- VPP
    |---------------|  |-------|

Cause
-----
The reason for the packet drops is due to vhost holding onto the worker
barrier lock for too long in vhost_user_socket_read(). There are quite a
few of system calls inside the routine. At the end of the routine, it
unconditionally calls vhost_user_update_iface_state() for all message
types. vhost_user_update_iface_state() also unconditionally calls
vhost_user_rx_thread_placement() and vhost_user_tx_thread_placement().
vhost_user_rx_thread_placement scraps out all existing cpu/queue mappings
for the interface and creates brand new cpu/queue mappings for the
interface. This process is very disruptive and very expensive. In my
opinion, this area of code needs a makeover.

Fixes
-----
* vhost_user_socket_read() is rewritten that it should not hold
  onto the worker barrier lock for system calls, or at least minimize the
  need for doing it.
* Remove the call to vhost_user_update_iface_state as a default route at
  the end of vhost_user_socket_read(). There is only a couple of message
  types which really need to call vhost_user_update_iface_state(). We put
  the call to those message types which need it.
* Remove vhost_user_rx_thread_placement() and
  vhost_user_tx_thread_placement from vhost_user_update_iface_state().
  There is no need to repetatively change the cpu/queue mappings.
* vhost_user_rx_thread_placement() is actually quite expensive. It should
  be called only once per queue for the interface. There is no need to
  scrap the existing cpu/queue mappings and create new cpu/queue mappings
  when the additional queues becomes active/enable.
* Change to create the cpu/queue mappings for the first RX when the
  interface is created. Dont remove the cpu/queue mapping when the
  interface is disconnected. Remove the cpu/queue mapping only when the
  interface is deleted.

The create vhost user interface CLI also has some very expensive system
calls if the command is entered with the optional keyword "server"

As a bonus, This patch makes the create vhost user interface binary-api and
CLI thread safe. Do the protection for the small amount of code which is
thread unsafe.

Change-Id: I4a19cbf7e9cc37ea01286169882e5603e6d7eb77
Signed-off-by: Steven Luong <sluong@cisco.com>
(cherry picked from commit 67f935ec6eb9ec37b7d73029c5afa89cbf4a9aa2)
2019-02-22 23:41:14 +00:00
Florin Coras
d0f4dec52b tcp: free sack block list on connection cleanup
Change-Id: I7152b4ae64528082765726d5844580aad54c0c70
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-22 20:44:42 +00:00
Damjan Marion
be0e482019 avf: fix eat own tail issue on tx
Change-Id: Ie14ca18bab47ac6765ff0799475d0c2a4d936f90
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-22 17:15:43 +00:00
Damjan Marion
903c21b470 physmem: keep physmem VA in 39-bit address space on x86_64
Some x86 CPUs have IOMMU capable dealing only with 39-bit address space
This patch also adds option to specify physmem base address from
startup.conf

Change-Id: I9e8abd26efb60e9c4ad54c035fb1751a4a61f4dc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-22 16:46:08 +00:00
Damjan Marion
c41559afe5 Add no-append flag to vlib_frame_t
Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-22 11:31:43 +01:00
Neale Ranns
dc2a250f06 IP route local and connected
allow routes that are local and connected to be added via the API.
this emulates the addition of a second address in the same subnet
added to an interface.

Change-Id: Ib18a08c26956be9a07b3360664210c8cf6734c84
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 7425f9289bdc17d330044b0df0fc31cdeeca626b)
2019-02-20 14:40:52 +00:00
Neale Ranns
4c696abc8c FIB: pass a copy the walk context
since it can realloc when new ctx are added. If
not we can get some nasty memory corruption.

Change-Id: I617709c3013acbcb8aee07dc147894f0de896555
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 58085f2f6757e464196b283cc8335ab5cf34a012)
2019-02-20 08:53:15 +00:00
Peter Mikus
c01d7488f2 Revert "bond: problem switching from l2 to l3"
During CSIT testing we discovered that LACP tests were failing and
producing coredumps. Reverting this patch fix the problem with VPP
crashing.

This reverts commit f23890138e02d4218c828c427f687f8ecdb0e165.

Change-Id: Icf97053ce1473350add885cbebe591f7f3efcbea
Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-02-19 16:32:38 +00:00
Florin Coras
cd56f69af9 tcp: fix reset sending in syn-sent
Change-Id: I468b1015bca5f95b162fb49e904aa4e4d38db75e
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d4c49be5e20406220cf89083c9df86c3c0761a81)
2019-02-07 16:53:01 +00:00
Yichen Wang
63132185d0 Fix borken install-dep on RHEL
Change-Id: I247cca88e33f782e1acb72eb2c0e1515faf2f030
Signed-off-by: Yichen Wang <yicwang@cisco.com>
2019-02-04 22:27:39 -08:00
Andrew Yourtchenko
67d9475ae3 19.01 Release Notes
Change-Id: I43fd3aac9039c6d551fac8607374a0ebfdc6f74a
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-30 21:59:49 +01:00
Klement Sekera
827d4e568b ipsec: fix check support functions
Change-Id: If94c57fbb07a7376a9f2873e1489c00b28152620
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 4fd5a9d3e6abdf61f266da8400a299fe5b0eb0ed)
2019-01-30 20:36:33 +00:00
Paul Vinciguerra
b659e28219 VTL: Fix pep8 test/test_syslog.py
Change-Id: I8894a7a8f2be117a4c1cec9ce5134a1572da7ec7
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 776e46d77c21899874d156a48b8d89e7133d212c)
2019-01-30 19:22:58 +00:00
Andrew Yourtchenko
02da3a792c Update version (19.01) for API changes script
Change-Id: I9c39b5076d366b3455a875df32765b2cb8f3eca2
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-30 18:39:56 +00:00
Andrew Yourtchenko
44f14358cf Update to doxygen documentation for release 19.01
Change-Id: Id19cefc24d391f0437a0355f5328505ec21aa58a
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-30 18:39:20 +00:00
Damjan Marion
9124874e2e avf: fix queue enable issue
It is actually a bitmap....

Change-Id: Ie359e085df3f371512f773600f8d7460b2232b3e
Signed-off-by: Damjan Marion <damjan.marion@gmail.com>
2019-01-28 15:53:34 +01:00
Neale Ranns
b2962715e6 IP6 FIB: walk table for dump (VPP-1553)
Change-Id: Iaa57ace6df96bfacd1235c80ec7bb08e5f335530
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 5c1f559b1bf32acd528664e7674a2d46f2aed947)
2019-01-25 15:49:05 +00:00
Steven
38befb3a53 bond: packet drops on VPP bond interface [VPP-1544]
We register callback for VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION and
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION to add and remove the slave
interface from the bond interface accordingly. For static bonding without
lacp, one would think that it is good enough to put the slave interface into
the ective slave set as soon as it is configured. Wrong, sometimes the slave
interface is configured to be part of the bonding without ever bringing up the
hardware carrier or setting the admin state to up. In that case, we send
traffic to the "dead" slave interface.

The fix is to make sure both the carrier and admin state are up before we put
the slave into the active set for forwarding traffic.

Change-Id: I93b1c36d5481ca76cc8b87e8ca1b375ca3bd453b
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit e43278f75fe3188551580c7d7991958805756e2f)
2019-01-23 22:40:17 +00:00
Florin Coras
0cb68778ec ldp: add support for TCP_CONGESTION sockopts (VPP-1550)
Change-Id: I0fcf3385cc4fb96f000b84d5f880f74131c0d60f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 0ed24e93b207850078ca7f58cd4106cc4a906952)
2019-01-21 19:34:15 +00:00
Andrew Yourtchenko
1705599efe doxygen formatting fix: prevent stray examples appearing in the docs
The 'example' keyword triggers the creation of very out-of-context
example in the "Examples" top level of documentation. Rename the
keyword in the comment so the comment is still readable, but
does not trigger the doxygen.

Change-Id: Iecbdc236918f9178a034817aa6cea7ab6b2c1654
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-21 16:05:28 +01:00
Florin Coras
6e5f93e70d session: add support for vrf in session unformat (VPP-1546)
Change-Id: Ic5ba751c2bd2db9af4a21d3db40cc305d1208c30
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit baee8d498830bbbf54ec76e7c0c887c6373fe985)
2019-01-20 22:57:38 +00:00
Florin Coras
a74ae5886f tcp: fix debugging without cc stats (VPP-1547)
Change-Id: I376856fcadce570bb555064435f5876eefb2befa
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 0702554639e5149d9012cc196aa43c3c8d0d7f9b)
2019-01-20 19:21:55 +00:00
Michal Cmarada
af429cb381 fix data_length in IpSec API call (VPP-1548)
Change-Id: Idb2839f6082bd2e052be2bc5417f0ebb43d1c0a6
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
2019-01-20 15:21:48 +00:00
Neale Ranns
46da5e33a3 VOM: ip-mroute inspect register handler fix
Change-Id: I57689446005da00fa064e2938cfe55a9e1cef9fc
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit d870ce441272d7057c8cb2b8f9731ebe41a17f0a)
2019-01-20 10:27:57 +00:00
Florin Coras
cbb4565c88 tcp: allow data in passive open ack (VPP-1545)
Change-Id: Iceb99d3f8b7029bd1b1e9ebafb1e0b3790c573e4
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 865872ebdb2bbaf3f157e2a9889405b84114d2eb)
2019-01-18 22:10:24 +00:00
Paul Vinciguerra
48872780e8 VTL: Use latest version of syslog_rfc5424_parser (0.2.0) released: 190117
Upstream changes not compatable with: https://gerrit.fd.io/r/#/c/16797/

Running tests using custom test runner
Active filters: file=test_syslog.py, class=None, function=None
Adding tests from directory tree /vpp/test
1 out of 914 tests match specified filters
Not running extended tests (some tests will be skipped)
==============================================================================
Syslog Protocol Test Cases
==============================================================================
Syslog Protocol test                                                     OK

==============================================================================
TEST RESULTS:
     Scheduled tests: 1
      Executed tests: 1
        Passed tests: 1
==============================================================================

Test run was successful

Change-Id: I42f86ae3e7f062c0343025ba16bc6e8d2c34ed50
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 5011c67058c3c37d344c5d83ab6046700327b7b4)
2019-01-18 17:29:57 +00:00
Andrew Yourtchenko
3e2bc759f4 Initial changes for stable/1901 branch
This patch adds an entry for the defaultbranch in .gitreview

Change-Id: I3dc45492ec51b10524b0a6d894c7e42c352f0daa
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-16 19:26:41 +01:00
56 changed files with 1173 additions and 793 deletions

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -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 = []

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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