Commit Graph

6036 Commits

Author SHA1 Message Date
Paul Vinciguerra
0f6602cb24 Tests: fix time.sleep(0) # yield. Reduce sleep related log messages.
Reduce the incidence of:
20:04:23,606 unexpected time.sleep() result - slept for 2.187967e-03s instead of ~6.837845e-04s!

Change-Id: Ic576fda7f75e571c9019111588a6a936ee2cf5c2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 08:10:34 +00:00
Paul Vinciguerra
d3a9be2ca0 Tests: remote_test.py. Private member test catching dunder names.
Private member check also catches __iter__, since it starts with '_'.

Fixes:
  Captured traceback:
  ~~~~~~~~~~~~~~~~~~
      b'Traceback (most recent call last):'
      b'  File "/vpp/test/test_memif.py", line 47, in tearDown'
      b'    remove_all_memif_vpp_config(self.remote_test)'
      b'  File "/vpp/test/vpp_memif.py", line 36, in remove_all_memif_vpp_config'
      b'    for d in dump:'
      b"TypeError: 'SerializableClassCopy' object is not iterable"
      b''

Change-Id: I6a3f3e0f2b1b2d0a2b97faa23bf542ff8f92de43
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 08:09:58 +00:00
Paul Vinciguerra
9a6dafd569 Tests: use self.assertNotIn().
Many tests use self.assertEqual(error.find("failed"), -1)
Use self.assertNotIn("failed", error) to provide more meaningful errors such as
AssertionError: 'Failed' not found in '' instead of 0 != -1.

Change-Id: I670acdc977b788b2cedf94cfeafc12097781463f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 08:09:23 +00:00
Paul Vinciguerra
f70cead5eb Tests: 'Fix' __del__ in test/remote_test.py.
This is not a fix as much as supressing a warning.
__del__ is not a destructor.

test/remote_test.py:385:13: F821 undefined name 'cls'
            cls.vpp.poll()
            ^
test/remote_test.py:386:16: F821 undefined name 'cls'
            if cls.vpp.returncode is None:
               ^
test/remote_test.py:387:17: F821 undefined name 'cls'
                cls.vpp.terminate()
                ^
test/remote_test.py:388:17: F821 undefined name 'cls'
                cls.vpp.communicate()

Change-Id: I6f0ecf3ae5dee7f279a4e25994cc1c49470bca26
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 01:14:53 +00:00
Paul Vinciguerra
a1bfb3a4d2 Test: Fix hook.py: AttributeError
File "/vpp/test/hook.py", line 84, in on_crash
    self.testcase.vpp_bin, core_path)
AttributeError: 'PollHook' object has no attribute 'testcase'

Change-Id: I84d9d86a5c6a5769a43a91cf23ce8a1141f7cd12
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 01:09:32 +00:00
Dave Barach
593eedf256 Perf tune get_frame_size_info
It turns out that for scalar sizes 0..24, frames are always the same
size. That range includes all current use-cases - and then some - so
get rid of the hash table. Old code preserved under #ifdef
VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES.

