10390 Commits

Author SHA1 Message Date
Klement Sekera
17bd30384c nat: correct thread index usage
Use actual thread index from hash table instead of doing calculation.
Calculated index might be different and could lead to crash.

Type: fix
Change-Id: Iede9a67fbe541cb44eccd0d6ddf4e2c51eb35423
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-31 13:40:05 +00:00
Klement Sekera
68b493ff2f nat: avoid creating negative zero checksum
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ibbb72e77c751b7e775620cfb160b52ceff2da86b
2021-03-31 11:46:54 +00:00
Filip Varga
8f76064716 nat: NAT44-ED unused value removal
Type: fix

Coverity scan issue fix.

Change-Id: I9036fade15fd381da9c1e6b575f250fdcb21f876
Signed-off-by: Filip Varga <fivarga@cisco.com>
2021-03-31 11:46:42 +00:00
Filip Varga
ed2ee5e57b nat: NAT66 plugin enable&disable calls update
Type: improvement

Adding support for enable&disable calls
(dynamic plugin configuration).
API (nat66_plugin_enable_disable) and
CLI (nat66 plugin enable/nat66 plugin disable) with support for
outside_vrf id configuration.

Change-Id: I5637ff1621d6662adc3b7c6f7f8176d84a4b492b
Signed-off-by: Filip Varga <fivarga@cisco.com>
2021-03-31 11:46:05 +00:00
Klement Sekera
7554aef84a tests: call venv module directly
This avoids

ModuleNotFoundError: No module named 'virtualenv.seed.embed.via_app_data'

https://github.com/pypa/virtualenv/issues/1873

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I860cc8c4ad2ba509815c5e7cf02fa5e01ee2ed63
2021-03-31 11:43:54 +00:00
Florin Coras
1d2e38bb6e session: interrupt mode for session node on main thread
Signal, and implicitly run, main thread session queue node via
interrupts instead of the queue process node.

Process node still needed for timers.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5efd393effc8dad65e4125a3d0ad1be6b7484cb7
2021-03-30 14:51:16 +00:00
Damjan Marion
4f81d447bc interface: fix coverity
Type: fix
Change-Id: Ia7652fe8e8c20f4f7a019ab7ca0649c2180c7e90
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-30 14:44:27 +00:00
Ole Troan
3daca3f9f4 stats: python: handle when pattern is not list in ls
The reimplementation of python stats module mishandled the case
where pattern to ls was not a list.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I9ba189423a76f2fd4298c4c4b19a0875f705d719
2021-03-30 14:27:53 +00:00
Florin Coras
8c517c8fb4 svm: cleanup mq private data on fifo segment cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I65373f2cd5a33381da1e51ed7ab7a8b1358cef29
2021-03-30 13:17:42 +00:00
Vladimir Lavor
f632ab5e3b misc: vpptop makefile target
Type: feature

Added make target to install VPPTop - real-time
viewer of VPP metrics.

New targets in /extras/vpptop/Makefile:
* make start - starts the installed VPPTop binary
* make install - does the installation using the local VPP API
* make cleanup - removes the VPPTop local directory
* make help - prints the VPPTop help info

Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Change-Id: I1b93eaf67214e1fe0567d43409763882caea6416
2021-03-30 12:30:36 +00:00
Klement Sekera
eafb5db63f nat: fix HA multi-worker issues
Use correct vlib_main() in various code parts. Fix tests.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ia379f3b686599532dedaafad2278c4097a3f03f3
2021-03-30 12:26:25 +00:00
Chenmin Sun
0b37034fef avf: fix coverity issues
CID #220403 ~ 220406

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ibb65f9f2b17b9a9d45c077933b033ca3a65ae42f
2021-03-30 09:40:03 +00:00
Ole Troan
9bf487fb45 map: tune dump/details test for socket transport
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id3ad783a7b0321a8fa37b4e606c0c4551ca4edd4
2021-03-30 07:53:07 +00:00
Florin Coras
41d5f541d3 svm session vcl: per app rx message queues
Add option to use per app private segments for app to vpp message
queues, as opposed to exposing internal message queues segment.