Change-Id: Ic005c7143c9639f77d1a0fadd2fc0e90dccb68c1
Signed-off-by: Dave Barach <dbarach@cisco.com>
2019-03-10 23:16:43 +00:00
wuzhouhui
c7886c5d50 vcl: update buf if whole buf cannot be done at once
Change-Id: I0d56d2cee012b46da848362f322d6f246f8bf4c2
Signed-off-by: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
2019-03-10 11:35:46 +08:00
Neale Ranns
738b299a8e SVS: cleanup default route on SVS disable
Change-Id: Ie0680330dd619cfdcb72ae8fb7e2463f732cff8c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-09 00:00:05 +00:00
Florin Coras
679b78f715 tcp: fix rcv_wnd computation
Change-Id: I3cecffae2e30233d4725bd3eaf5ff4a8ff194fae
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-08 20:03:54 +00:00
Florin Coras
14ed6df900 session/tcp/vcl: fixes and optimizations
Change-Id: Idc7dfe743399dd8dee0f6b3ec83f194f3fca580b
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-08 20:03:31 +00:00
Florin Coras
7e74bf39ec tcp: fix window probes in fin-wait-1
Change-Id: Idf060f385f4d9b2f42fdab6a1d372727beb8b19e
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-08 20:03:22 +00:00
Florin Coras
11e2cf5f1a session: reorganize session fields
Change-Id: I7f3b015ea6750c9773e4285bb63b0d44fa2177b9
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-08 20:03:10 +00:00
Neale Ranns
5d704aea53 updates now that flags are supported on the API
Change-Id: I9c45f390a6454c114f12f9c46c3a93fcecffa73f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-08 12:28:52 +00:00
Dave Barach
035ea679d5 parse ethernet header in ct6_in2out
fix a debug CLI scripting bug: cp_ip6_address_add_del_command_function
ate any subsequent commands, yielding indigestion.

Change-Id: Iaca7bed5687759da36ae91dc658e758549b71796
Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-07 22:41:39 +00:00
Paul Vinciguerra
eaea421e1f Tests: Refactor payload_to_info()
All callers of payload_to_info were required to wrap payload with str().
Refactor to call scapy's payload.load for raw payloads or specify the
specific fieldname.

Change-Id: I1c80599d4df8dc129dbb8274733afaad406d5bcf
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:29:44 +00:00
Paul Vinciguerra
ea2450fa2d VPP-1508: Python3 tests. Explicitly specify string formatting.
.format() doesn't understand what to do with binary values by default.
Specify that we expect coersion to string.

Change-Id: Ic4b697f70852124dc85ab231f76b7934d0d71f4d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:29:00 +00:00
Paul Vinciguerra
4a4cea02ef VPP-1508: test_acl_plugin vapi changes for Python3.
Change-Id: I0863cefa523a6d7c11e48649b03f058130e5a4ee
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:28:29 +00:00
Paul Vinciguerra
42bdba80f7 vpp_papi: Adjust aenum import for python3.
The stdlib introduced IntEnum in python 3.4 and IntFlag in python 3.6.

Change-Id: I3ac278a9d5a97eefa9fc4f1491f0cd030e40c3b2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:19:48 +00:00
Naveen Joy
2cbf2fb05e make-test: Python pep8 compliance for sequences
For sequences, (strings, lists, tuples), use the fact that
empty sequences are false. A tiny change towards getting
full pep8 compliance, which will look good.
Yes: if not seq:
     if seq:
No:  if len(seq):
     if not len(seq):