When so configured, internal message queues are still polled by the
session queue node but external app message queues are handled by a new
input node (appsl-rx-mqs-input) that runs in interrupt state. Signaling
of the node, when mqs receive new messages, is done through eventfds
epolled by worker epoll input nodes.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iffe8ce5a9944a56a14e6d0f492a850cb9e392d16
2021-03-29 20:20:03 +00:00
yedg
a840db21e8 tls: fix app_worker_connect_notify param error
Type: fix
Signed-off-by: yedongggang <yedg@wangsu.com>
Change-Id: I5ec690e71fa9119a7bf1cfcb6e36263aa732eff0
2021-03-29 17:11:05 +00:00
Dave Wallace
d4a907bdd2 tests: move vxlan tests to src/vnet/vxlan/tests
- Refactor make test code to be co-located with
  the vpp feature source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I66379dfe671628e39dfc9685c4fd70fa0e566f6f
2021-03-29 05:24:25 +00:00
nandfan
dc2632e010 vcl: fix only first epoll listen session be registered
If configure listen port more than 1 with epoll in nginx, only first
listen port can be registered successed in nginx worker process.

Type: fix

Signed-off-by: nandfan <fanyufei521@outlook.com>
Change-Id: Iec2e058ee972a2cd5b2d1d7d20d373dc17084ce1
2021-03-28 16:34:55 +00:00
Damjan Marion
92ccf9bcd2 vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendly
Type: improvement
Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26 16:35:22 +01:00
Damjan Marion
fd8deb48c7 vlib: split vlib_main_t into global and per-thread
Type: refactor
Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26 16:33:42 +01:00
Damjan Marion
f553a2cbbb vlib: introduce vlib_get_elog_main()
Type: improvement
Change-Id: I73383eb15186021cd6527d112da8443a0082f129
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26 16:33:42 +01:00
Damjan Marion
6ffb7c6189 vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()
Type: improvement
Change-Id: If3da7d4338470912f37ff1794620418d928fb77f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26 16:33:21 +01:00
Dave Wallace
83f13e45bc tests: move ping tests to src/plugin/ping/test
- Refactor make test code to be co-located with
  the vpp plugin source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I09d55301665449b3f183191537749435f806fb15
2021-03-26 10:14:30 +00:00
Chenmin Sun
043f0b0ebf avf: flow support enhancement
This patch enables ip4, ip6, ip6-n-tuple, l2tpv3 esp ah flows in avf plugin

Type: improvement

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I92c6d4217a6cce4085ee83e8beb4b037c8d7da5f
2021-03-26 08:30:54 +00:00
Chenmin Sun
245fb34b33 avf: handle flow id in data path
Type: improvement

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I24fa52fee88dabad8f0b84446f796ee055819617
2021-03-26 08:30:54 +00:00
Chenmin Sun
ffe9a54894 avf: add avf flow framework
This patch adds the flow support to VPP avf_plugin.
Currently only IP4-N-TUPLE and GTPU flow are supported as
a reference. More flows will be added later.

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I563dbfacecd3eba31e8c3c7769142ea6adba54b6
2021-03-26 08:30:54 +00:00
Florin Coras
89c98a4bff svm: add producer wait function
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9488ad7e045c908b60b5821d9c48583f6d513c2f
2021-03-25 23:50:14 +00:00
Andrew Yourtchenko
22af286a29 acl: fix the integer overflow bug in API message length validation logic
Sending the bogus acl_add_replace message with count=~0 will result in
an overflow of "expected_len" field which is a u32, thus the message
will pass the validation when it should not.

Solution - make the expected_len a u64 to avoid overflow.

The bug was found while experimenting with libfuzzer as part of
https://gerrit.fd.io/r/c/vpp/+/31763

Type: fix
Change-Id: I4a866d48f2418148236f1b1d77c487b869c7c43d
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-03-25 21:14:09 +00:00
nandfan
abd8b36d19 svm: fix producer deadlock in svm_msg_q_wait()
1. When producer invokes svm_msg_q_wait() in svm_msg_q_lock_and_alloc_msg_w_ring(), queue mutex is held by itself.
2. Sometimes, svm msg queue is not full and ring is full, svm_msg_q_wait() do nothing with mutex held, consumer will blocking at svm_msg_q_send_signal().