(https://www.python.org/dev/peps/pep-0008/)

Change-Id: I6b565bef424f81afc66aba3b0041a5029a9f8954
Signed-off-by: Naveen Joy <najoy@cisco.com>
2019-03-07 19:40:04 +00:00
Dave Barach
974931f162 Honor vnet_rewrite_data_t data_bytes == 0
Avoid the cache miss consequences of spraying [functionally harmless]
junk into un-prefetched rewrite space. As things stand, several tunnel
encap rewrites set rewrite data_bytes = 0, and take a performance hit
due to unwanted speculative copying.

Should be performance-neutral in speed-path cases, which won't execute
the added check.

Change-Id: Id83c0325e58c0f31631b4bae5a06457dfc7ed567
Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-07 19:39:28 +00:00
Dave Barach
f7c1a70ba5 Fix typo in feature arc constraint
Also, increase ip6 address field width in "show ip6 conn verbose"
output

Change-Id: If7d1bcd439d94a22d1f1c6c1298cb30aba13d0a2
Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-07 15:43:10 +00:00
Joe Zhou
715f94ed94 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>
2019-03-07 14:29:41 +00:00
Ole Troan
e098e78964 Remove local REPLY_MACRO so that socket transport works.
memif, lacp, nsh and cdp used local REPLY_MACROs.
Remove and use those in api_helper.h

Change-Id: Ib01d6ae5cff0b6f1cef90996a54b3177f0c53463
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-07 14:29:13 +00:00
Kingwel Xie
d3d1205087 ipsec: cli bug fixes
1. fix wrong assignemnt of lik/rik
2. keys initialized to 0, to avoid using random data
   in stack. could cause memory overlapped then crash
3. show sa->id in hex format

Change-Id: Id0430aa49bb55c27cee4f97f8c0e4ec87515dcd2
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-03-07 13:31:39 +00:00
Ole Troan
48ae19e909 API: Add python2.7 support for enum flags via aenum
Change-Id: I77a43bfb37d827727c331cd65eee77536cc15953
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-07 11:36:35 +00:00
Neale Ranns
9b309b61d2 BIER: trace then drop. MPLS: trace the drops
Change-Id: I952e6aec6487270a79c4d92cfe828cc55d42d536
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-07 10:53:03 +00:00
Kingwel Xie
3543908a89 gdb-helper: add gdb_show_traces
gdb_show_traces() dumps buffer traces.

Ease gdb debugging when vpp crashed...

Change-Id: Ib24314832386ee4defc2d31cbb4c05d293fb3338
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-03-07 10:52:46 +00:00
Filip Tehlar
e8cb521074 classify: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: I01730ec9eb8033074c8710daf0848c3573293aeb
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-07 10:27:20 +00:00
Filip Tehlar
30d93489d2 policer: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: I88d2632fa451dbafbc212dd142a67fe5ec4cd610
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-07 10:27:01 +00:00
Steven Luong
8905347d81 vlibmemory: coverity woes
Coverity complains about resource leak after open when fd gets 0 with below
warning.

off_by_one: Testing whether handle tfd is strictly greater than zero is
suspicious. tfd leaks when it is zero.

It is right. 0 is a valid fd. -1 is not.

Change-Id: I22c2eb75b99bb6209921b9f874190cbbdf10e6ce
Signed-off-by: Steven Luong <sluong@cisco.com>
2019-03-07 10:26:12 +00:00
Hongjun Ni
313f1b9e5b Add VAT support for LB
Change-Id: I61d8c35f48a059968909fc8523bd313fc4799389
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2019-03-07 10:25:26 +00:00
Florin Coras
f8d2e86099 session/tls: remove unused t_app_index field
Change-Id: Idbf7f3a57dc399798b8dba9463daeb7d66470ab1
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 10:17:24 +00:00
Kingwel Xie
00bff193e7 ipsec: ipsec-if optimizations & bug fixes
1. changed to vlib_buffer_enqueue_to_next
2. error counter fixes; stats added to last_sw_if_index
   when interface changed
3. udp-encap support

Change-Id: I70b0814aa37181fea4d70fa3c96c608adb5afe49
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-03-07 01:33:52 -05:00
Florin Coras
f940f8a40f session: use transport custom tx for app transports
Change-Id: I675f7090fa6b2ffdfb4ee748df858bfb7e39ce5a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 00:47:42 +00:00
Florin Coras
fe97da3203 session: cleanup instances of deprecated io evts
Change-Id: Iad119e05ae5e570fbfcf66747c95822cee647c99
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-07 00:47:23 +00:00
Dave Wallace
7a6fac1965 19.01.1 Release Notes
Change-Id: Id71e0ce821e84634d24a550188d0ed5ed7164849
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit cbd68cb711e496539c494ab64837995c126da69b)
2019-03-06 22:47:24 +00:00
Ole Troan
9a475373ed test framework: vpp_papi_provider.py - further cleanup
Part of further cleanups of this file.
Removed most wrappers that don't have conflicting signature with
message API.

Change-Id: I6acd93d20291feb7731eb35ab2eb8c9f22f4632c
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-06 21:13:05 +01:00
Sirshak das
fb6c75293c sctp chunk_len fix
total_length_not_including_first_buffer should only be used when
VLIB_BUFFER_TOTAL_LENGTH_VALID is set, if not it uses stale data
from previous session_chain_tail calculation to set data/chunk len.