Type: fix

Signed-off-by: nandfan <fanyufei521@outlook.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib90b87ab76534cd42e9a4c3e11703e80d93ca678
2021-03-25 19:54:18 +00:00
Klement Sekera
418bf6aaef nat: allocate enough space for full port usage
Type: fix
Change-Id: I068bfeaf22b9e6cce967c27acdd46d4b8541bdf8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-25 19:48:40 +00:00
Mohammed Hawari
933b0ca073 rdma: fix buggy cqe parsing (truncated packets)
Change-Id: I17228bd35cc7aa0d207a16502bf1376c75675302
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
2021-03-25 18:58:08 +00:00
Klement Sekera
403f9b5430 nat: fix bihash kvp print
Type: fix
Change-Id: I392d348b1a38affac8761b0614b117cd991958d7
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-25 18:34:57 +00:00
Chenmin Sun
c2d30ade27 avf: introduce program flow event
This patch introduces a 'program flow' virtchannel event.
The parameter is_add is used to identify adding or deleting the rule from avf

Type: improvement

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I1f5545ddc23e4494a25afa36ff601607405a8c3d
2021-03-25 15:56:59 +00:00
Dave Wallace
7df43dc2ce tests: move vppinfra tests to src/vppinfra/test
- Refactor make test code to be co-located with
  the vpp feature source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Iceaeab769c08e541b31546663d0e402ced862e5b
2021-03-25 14:44:37 +00:00
Klement Sekera
c294c5057d nat: prevent usage of ED nodes in EI code
Type: fix
Change-Id: I84d511c30eb5878a1867f5e9d2207a39d4f0926c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-25 09:40:02 +00:00
Klement Sekera
07bc8bb1ed nat: fix vnet_feature_next in source hairpinning
Avoid erroneous double vnet_feature_next if routing buffer manually.

Type: fix
Change-Id: I3f56c12bf57f59a1e5ddad63a2565fa195934cf6
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-25 09:37:13 +00:00
Klement Sekera
e0b63b2978 tests: introduce test-checkstyle-diff
Make test-checkstyle-diff is a new target which checks PEP8 compliance
only for changed files. This makes it faster to execute and also more
readable as most of the time, only changed files will fail.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I71baca76ab3a21a7a3790617cbfb0d48aacbd9ec
2021-03-25 09:22:52 +00:00
Ole Troan
e66443c9b4 stats: python vpp_stats rewrite to access stat segment directly
This module implement Python access to the VPP statistics segment. It
accesses the data structures directly in shared memory.
VPP uses optimistic locking, so data structures may change underneath
us while we are reading. Data is copied out and it's important to
spend as little time as possible "holding the lock".

Counters are stored in VPP as a two dimensional array.
Index by thread and index (typically sw_if_index).
Simple counters count only packets, Combined counters count packets
and octets.

Counters can be accessed in either dimension.
stat['/if/rx'] - returns 2D lists
stat['/if/rx'][0] - returns counters for all interfaces for thread 0
stat['/if/rx'][0][1] - returns counter for interface 1 on thread 0
stat['/if/rx'][0][1]['packets'] - returns the packet counter
                                  for interface 1 on thread 0
stat['/if/rx'][:, 1] - returns the counters for interface 1 on all threads
stat['/if/rx'][:, 1].packets() - returns the packet counters for
                                 interface 1 on all threads
stat['/if/rx'][:, 1].sum_packets() - returns the sum of packet counters for
                                     interface 1 on all threads
stat['/if/rx-miss'][:, 1].sum() - returns the sum of packet counters for
                                  interface 1 on all threads for simple counters

Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I1fe7f7c7d11378d06be8276db5e1900ecdb8f515
Signed-off-by: Ole Troan <ot@cisco.com>
2021-03-25 08:37:46 +00:00
Dave Wallace
fd243741e0 tests: add vpp test dirs to PYTHONPATH
- Required to relocate test infra modules
  to be co-located in feature test directory.
- Remove/regenerate build-root/build-test/src/
  soft links when running make test to allow
  re-running 'make test' after moving source files.