Change-Id: I9802341e522cf9b18d0aef817f0047b76945782e
Signed-off-by: Sirshak Das <sirshak.das@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2019-03-06 18:57:23 +00:00
Florin Coras
c0737e962c session: use session index instead of fifo for evt
Avoids derefrencing fifo pointers whose segments could have been
unmapped.

Change-Id: Ifb0b7399e424f145f3f94b769391a6f4e31bb4e6
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-06 18:41:28 +00:00
Filip Tehlar
2c49ffeb25 udp: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: I2b324c77df2685a0bdfb617fb484022daf017d0b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-06 18:13:44 +00:00
Florin Coras
653e43f06a session: use vpp to switch io events for ct sessions
Instead of allocating pairs of message queues per cut-thru session and
having the applications map them, this uses vpp as an io event message
switch.

Change-Id: I51db1c7564df479a7d1a3288342394251fd188bb
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-06 17:53:39 +00:00
Dave Barach
a55df10817 ipv6 connection tracking plugin
A security feature: drop unsolicited global unicast traffic.

Change-Id: I421da7d52e08b7acf40c62a1f6e2a6caac349e7e
Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-06 17:19:22 +00:00
Filip Tehlar
e275bed64d tcp: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: Ifd9fa30eed343e2c5d40582b3e3aa589b070637d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-06 17:19:01 +00:00
Damjan Marion
c98275f327 ipsec: esp-encrypt and esp-decrypt cleanup
Change-Id: I1e431aa36a282ca7565c6618a940d591674b8cd2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-06 17:08:23 +01:00
Neale Ranns
4ba67723d7 GBP: use sclass in the DP for policy
Change-Id: I154e18f22ec7708127b8ade98e80546ab1dcd05b
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-06 12:15:10 +00:00
Paul Vinciguerra
6955595a57 Tests: Example duplicate code refactoring.
Refactor of duplicate methods in test/test_reassembly.py.

Change-Id: I46f880da6a0ced2acae1fa33c6892d0148b26139
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-06 11:43:24 +00:00
Filip Tehlar
6266877b01 interface: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: Ib92e338d0becbfbc38e6b9f34f262df76b63eead
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-06 11:42:11 +00:00
Filip Tehlar
1fc33b3d41 cop: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: Ic0c9c50376ceb0ff4e2d5e52e13b6506e68adf4b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-06 11:41:30 +00:00
Filip Tehlar
e1714d3ba2 vxlan*: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: Ide23bb3d82024118214902850821a8184fe65dfc
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-06 11:40:53 +00:00
Matthew Smith
f6266b56ec vmbus: fix bug that breaks multiple netvsc vdevs
VPP supports two DPDK drivers for managing netvsc devices on
Azure/Hyper-V. The new netvsc PMD looks a lot like other PCI-based
PMDs but it requires recently added kernel support (>=4.17). The
older vdev_netvsc is an abstraction that manages the mlx4 VF
and tap device underlying the netvsc interface using the failsafe PMD.
Distros with older kernels (e.g. RHEL/CentOS 7.x) have to use vdev_netvsc.

At startup, netvsc devices are processed and an attempt is made to
initialize them for management by the netvsc PMD. If that fails, then
vlib_vmbus_bind_to_uio() returns early and the device can be initialized
for management by vdev_netvsc.

The operation that is supposed to fail if the netvsc PMD cannot be used
is registration of the netvsc device type ID with the uio_hv_generic
driver. This operation is attempted exactly once so it does not fail
for netvsc devices processed after the first one and they end up in a
state where they cannot be initialized for use by vdev_netvsc.

Only unset uio_new_id_needed if uio_hv_generic registration succeeds.

Change-Id: I6be925d422b87ed24e0f4611304cc3a6b07a34fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-03-06 11:40:21 +00:00