- Suppress annoying 'ls' error message when gathering
  test source files caused by 'c' test application
  directory being named 'test'.
- Use PYTHONPYCACHEPREFIX to generate all
  compiled source under build-root/build-test.
  This only works for python 3.8 or greater, but
  existing 'make test-wipe' target cleans up
  in-situ __pycache__ directories for older
  python versions.

Type: fix

Change-Id: If3c3ff0c58fb26a17395babc34783e06b1dd84e7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-03-24 20:50:59 +00:00
Florin Coras
da282b5d08 tls: fix cleanup on app close with data
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I35b5ae5a58ab38cc4328f9f438938fab4fbd7942
2021-03-24 15:15:34 +00:00
Damjan Marion
d4008cfb4c interface: do subif or feature arc work in interface-output only if needed
Type: improvement
Change-Id: If3b44682e5bbf68b83adc12fb6c71899aecf8a98
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-24 12:41:36 +00:00
Damjan Marion
809d5c9ecf virtio: improve compilation time
Type: improvement
Change-Id: I56dadb852f63da0597ddf4db395a22afdf2d9cc0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-24 12:35:24 +00:00
Arthur de Kerhor
1f13f8fd8a misc: fuse fs for the stats segment
This extra allows to mount a FUSE filesystem reflecting
the state of the stats segment.

Type: feature

Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I692f9ca5a65c1123b3cf28c761455eec36049791
2021-03-24 12:16:43 +00:00
Damjan Marion
4d2726ece8 interface: simplify and optimize interface-output node
Type: improvement
Change-Id: I58a7d75da2db0ec84c7c1f08fd1ca7a72946f14d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-23 22:37:21 +01:00
Damjan Marion
04e7c0ff14 misc: allow explicitelly setting CLANG_FORMAT_VER
Type: improvement
Change-Id: I356b1b1804a2b09b25f5a285ada12db6879e2f6a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-23 22:22:44 +01:00
Florin Coras
982e44fcc4 vlib: add node adaptive mode flag
Don't switch nodes from interrupt to polling state unless adaptive mode
flag set. For starters, flag set only on interface input nodes
with no polling rx queue and at least one in adaptive mode.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ica1c75f605ead82b7cf74c45c6a774461008f054
2021-03-23 19:58:06 +00:00
Damjan Marion
3853b26c5d interface: reduce duplicate code in the interface-output node
Type: improvement
Change-Id: I46459a0c0a79677092aa9f8c92b67c0d06f7242e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-23 19:26:07 +01:00
Sivaprasad Tummala
04161c8f20 tls: fix tlsopenssl for remaining buffer
Type: fix

1. added additional checks for pending data in
   openssl_ctx_read_tls().
2. fixed read/write typo issues.

Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com>
Change-Id: Id018c62bb9e02bf0d5f9abf929b6030b965a5d61
2021-03-22 21:24:48 +05:30
wanghanlin
8919fec5ac vcl: fix libc epoll pwait starved
We call vls_epoll_wait with 0 timeout to process unhandled_evts_vector
in ldp_epoll_pwait_eventfd. But vls_epoll_wait will then call
vppcom_epoll_wait_eventfd to process events in event queue. If there are
continuous events to be handled, then libc_epoll_pwait have no chance to be called.

Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Ia4f61d0d438a3475bfde9f6715805274671d4e75
2021-03-22 14:23:06 +00:00
Arthur de Kerhor
156158f06d vlib: graphviz upgrade to allow filters
Possibility to draw only the active nodes on the graph.
These are scaled and colored according to their utilization.

Type: improvement
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I7ddb7b62b3a141cb03750dca24f044138fcc577f
2021-03-22 09:06:30 +00:00
Neale Ranns
bd8e43dfa0 gre: Multipoint GRE fixes
Type: fix

- the CLI was broken when a nh-table-id was present, since it overwrote
the next-hop address
- bouncing interface state stacked the adjacencies on the tunnel's
destination (which is all zeros)
- don't crash in the switch path if the interface has no hw-address

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I1ba9fdc9b2185899b753a2d40f23afa847a3ef4f
2021-03-21 18:55:01 +00:00