Compare commits

...

60 Commits

Author SHA1 Message Date
Andrew Yourtchenko
f4dcae4164 misc: 19.08.1 Release Notes
NB: due to a API-breaking fix
(https://gerrit.fd.io/r/#/c/vpp/+/21762/)
for a critical issue that was necessary, we are deferring
the artifacts for 19.08

Change-Id: If4f73dd7bc2964cb0a765ee6006b944f075a423b
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-18 16:36:13 +00:00
Jakub Grajciar
7c33c343e8 memif: always enable zero-copy when creating memif using API
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I823b6297e1d2bdd438633ec7b877960e6d8423fa
(cherry picked from commit 63882357549a39c7be4b23b48418b8febb5b0e12)
2019-09-18 13:44:07 +00:00
Ed Kern
50f8831068 build: fix rpm python 3 depends
Type: fix

Change-Id: Ie6eaccb27779bb14c0a23764a16cd22f0a72e379
Signed-off-by: Ed Kern <ejk@cisco.com>
(cherry picked from commit c63c0166ee5a4e23cb286a97ae4f196f2020e3fa)
2019-09-18 13:30:36 +00:00
Ole Troan
e6a5712624 api: split vl_api_prefix into two
One type for address with prefix and one type for prefix.

Ticket: VPP-1769
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Icfec51d9b7d5cde1d69fbecdd97498688ab7b295
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-12 13:17:40 +02:00
Dave Barach
4b943d6328 misc: clean up "pcap [rx|tx] trace" debug CLI
Separate debug CLI arg parsing from the underlying action
function. Fixes a number of subtle ordering dependencies, and will
allow us to add a binary API to control the feature at some point in
the future.

Type: refactor
Ticket: VPP-1770

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id0dbeda06dad20e756c941c691e2088ce3c50ec7
(cherry picked from commit b97641c79f4aaf0069268c550f263167ddea2b34)
2019-09-10 15:20:08 -04:00
Damjan Marion
1dafb7fd83 dpdk: initialize rte_mbuf during mempool dequeue
In some cases it may happen that buffer is allocated by DPDK, and freed
by VPP native code. In such cases dpdk metadata is not reset, so we need
to do that during mempool dequeue. Template approach is taken to reduce
cost of that operation.

Type: fix
Fixes: 910d369

Change-Id: Ic239007cfc8fbceb965021c56963cda9d53f63be
Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-09-09 16:22:27 +00:00
Filip Tehlar
4aef0dd828 dpdk: fix extended stats
Extended stats are not displayed due to incorrect condition.

Type: fix
Change-Id: Ie04664e6274137462dce832bf7ee06204cd77be5
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-09-09 16:19:23 +00:00
Dave Barach
4c19bfd93f vlib: clean up the "pcap dispatch trace" debug CLI
Separate debug CLI arg parsing from the underlying action
function. Fixes a number of subtle ordering dependencies, and will
allow us to add a binary API to control the feature at some point in
the future.

Type: refactor
Ticket: VPP-1762

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1240fe3f61a0acf5ee9faed60d6ad3386e72e569
(cherry picked from commit e5948fb49a6eeaf437323cc1043a350cd33bcd47)
2019-09-09 15:16:03 +00:00
Ole Troan
30d28bdfd8 api: enforce vla is last and fixed string type
Enforce that variable length fields are the last element of API messages.

Add a 'fixed' version of string type, since dealing with
multiple variable length strings turned out too painful
for the C language bindings.

The string type is now:
{
  string name[64]; // NUL terminated C-string. Essentially decays to u8 name[64]
  string name[];   // Variable length string with embedded len field (vl_api_string_t)
};

The latter notation could be made available to other types as well.
e.g.
{
  vl_api_address_t addresses[];
}
instead of

{
  u32 n_addr;
  vl_api_address_t addresses[n_addr];
};

Type: fix
Change-Id: I18fa17ef47227633752ab50453e8d20a652a9f9b
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit e5ff5a36dd126ee57dca4e0b03da2f7704e0a4f5)
Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-09 09:59:48 +00:00
Dave Barach
157f1cd349 ip: fix udp/tcp checksum corner cases
When checksumming chained buffers with odd lengths: insert a
NULL byte, or the calculation fails.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I380f7c42897bdb28c8c29aa1c4cdaaa849cc9ecc
(cherry picked from commit c4abafd83df38051765352785b146277734701f4)
2019-09-07 03:49:39 +00:00
Mohsin Kazmi
623a1b7053 tap: revert clean-up when linux will delete the tap interface
Type: fix
Ticket: VPP-1766

revert e4ac48e792f4eebfce296cfde844ee73b1abd62f

Change-Id: I03feea4008a47859d570ad8d1d08ff3f30d139ef
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-09-05 21:58:15 +00:00
Benoît Ganne
5f652e762e crypto: add '-maes' compile switch
AES intrinsics use builtins available only with the -maes and GCC 9 just
started to enforce it.

Type: fix

Change-Id: Ia6825ea3eae7191a4bfee47f9fa93fad16ccf76c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 561be280feb6a10834bf50e0813cc0ad3c635067)
2019-09-05 15:34:38 +00:00
Benoît Ganne
e21bb1e0c2 gbp: add unknown remote EP redirect unit test
Type: test

Change-Id: I1dfbeef08a4f112551450682fc4040820251485b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-05 11:30:26 +00:00
Benoît Ganne
bd939abcaf gbp: add remote EP redirect to remote SEP unit test
Type: test

Change-Id: I4dd685f9acd4d467e0967e6fdd428558ffc8b209
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-05 11:05:31 +02:00
Aloys Augustin
d1d4043df2 quic: handle session migration notifications
Rely on the migrate callback to move quic connections to follow the
underlying udp connection placement.

Change-Id: Ia1cf3a16187bbe48f5afb3d1f444427f288ff79c
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 243e1933bbecce0a251a5ff71c12dced9e30823f)
2019-09-04 17:42:37 +00:00
Matthew Smith
3ce1239b8e ethernet: fix dmac check avx2 loop condition
In eth_input_process_frame(), a loop which checks the destination
MAC address of received packets had a different condition for avx2
than it did for the non-avx2 version of the loop. It could result
in one unnecessary execution of the loop body after all packets
had been processed.

Type: fix
Fixes: 8d6f34e2b1cbfde5702e88686631527d5e1e10a0

Change-Id: Ib673f45917a0dea461987fdc8f0ca318b749fb1a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit a6d4e3135b70db1b1df3f8852e1e229d13c24e72)
2019-09-04 09:56:52 +00:00
Dave Barach
5bdc1f5245 vppinfra: add bihash_init2
Add controls to list / not list a specific bihash in clib_all_bihashes,
to immediately initialize a bihash.

clib_bihash_init2 is now the primary API. It takes a typical args_t
structure. clib_bihash_init becomes a compatibility widget. It
fabricates an args_t and calls init2...

Type: refactor
Ticket: VPP-1758

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib3e1304884997cf7025af20bdc67a7dda290f15b
(cherry picked from commit bdf9b97774f02458ede6b7c7ae2d5728bddba000)
2019-09-03 19:43:34 +00:00
Steven Luong
08940a2cb8 tap: interface rx counter not increment correct
vlib_increment_combined_counter takes sw_if_index, not hw_if_index. Using
hw_if_index may work as long as there is no subinterface created to cause
hw_if_index and sw_if_index to differ.

Type: fix
Ticket: VPP-1759

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6db042186eeeacf32250f7ef261af8cd6f5ce56e
(cherry picked from commit efa119db3910e77f79eb005c67f8c01b473b40a1)
2019-09-03 19:40:53 +00:00
Steven Luong
fec95f8df7 vmxnet3: interface rx counter not increment correctly
vlib_increment_combined_counter takes sw_if_index, not hw_if_index. Using
hw_if_index may work as long as there is no subinterface created to cause
hw_if_index and sw_if_index to differ.

Type: fix
Ticket: VPP-1760

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: If50412dc1e84c4f1f5b977b58d0e1aeb5ab8ebe6
(cherry picked from commit ddf625d6035d9e472bcb1a2b0197f6fd30278583)
2019-09-03 18:23:06 +00:00
Filip Varga
f98993aaa1 nat: handoff traffic matching for dynamic NAT
Type: feature

Change-Id: I5c5af6f9acb340cc674323305104b8ce23e6d21d
Signed-off-by: Filip Varga <fivarga@cisco.com>
(cherry picked from commit 22bb417e91c7bdf639b24b5edd321028f56ea04a)
2019-09-03 10:15:07 +00:00
Andrew Yourtchenko
e48f5574f7 acl: perform a sanity check of ACL rules before creating ACL
Adding acl with incorrect arguments like 1.1.1.1/24 (instead of 1.1.1.0/24)
don't cause a disaster, but doesn't match either, as some might expect.

Add an explicit sanity check which returns an error.

Type: fix

Change-Id: Id1601f4b9c9887d3e7e70aac419d1f1de0c0e012
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-02 18:49:49 +00:00
Andrew Yourtchenko
de6faf9319 ip: ip6_preflen_to_mask incorrect result for prefix len > 64
The as_u64[0] in the result was not correctly filled in for
longer prefix lengths.

Type: fix
Fixes: 1c7104514c

Change-Id: I871772c618475396d1c1c4c699ff77e35097f07e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 59ac9c23c47962fbbd935e7075ff7ee89e955847)
2019-09-02 18:30:34 +00:00
Mohsin Kazmi
404e24de56 gso: fix segmentation when gso_size greater than vlib buffer size
Type: fix
Ticket: VPP-1751

Change-Id: I5ffb078492adc97374290de404f2ec0102b75184
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 3f1964d2d2847c5307694fe8daea0a7eef1e2733)
2019-09-02 11:55:53 +00:00
John Lo
43a5b7cc44 dpdk: enable checksum offload for Intel SRIOV NIC drivers
Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I3ee59106ba45164a4ee3788bf4dcf5bf4c2dc1c2
(cherry picked from commit 03598c4bcc639cbfc9afa13c5b4e52440f9eae2b)
2019-08-30 13:24:51 +00:00
Damjan Marion
dc4161eb85 avf: properly set irq queue masks
Type: fix
Fixes: ae91180

Change-Id: I9c55c3fdf41089d337b998e2e28abb23d81525ef
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 2ca9a84bd00f2aee642d0147c1b99d4be5725a70)
2019-08-26 16:21:02 +00:00
Dave Wallace
9e25c7723d tests: move plugin tests to src/plugins/*/test
- Relocate plugin tests for 'make test' into
  src/plugins/*/test so that plugin test cases
  are co-located with the plugin source code.

Type: refactor
Ticket: VPP-1754

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I503e6a43528e14981799b735fa65674155713f67
(cherry picked from commit a43c93f8554ad7418e31be3791b3fb71232f60ac)
2019-08-23 17:31:08 -04:00
Dave Barach
46441cb9cd dns: cherry-pick 21444, 21468 from master
Type: refactor
Ticket: VPP-1752

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ieaec721056531ba0c70538c9bf97769a0e80aefd
2019-08-23 10:54:24 -04:00
Andrew Yourtchenko
1c586de48c misc: 19.08 new features
The full RELEASE.md diff is b610f2022c9f4e10a922e7b57c80ec77cd45d021

Change-Id: Ide6d85d41bdc836a03390a50ab94f6ebbaae0b28
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-21 17:46:52 +00:00
Steven Luong
01685beada devices: skip checksum calculation if guest supports checksum offload
Set VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD for the interface
to skip checksum calculation if guest supports checksum offload.

Type: fix
Ticket: VPP-1750

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ie933c3462394f07580ef7f2bec1d2eb3b075bd0c
(cherry picked from commit a75ad876401a700127ebf234fc422e76fcd57b4c)
2019-08-20 23:02:48 +00:00
Florin Coras
2ecbf6dc54 tcp: default to debug disabled
Type:fix
Ticket:VPP-1737

Change-Id: Ib5c33f0bdb3a8b1c2585135fcc8c07b151e47df3
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-20 18:14:26 +00:00
Dave Barach
14c7756ad8 dns: handle multiple replies for single requests
The world is a mess. A single DNS request may yield multiple, subtly
different responses; all with the same DNS protocol-level ID.

Last response wins in terms of what ends up in the cache.

First response wins in terms of the response sent to the client. Hard
to do otherwise since we have no clue that more than one answer will
be forthcoming.

Type: fix
Ticket: VPP-1749
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3175a40eb1fea237048d16b852a430f5ab51eaef
(cherry picked from commit e8d2dcb6a619f0884ece2284a286f21b3aa77e5a)
2019-08-20 12:48:52 +00:00
Andrew Yourtchenko
b610f2022c misc: VPP 19.08 Release Notes
Change-Id: I81c7ad50c66b4b8d690e87aad1f3c16af065fc85
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-20 11:50:19 +00:00
Dave Barach
28c6e5cfdb dhcp: resolver process node index in main_t
Remove the (unused) node_registration_t, don't try to use it to signal
resolution events.

Type: fix
Ticket: VPP-1746

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ice975e32152892ac4100b9e758412d48a43f09f1
(cherry picked from commit 018c14b7dbc5a910693f150045bfa803c4ae4eec)
2019-08-19 09:23:20 +00:00
Mohsin Kazmi
6bde1f4cd1 gso: fix l3 and l4 header offset in case of tagged interface
previously, PG and virtio interfaces calculate wrong l3 and l4
header offset. This patch fixes this issue.

Type: fix
Ticket: VPP-1739

Change-Id: I5ba978e464babeb65e0711e1027320d46b3b9932
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 14bea1bb6505c0134dd5d2a18bcc436ce72cd149)
2019-08-19 08:39:57 +00:00
Mohsin Kazmi
859c6a5d01 gso: fix the segmentation to use current_data offset
Type: fix
Ticket: VPP-1740

Change-Id: If3e34b5b8260e4c50af338895066c2c96f4603af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 0a5734372d7176146126f83f51b0b9062f90fe94)
2019-08-18 22:02:42 +00:00
Mohsin Kazmi
62e4d84220 gso: remove the ip checksum flag in case of ipv6
Type: fix
Ticket: VPP-1727

Change-Id: Icfee35c5ab5e1c65079d1ca7bb514162319113e5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 7dfcf7f1f504f5e8283c54a428805cc3a4aa8da9)
2019-08-17 00:36:40 +00:00
Florin Coras
4222fb1835 tcp: fix cc algo name parsing
Type: fix

The initial config parser passed a pointer to the field algo id field in
tcp main. Because the field is a u8 and it was interpreted as a uword,
it ended up overwrting other tcp configuration fields.

Change-Id: Ie9020051c8fca40e14cf42a9888daa87360e5038
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d25d364d2bc146d3e17ab7c4d558bcb0ce138b89)
2019-08-16 14:30:25 +00:00
John Lo
a5766fe139 vlib: copy trace_handle in vlib_buffer_copy/clone() functions
Since vlib_buffer_copy() and vlib_buffer_clone() both preserve
VLIB_BUFFER_IS_TRACED bit in flags field, it should also copy
trace_handle which would add minimal overhead. Thus, callers of
these functions do not have to call vlib_buffer_copy_trace_flags()
to copy trace_handle.

Type: refactor
Ticket: VPP-1745

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: Iff6a3f81660dd62b36a2966033eb380305340310
(cherry picked from commit 6631780422787166550b9871c46a94c160416324)
Signed-off-by: John Lo <loj@cisco.com>
2019-08-15 15:26:46 -04:00
Andrew Yourtchenko
4c945dacb9 acl: fix stats-segment counters validation on acl update
The stats-segment validation/clear logic for acl counters was wrong,
fix it. Also add the code to the unittests to cover that case,
add a vat command to enable/disable counters, clean up
the unnecessary endian conversion and remove the stray clib_warning()

Change-Id: I421297a92e4aeb885c468c72a97cec25981df615
Type: fix
Ticket: VPP-1744
Fixes: f995c7122ba0d024b17bc3232e8edd18d5e25088
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-15 15:22:11 +00:00
Florin Coras
2f51729bb3 tcp: extend protocol configuration
Type: feature
Ticket: VPP-1736

Expose more configuration parameters and refactor some of the existing
ones.

Change-Id: If44c31ff77ce3d7e8da67d39a4ff61346bdf5ccc
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 9094b5c319d3f072d3c248fe7c876e4048c13ac2)
2019-08-14 16:27:49 +00:00
Guanghua Zhang
bb83b16a3c svm: fix svmtool and svmdbtool segment fault.
Type: fix
Ticket: VPP-1741

Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com>
Change-Id: Ifd3abaa5ec912378dbc7b73c4863aad26777dd7e
(cherry picked from commit 60f16c22b44625d517830b4266a225d3abaccefc)
2019-08-14 15:10:31 +00:00
Benoît Ganne
8ef151c900 gbp: do not scan gbp bihash if not instantiated
Type: fix
Fixes: 32dcd3b2f227dec638c39ade0c58d6741d83ec30

Change-Id: I42550fcc5b3fa486a05770d3e220d7a86315628e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-08-14 09:46:37 +02:00
Florin Coras
3a7457201c session: fix enqueue notification on 32bit systems
Type: fix
Ticket: VPP-1736

Change-Id: I7b5566525fc30fe0d3cc8cd991960f6ed2f1fc27
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 5d8a806144fbf46c0575ef24ae081724dfbdbe75)
2019-08-13 17:34:16 +00:00
Ian Wells
0325c021f4 papi: Revert vpp-api-python to py2, add py3 pkg
A previous commit, ca3d38ae18c21ce37212f0d5d5f4a1702429e70c, converts
the vpp-api-python package from a python2 library to a python3 one.
This changes the behaviour of the package and breaks anything that
uses it as a dependency.

This change reverts the package behaviour to a python2 package, and
additionally adds a *separate* python3 package for correct python3
behaviour.

Type: fix
Fixes: VPP-1738
Signed-Off-By: Ian Wells <iawells@cisco.com>
Change-Id: I54eb45156eb6e00fc4cd5b48e7a0aa17fd2f43f7
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 13cef0cc2cba4cff22bb5a860a8709cb3cfd35b2)
2019-08-13 08:04:41 +00:00
Alberto Compagno
63cafb331d fib: add adj_midchain.h to the list of files to install in the include path
Type: fix
Ticket: VPP-1735

Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Change-Id: I7063516a60bb211ad91ef04041b2751ca3f6598e
2019-08-13 08:00:23 +00:00
Dave Barach
d34e0cb0c8 http_static: manual cherry-pick 21231,21246
Type: fix
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ie34d1b7d7030c160972f3173a4401ef632e38633
2019-08-12 22:33:03 +00:00
Florin Coras
eda581e443 tcp: handle fin+rst+syn in closing state
Type: fix
Ticket: VPP-1736

Change-Id: I32d4d4a5de04e89087f4ab4a5c425eda572932a8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-12 18:35:16 +00:00
Dave Barach
78cc42d608 http_static: tls support
Type: refactor
Ticket: VPP-1736

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I45745e568cd943293d0015a61f67ec799b6804d8
(cherry picked from commit 6b53fd5163de7d1f452b472ec3ad945f4dbd694c)
2019-08-12 17:34:15 +00:00
Ole Troan
af8075529f api: vppapitrace JSON/API trace converter
Usage: vppapitrace.py [-h] [--debug] [--apidir APIDIR] {convert,replay} ...

optional arguments:
  -h, --help        show this help message and exit
  --debug           enable debug mode
  --apidir APIDIR   Location of JSON API definitions

subcommands:
  valid subcommands

  {convert,replay}  additional help
    convert         Convert API trace to JSON or Python and back
    replay          Replay messages to running VPP instance

To convert an API trace file to JSON:
vppapitrace convert /tmp/api.trace trace.json

To convert an (edited) JSON file back to API trace for replay:
vppapitrace convert trace.json api-edited.trace

To generate a Python file that can be replayed:
vppapitrace convert /tmp/api.trace trace.py
vppapitrace convert trace.json trace.py

Replay it to a running VPP instance:
vppapitrace replay --socket /tmp/api.trace

In VPP that file can be replayed with:
vpp# api trace replay api-edited.trace

This patch also modifies the API binary trace format, to include the
message id to message name table.

Ticket: VPP-1733
Change-Id: Ie6441efb53c1c93c9f778f6ae9c1758bccc8dd87
Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit edfe2c0079a756f5fb1108037c39450e3521c8bd)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-12 12:37:37 +00:00
John Lo
3d674e86b7 vlib: fix vlib_buffer_copy to preserve buffer flags bit
Make vlib_buffer_copy() preserve buffer flags bit the same way as
that of vlib_buffer_clone() so both are consistent.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I6c32aa1e88724b482ce2439d82019e690311b664
(cherry picked from commit 8ed2d524aa401a89547a1e059528f8a34bb8895f)
2019-08-10 13:58:23 +00:00
Florin Coras
28d86217bf tls: mark as no lookup transport
Type:fix

Also fix transport close while handshake is ongoing.

Change-Id: I004c56d2297d0847c2cb77202f8fba3edaacad29
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d09236d17d86a5d50166b2017f8f30a560c6e1b8)
2019-08-09 19:19:31 +00:00
Florin Coras
a932a34a22 udp: fix rx event generation
When session is owned by another thread, avoid postponing the generation
of the rx event.

Type:fix

Change-Id: Ie6afc8116ce40e83d8aae0432b48e19b31287d8b
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 9cbf6818b37275199b6c0ebef0ef3d8ecaac0a3b)
2019-08-09 16:58:17 +00:00
Florin Coras
ec25b91ad3 session: allow closed transports to send
Type:fix

Transports like tcp may notify session layer of a close but they may
defer the connection's deletion (e.g., tcp time-wait). During that time,
transports may still want to send packets. So, unless the session has no
transport (transport-deleted state), allow the transport to send.

Change-Id: I3ae335c7b951ff64be8529a5e3f3ad790feddc84
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit a678974cc52ac61dd6094c3f6649f9e3202be1cb)
2019-08-09 16:25:14 +00:00
Florin Coras
1403fe6047 tls: handle transport reset
Type:fix

Change-Id: I5994fb53dc4b9fd58920b3d67472c38b41db27c2
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f03c49413f270386d46a82dd9a3bce819cf81250)
2019-08-09 15:10:18 +00:00
Florin Coras
58e95bc2cd svm: fix fifo max writeable chunk computation
Type:fix

Change-Id: I60fdd7651a3d3fac505e7aec7a41f9d096022895
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fcd26a039409e2697a6797e74b0c45544503e853)
2019-08-09 13:53:03 +00:00
Florin Coras
0f0ff02a93 tls: fix close with data
Type:fix

Also changes the way the ctx is freed. TLS now waits for tcp delete
notification before freeing the ctx.

Change-Id: I2f606a9ce7b3755ae9d11d6fe714fe11b65dcb98
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit ef2b3357b4b2a682ef81ffa2c71cec14f83101d6)
2019-08-09 13:52:29 +00:00
Florin Coras
c9a9f5d347 tcp: fix zero rwnd sent check
Type:fix

Change-Id: I1e6f2cb28c1bf544cc3d060b11c8935f9edb0eed
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d1ba3d257788f1a65016a50a53d85f2b905874bb)
2019-08-09 13:52:02 +00:00
Florin Coras
c7f0fe030f tcp: cleanup timers
Type:refactor

Change-Id: I37dbc8b55827d66c2578d6ab8b86ed7e18198aa6
Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-09 13:51:40 +00:00
Aloys Augustin
7119c22f82 udp: fix connections move
Without this the use of uc0 is racy between the current thread and the
thread that owns it and will delete it.

This also ensures we don't trigger a read event on the session before
moving it to the right thread and notifying the application.

Type: fix
Change-Id: Icb1ca3ee5805ea3c0d2d424d4b23511465deb3b6
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit b3392334942ed5459edfa7f11e098f4eab3aa29a)
2019-08-08 02:25:24 +00:00
Andrew Yourtchenko
23526f78a8 docs: Initial changes for stable/1908 branch
This patch adds an entry for the defaultbranch
in .gitreview

Change-Id: Icb772912db57db055aec94d3a6a3cba21ba00876
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-07 17:30:04 +00:00
170 changed files with 6699 additions and 2211 deletions

View File

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

View File

@ -300,6 +300,11 @@ Y: src/plugins/flowprobe/FEATURE.yaml
M: Ole Troan <otroan@employees.org>
F: src/plugins/flowprobe/
Plugin - http_static
I: http_static
M: Dave Barach <dbarach@cisco.com>
F: src/plugins/http_static/
Plugin - Group Based Policy (GBP)
I: gbp
M: Neale Ranns <nranns@cisco.com>
@ -389,6 +394,11 @@ I: nsim
M: Dave Barach <dave@barachs.net>
F: src/plugins/nsim/
Plugin - Simple DNS name resolver
I: dns
M: Dave Barach <dave@barachs.net>
F: src/plugins/dns/
Test Infrastructure
I: tests
M: Klement Sekera <ksekera@cisco.com>
@ -435,6 +445,11 @@ I: vppapigen
M: Ole Troan <otroan@employees.org>
F: src/tools/vppapigen/
API trace tool
I: vppapitrace
M: Ole Troan <otroan@employees.org>
F: src/tools/vppapitrace/
Binary API Compiler for C and C++
I: vapi
M: Ole Troan <ot@cisco.com>

View File

@ -101,7 +101,7 @@ else
RPM_DEPENDS += yum-utils
RPM_DEPENDS += openssl-devel
RPM_DEPENDS += python-devel python36-ply
RPM_DEPENDS += python36-devel python36-pip
RPM_DEPENDS += python3-devel python3-pip
RPM_DEPENDS += python-virtualenv python36-jsonschema
RPM_DEPENDS += devtoolset-7
RPM_DEPENDS += cmake3

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@ This section provides information about the features that are provided for each
.. toctree::
:maxdepth: 1
vpp1908
vpp1904
vpp1901
vpp18.10

View File

@ -0,0 +1,140 @@
## Features for Release VPP 19.08
### Infrastructure
- API
- API language: new types and limits support
- Python API - add support for defaults
- Export ip_types.api for out-of-tree plugins use
- Refactor ipip.api with explicit types
- DPDK
- 19.05 integration
- Remove bonding code
- Rework extended stats
- Debugging & Servicability
- debug CLI leak-checker
- vlib: add "memory-trace stats-segment"
- vppapitrace JSON/API trace converter
- ARP: add arp-disabled node
- igmp: Trace more data from input packets
- ip: Trace the packet from the punt node
- Python API debug introspection improvements
- Pin dependencies for make test infra
- FEATURE.yaml meta-data infrastructure
- tcp: add cc stats plotting tools
- Packet tracer support for thread handoffs
- libmemif: support for multi-thread connection establishment
- svm
- fifo ooo reads/writes with multiple chunks
- support addition/removal of chunks to fifos
- vppinfra
- Mapped pcap file support
- More AVX2 and AVX512 inlines
- VLIB_INIT_FUNCTION sequencing rework
- refactor spinlocks and rwlocks
- add rbtree
- add doubly linked list
- rdma: bump rdma-core to v25.0
- stats
- Add the number of worker threads and per worker thread vector rates
- Support multiple workers for error counters
### VNET & Plugins
- New Plugins
- HTTP static page server with TLS support
- L3 cross connect
- acl: implement stat-segment counters
- arp: add feature arcs: arp-reply, arp-input, arp-proxy
- avf: improved logging and added 2.5/5 Gbps speeds
- bonding: NUMA-related improvements
- crypto: add support for AES-CTR cipher
- fib
- FIB Entry tracking
- Support the POP of a Pseudo Wire Control Word
- gbp
- Anonymous l3-out subnets support
- ARP unicast forward in gbp bridge domain
- An Endpoint can change sclass
- Consider data-plane learnt source better than control-plane
- VRF scoped contracts
- gso (experimental)
- Add support to pg interfaces
- Add support to vhost user
- Add support to native virtio
- Add support for tagged interfaces
- punt: allow to specify packets by IP protocol Type
- ip6-local: hop-by-hop protocol demux table
- ipsec
- intel-ipsec-mb version 0.52
- AH encrypt rework
- handle UDP keepalives
- support GCM in ESP
- virtio
- Refactor control queue support
- dhcp-client: DSCP marking for transmitted packets
- Idle resource usage improvements
- Allocate bihash virtual space on demand
- gre: don't register gre input nodes unless a gre tunnel is created
- gtpu: don't register udp ports unless a tunnel is created
- lacp: create lacp-process on demand
- lisp-cp: start lisp retry service on demand
- start the cdp period and dns resolver process on demand
- vat: unload unused vat plugins
- nat: api cleanup & update
- nsim: make available as an output feature
- load-balance performance improvements
- l2: Add support for arp unicast forwarding
- mactime
- Mini-ACLs
- Per-MAC allow-with-quota feature
- qos
- QoS dump APIs
- Store function
- rdma: add support for promiscuous mode (l2-switching and xconnect)
- sr: update the Segment Routing definition to be compliant with current in IETF
- udp-ping: disable due to conflict with mldv2
- vxlan-gpe: improve encap performance
- vom
- QoS support
- Bridge domain arp unicast forwarding flag
- Bridge domain unknown unicast flooding flag
### Host stack
- session
- API to support manual svm fifo resizing
- Improved session output scheduler and close state machine
- Transport and session cleanup notifications for builtin apps
- Session migration notifications for builtin apps
- Support for no session layer lookup transports (quic and tls)
- Ability to retrieve local/remote endpoint in transport vft
- Cleanup segment manager and fifo segment
- Fix vpp to app msg generation on enqueue fail
- Improve event logging
- Moved test applications to hsa plugin
- tcp
- Congestion control algorithm enhancements
- Delivery rate estimator
- ACK/retransmission refactor and pacing
- Add tcp-input sibling nodes without full 6-tuple lookup
- More RFC4898 connection statistics
- Allow custom output next node
- Allow custom congestion control algorithms
- quic
- Multi-thread support
- Logs readability improvements
- Multistream support
- tls
- Fix close with data and listen failures
- Handle TCP transport rests
- Support endpoint retrieval interface
- vcl
- support quic streams and "connectable listeners"
- worker unregister api
- fix epoll with large events batch
- ldp: add option to eanble transparent TLS connections
- udp:
- support close with data
- fixed session migration
- sctp
- add option to enable/disable default to disable
- moved from vnet to plugins

6
extras/http/setup.http Normal file
View File

@ -0,0 +1,6 @@
set term pag off
create tap host-if-name lstack host-ip4-addr 192.168.10.2/24
set int ip address tap0 192.168.10.1/24
set int state tap0 up
http static server www-root /scratch/fdio-site-fork/public uri tls://0.0.0.0/1234 cache-size 10m fifo-size 2048

7
extras/http/startup.cfg Normal file
View File

@ -0,0 +1,7 @@
unix {
interactive
}
tls {
use-test-cert-in-ca
}

276
extras/oddbuf/setup.oddbuf Normal file
View File

@ -0,0 +1,276 @@
set term pag off
loop create
set int state loop0 up
oddbuf enable loop0
packet-generator new {
name oddbuf
limit 1
size 300-300
interface loop0
node ethernet-input
data { IP4: 1.2.3 -> 4.5.6
UDP: 11.22.33.44 -> 11.22.34.44
UDP: 1234 -> 2345
incrementing 286
}
}
pcap dispatch trace on max 10000 buffer-trace pg-input 1000
oddbuf configure n_to_copy 2 offset 1 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 1 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 2 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 3 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 4 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 5 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 6 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 7 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 0 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 1 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 2 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 3 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 4 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 5 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 6 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 7 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 0 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 1 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 2 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 3 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 4 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 5 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 6 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 7 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 0 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 1 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 2 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 3 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 4 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 5 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 6 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 7 first_offset 5
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 1 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 1 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 2 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 3 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 4 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 5 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 6 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 2 offset 7 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 0 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 1 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 2 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 3 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 4 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 5 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 6 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 3 offset 7 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 0 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 1 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 2 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 3 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 4 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 5 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 6 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 4 offset 7 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 0 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 1 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 2 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 3 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 4 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 5 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 6 first_offset 0
pa en oddbuf
suspend
oddbuf configure n_to_copy 5 offset 7 first_offset 0
pa en oddbuf
suspend
pcap dispatch trace off

View File

@ -0,0 +1,34 @@
set term pag off
loop create
loop create
set int ip address loop0 192.168.1.1/24
set int state loop0 up
set int ip address loop1 192.168.2.1/24
set int state loop1 up
packet-generator new {
name pg0
limit 1
size 300-300
interface loop0
node ethernet-input
data { IP4: 1.2.3 -> 4.5.6
UDP: 192.168.1.10 -> 192.168.2.10
UDP: 1234 -> 2345
incrementing 286
}
}
packet-generator new {
name pg1
limit 1
size 300-300
interface loop1
node ethernet-input
data { IP4: 1.2.3 -> 4.5.6
UDP: 192.168.2.10 -> 192.168.1.10
UDP: 1234 -> 2345
incrementing 286
}
}

View File

@ -10,6 +10,17 @@
%endif
%define _vpp_install_dir install-%{_vpp_tag}-native
# Failsafe backport of Python2-macros for RHEL <= 6
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
%{!?__python2: %global __python2 %{__python}}
%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}}
%{!?python2_version: %global python2_version %{python_version}}
%{!?python2_minor_version: %define python2_minor_version %(%{__python} -c "import sys ; print sys.version[2:3]")}
%{?systemd_requires}
@ -39,12 +50,13 @@ BuildRequires: systemd, chrpath
BuildRequires: check, check-devel
BuildRequires: mbedtls-devel mbedtls
%if 0%{?fedora}
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python3
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
Requires: compat-openssl10
Requires: boost-filesystem mbedtls libffi-devel
BuildRequires: subunit, subunit-devel
BuildRequires: compat-openssl10-devel
BuildRequires: python3-devel, python3-virtualenv
BuildRequires: python, python-devel, python-virtualenv, python-ply
BuildRequires: python3, python36-devel, python3-virtualenv
BuildRequires: cmake
%else
%if 0%{rhel} == 7
@ -128,6 +140,15 @@ Requires: python-setuptools
%description api-python
This package contains the python bindings for the vpp api
%package api-python3
Summary: VPP api python3 bindings
Group: Development/Libraries
Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
Requires: python-setuptools
%description api-python3
This package contains the python3 bindings for the vpp api
%package selinux-policy
Summary: VPP Security-Enhanced Linux (SELinux) policy
Group: System Environment/Base
@ -154,6 +175,7 @@ groupadd -f -r vpp
make bootstrap AESNI=n
make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
%endif
cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build
cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
@ -210,6 +232,7 @@ do
done
# Python bindings
cd %{_mu_build_dir}/../src/vpp-api/python && %py2_install
cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
# SELinux Policy
@ -366,6 +389,10 @@ fi
%files api-python
%defattr(644,root,root,755)
%{python2_sitelib}/vpp_*
%files api-python3
%defattr(644,root,root,755)
%{python3_sitelib}/vpp_*
%files selinux-policy

View File

@ -391,17 +391,50 @@ validate_and_reset_acl_counters (acl_main_t * am, u32 acl_index)
/* filled in once only */
am->combined_acl_counters[i].stat_segment_name = (void *)
format (0, "/acl/%d/matches%c", i, 0);
clib_warning ("add stats segment: %s",
am->combined_acl_counters[i].stat_segment_name);
i32 rule_count = vec_len (am->acls[acl_index].rules);
i32 rule_count = vec_len (am->acls[i].rules);
/* Validate one extra so we always have at least one counter for an ACL */
vlib_validate_combined_counter (&am->combined_acl_counters[i],
rule_count);
vlib_zero_combined_counter (&am->combined_acl_counters[i], rule_count);
vlib_clear_combined_counters (&am->combined_acl_counters[i]);
}
/* (re)validate for the actual ACL that is getting added/updated */
i32 rule_count = vec_len (am->acls[acl_index].rules);
/* Validate one extra so we always have at least one counter for an ACL */
vlib_validate_combined_counter (&am->combined_acl_counters[acl_index],
rule_count);
vlib_clear_combined_counters (&am->combined_acl_counters[acl_index]);
acl_plugin_counter_unlock (am);
}
static int
acl_api_ip4_invalid_prefix (void *ip4_pref_raw, u8 ip4_prefix_len)
{
ip4_address_t ip4_addr;
ip4_address_t ip4_mask;
ip4_address_t ip4_masked_addr;
memcpy (&ip4_addr, ip4_pref_raw, sizeof (ip4_addr));
ip4_preflen_to_mask (ip4_prefix_len, &ip4_mask);
ip4_masked_addr.as_u32 = ip4_addr.as_u32 & ip4_mask.as_u32;
return (ip4_masked_addr.as_u32 != ip4_addr.as_u32);
}
static int
acl_api_ip6_invalid_prefix (void *ip6_pref_raw, u8 ip6_prefix_len)
{
ip6_address_t ip6_addr;
ip6_address_t ip6_mask;
ip6_address_t ip6_masked_addr;
memcpy (&ip6_addr, ip6_pref_raw, sizeof (ip6_addr));
ip6_preflen_to_mask (ip6_prefix_len, &ip6_mask);
ip6_masked_addr.as_u64[0] = ip6_addr.as_u64[0] & ip6_mask.as_u64[0];
ip6_masked_addr.as_u64[1] = ip6_addr.as_u64[1] & ip6_mask.as_u64[1];
return (ip6_masked_addr.as_u64[0] != ip6_addr.as_u64[0]
|| ip6_masked_addr.as_u64[1] != ip6_addr.as_u64[1]);
}
static int
acl_add_list (u32 count, vl_api_acl_rule_t rules[],
u32 * acl_list_index, u8 * tag)
@ -416,6 +449,43 @@ acl_add_list (u32 count, vl_api_acl_rule_t rules[],
clib_warning ("API dbg: acl_add_list index %d tag %s", *acl_list_index,
tag);
/* check if what they request is consistent */
for (i = 0; i < count; i++)
{
if (rules[i].is_ipv6)
{
if (rules[i].src_ip_prefix_len > 128)
return VNET_API_ERROR_INVALID_VALUE;
if (rules[i].dst_ip_prefix_len > 128)
return VNET_API_ERROR_INVALID_VALUE;
if (acl_api_ip6_invalid_prefix
(&rules[i].src_ip_addr, rules[i].src_ip_prefix_len))
return VNET_API_ERROR_INVALID_SRC_ADDRESS;
if (acl_api_ip6_invalid_prefix
(&rules[i].dst_ip_addr, rules[i].dst_ip_prefix_len))
return VNET_API_ERROR_INVALID_DST_ADDRESS;
}
else
{
if (rules[i].src_ip_prefix_len > 32)
return VNET_API_ERROR_INVALID_VALUE;
if (rules[i].dst_ip_prefix_len > 32)
return VNET_API_ERROR_INVALID_VALUE;
if (acl_api_ip4_invalid_prefix
(&rules[i].src_ip_addr, rules[i].src_ip_prefix_len))
return VNET_API_ERROR_INVALID_SRC_ADDRESS;
if (acl_api_ip4_invalid_prefix
(&rules[i].dst_ip_addr, rules[i].dst_ip_prefix_len))
return VNET_API_ERROR_INVALID_DST_ADDRESS;
}
if (ntohs (rules[i].srcport_or_icmptype_first) >
ntohs (rules[i].srcport_or_icmptype_last))
return VNET_API_ERROR_INVALID_VALUE_2;
if (ntohs (rules[i].dstport_or_icmpcode_first) >
ntohs (rules[i].dstport_or_icmpcode_last))
return VNET_API_ERROR_INVALID_VALUE_2;
}
if (*acl_list_index != ~0)
{
/* They supplied some number, let's see if this ACL exists */
@ -1945,7 +2015,7 @@ static void
vl_api_acl_stats_intf_counters_enable_reply_t *rmp;
int rv;
rv = acl_stats_intf_counters_enable_disable (am, ntohl (mp->enable));
rv = acl_stats_intf_counters_enable_disable (am, mp->enable);
REPLY_MACRO (VL_API_ACL_DEL_REPLY);
}

View File

@ -68,7 +68,8 @@ _(acl_interface_add_del_reply) \
_(macip_acl_interface_add_del_reply) \
_(acl_interface_set_acl_list_reply) \
_(acl_interface_set_etype_whitelist_reply) \
_(macip_acl_del_reply)
_(macip_acl_del_reply) \
_(acl_stats_intf_counters_enable_reply)
#define foreach_reply_retval_aclindex_handler \
_(acl_add_replace_reply) \
@ -310,7 +311,8 @@ _(MACIP_ACL_INTERFACE_ADD_DEL_REPLY, macip_acl_interface_add_del_reply) \
_(MACIP_ACL_INTERFACE_GET_REPLY, macip_acl_interface_get_reply) \
_(ACL_PLUGIN_CONTROL_PING_REPLY, acl_plugin_control_ping_reply) \
_(ACL_PLUGIN_GET_VERSION_REPLY, acl_plugin_get_version_reply) \
_(ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES_REPLY,acl_plugin_get_conn_table_max_entries_reply)
_(ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES_REPLY,acl_plugin_get_conn_table_max_entries_reply) \
_(ACL_STATS_INTF_COUNTERS_ENABLE_REPLY, acl_stats_intf_counters_enable_reply)
static int api_acl_plugin_get_version (vat_main_t * vam)
{
@ -574,6 +576,36 @@ static int api_acl_plugin_get_conn_table_max_entries (vat_main_t * vam)
return ret;
}
static int api_acl_stats_intf_counters_enable (vat_main_t * vam)
{
acl_test_main_t * sm = &acl_test_main;
unformat_input_t * i = vam->input;
vl_api_acl_stats_intf_counters_enable_t * mp;
u32 msg_size = sizeof(*mp);
int ret;
vam->result_ready = 0;
mp = vl_msg_api_alloc_as_if_client(msg_size);
memset (mp, 0, msg_size);
mp->_vl_msg_id = ntohs (VL_API_ACL_STATS_INTF_COUNTERS_ENABLE + sm->msg_id_base);
mp->client_index = vam->my_client_index;
mp->enable = 1;
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) {
if (unformat (i, "disable"))
mp->enable = 0;
else
break;
}
/* send it... */
S(mp);
/* Wait for a reply... */
W (ret);
return ret;
}
/*
* Read the series of ACL entries from file in the following format:
@ -1485,7 +1517,8 @@ _(macip_acl_del, "<acl-idx>")\
_(macip_acl_dump, "[<acl-idx>]") \
_(macip_acl_interface_add_del, "<intfc> | sw_if_index <if-idx> [add|del] acl <acl-idx>") \
_(macip_acl_interface_get, "") \
_(acl_plugin_get_conn_table_max_entries, "")
_(acl_plugin_get_conn_table_max_entries, "") \
_(acl_stats_intf_counters_enable, "[disable]")
static

View File

@ -103,9 +103,11 @@ class TestACLpluginL2L3(VppTestCase):
half = cls.remote_hosts_count // 2
cls.pg0.remote_hosts = cls.loop0.remote_hosts[:half]
cls.pg1.remote_hosts = cls.loop0.remote_hosts[half:]
reply = cls.vapi.papi.acl_stats_intf_counters_enable(enable=1)
@classmethod
def tearDownClass(cls):
reply = cls.vapi.papi.acl_stats_intf_counters_enable(enable=0)
super(TestACLpluginL2L3, cls).tearDownClass()
def tearDown(self):
@ -471,6 +473,7 @@ class TestACLpluginL2L3(VppTestCase):
acls=[acl_idx['L2']])
self.applied_acl_shuffle(self.pg0.sw_if_index)
self.applied_acl_shuffle(self.pg2.sw_if_index)
return {'L2': acl_idx['L2'], 'L3': acl_idx['L3']}
def apply_acl_ip46_both_directions_reflect(self,
primary_is_bridged_to_routed,
@ -531,13 +534,21 @@ class TestACLpluginL2L3(VppTestCase):
def apply_acl_ip46_routed_to_bridged(self, test_l2_deny, is_ip6,
is_reflect, add_eh):
self.apply_acl_ip46_x_to_y(False, test_l2_deny, is_ip6,
is_reflect, add_eh)
return self.apply_acl_ip46_x_to_y(False, test_l2_deny, is_ip6,
is_reflect, add_eh)
def apply_acl_ip46_bridged_to_routed(self, test_l2_deny, is_ip6,
is_reflect, add_eh):
self.apply_acl_ip46_x_to_y(True, test_l2_deny, is_ip6,
is_reflect, add_eh)
return self.apply_acl_ip46_x_to_y(True, test_l2_deny, is_ip6,
is_reflect, add_eh)
def verify_acl_packet_count(self, acl_idx, packet_count):
matches = self.statistics.get_counter('/acl/%d/matches' % acl_idx)
self.logger.info("stat seg for ACL %d: %s" % (acl_idx, repr(matches)))
total_count = 0
for p in matches[0]:
total_count = total_count + p['packets']
self.assertEqual(total_count, packet_count)
def run_traffic_ip46_x_to_y(self, bridged_to_routed,
test_l2_deny, is_ip6,
@ -560,34 +571,41 @@ class TestACLpluginL2L3(VppTestCase):
packet_count = self.get_packet_count_for_if_idx(self.loop0.sw_if_index)
rcvd1 = rx_if.get_capture(packet_count)
self.verify_capture(self.loop0, self.pg2, rcvd1, bridged_to_routed)
return len(stream)
def run_traffic_ip46_routed_to_bridged(self, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp=False):
self.run_traffic_ip46_x_to_y(False, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp)
return self.run_traffic_ip46_x_to_y(False, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp)
def run_traffic_ip46_bridged_to_routed(self, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp=False):
self.run_traffic_ip46_x_to_y(True, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp)
return self.run_traffic_ip46_x_to_y(True, test_l2_deny, is_ip6,
is_reflect, is_established, add_eh,
stateful_icmp)
def run_test_ip46_routed_to_bridged(self, test_l2_deny,
is_ip6, is_reflect, add_eh):
self.apply_acl_ip46_routed_to_bridged(test_l2_deny,
is_ip6, is_reflect, add_eh)
self.run_traffic_ip46_routed_to_bridged(test_l2_deny, is_ip6,
is_reflect, False, add_eh)
acls = self.apply_acl_ip46_routed_to_bridged(test_l2_deny,
is_ip6, is_reflect,
add_eh)
pkts = self.run_traffic_ip46_routed_to_bridged(test_l2_deny, is_ip6,
is_reflect, False,
add_eh)
self.verify_acl_packet_count(acls['L3'], pkts)
def run_test_ip46_bridged_to_routed(self, test_l2_deny,
is_ip6, is_reflect, add_eh):
self.apply_acl_ip46_bridged_to_routed(test_l2_deny,
is_ip6, is_reflect, add_eh)
self.run_traffic_ip46_bridged_to_routed(test_l2_deny, is_ip6,
is_reflect, False, add_eh)
acls = self.apply_acl_ip46_bridged_to_routed(test_l2_deny,
is_ip6, is_reflect,
add_eh)
pkts = self.run_traffic_ip46_bridged_to_routed(test_l2_deny, is_ip6,
is_reflect, False,
add_eh)
self.verify_acl_packet_count(acls['L2'], pkts)
def run_test_ip46_routed_to_bridged_and_back(self, test_l2_action,
is_ip6, add_eh,

View File

@ -693,7 +693,8 @@ avf_op_config_irq_map (vlib_main_t * vm, avf_device_t * ad)
imi->vecmap[0].vector_id = 1;
imi->vecmap[0].vsi_id = ad->vsi_id;
imi->vecmap[0].rxq_map = 1;
imi->vecmap[0].rxq_map = (1 << ad->n_rx_queues) - 1;
imi->vecmap[0].txq_map = (1 << ad->n_tx_queues) - 1;
avf_log_debug (ad, "config_irq_map: vsi_id %u vector_id %u rxq_map %u",
ad->vsi_id, imi->vecmap[0].vector_id,

View File

@ -29,6 +29,6 @@ foreach(VARIANT ${VARIANTS})
set(l crypto_ia32_${v})
add_library(${l} OBJECT aes_cbc.c aes_gcm.c)
set_target_properties(${l} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${l} PUBLIC ${f} -Wall -fno-common)
target_compile_options(${l} PUBLIC ${f} -Wall -fno-common -maes)
target_sources(crypto_ia32_plugin PRIVATE $<TARGET_OBJECTS:${l}>)
endforeach()

View File

@ -33,7 +33,7 @@ if(IPSECMB_INCLUDE_DIR AND IPSECMB_LIB)
${IPSECMB_LINK_FLAGS}
)
target_compile_options(crypto_ipsecmb_plugin PRIVATE "-march=silvermont")
target_compile_options(crypto_ipsecmb_plugin PRIVATE "-march=silvermont" "-maes")
message(STATUS "Intel IPSecMB found: ${IPSECMB_INCLUDE_DIR}")
else()
message(STATUS "Intel IPSecMB not found")

View File

@ -0,0 +1,33 @@
# Copyright (c) <current-year> <your-organization>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_vpp_plugin(dns
SOURCES
dns.c
dns.h
request_node.c
reply_node.c
resolver_process.c
API_FILES
dns.api
INSTALL_HEADERS
dns_all_api_h.h
dns_msg_enum.h
dns_packet.h
API_TEST_SOURCES
dns_test.c
)

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
option version = "1.0.0";
/** \brief enable/disable name resolution
@ -21,7 +21,7 @@ option version = "1.0.0";
@param context - sender context, to match reply w/ request
@param is_enable - 1 = enable, 0 = disable
*/
autoreply define dns_enable_disable {
autoreply manual_print define dns_enable_disable {
u32 client_index;
u32 context;
u8 enable;
@ -35,7 +35,7 @@ autoreply define dns_enable_disable {
@param is_add - add = 1, delete = 0
@param server_address - server ip address
*/
autoreply define dns_name_server_add_del {
autoreply manual_print define dns_name_server_add_del {
u32 client_index;
u32 context;
u8 is_ip6;
@ -49,7 +49,7 @@ autoreply define dns_name_server_add_del {
@param context - sender context, to match reply w/ request
@param name - the name to resolve
*/
define dns_resolve_name {
manual_print define dns_resolve_name {
u32 client_index;
u32 context;
u8 name[256];
@ -81,7 +81,7 @@ define dns_resolve_name_reply {
@param is_ip6 - set if the reverse-DNS request is an ip6 address
@param address - the address to map to a name
*/
define dns_resolve_ip {
manual_print define dns_resolve_ip {
u32 client_index;
u32 context;
u8 is_ip6;
@ -100,4 +100,3 @@ define dns_resolve_ip_reply {
i32 retval;
u8 name[256];
};

File diff suppressed because it is too large Load Diff

View File

@ -21,9 +21,10 @@
#include <vppinfra/error.h>
#include <vppinfra/hash.h>
#include <vnet/dns/dns_packet.h>
#include <dns/dns_packet.h>
#include <vnet/ip/ip.h>
#include <vppinfra/lock.h>
#include <vlibapi/api_common.h>
typedef struct
{
@ -98,6 +99,7 @@ typedef struct
/** Find cached record by name */
uword *cache_entry_by_name;
clib_spinlock_t cache_lock;
int cache_lock_tag;
/** enable / disable flag */
int is_enabled;
@ -117,9 +119,13 @@ typedef struct
u32 max_ttl_in_seconds;
u32 random_seed;
/** message-ID base */
u16 msg_id_base;
/* convenience */
vlib_main_t *vlib_main;
vnet_main_t *vnet_main;
api_main_t *api_main;
} dns_main_t;
extern dns_main_t dns_main;
@ -127,7 +133,6 @@ extern dns_main_t dns_main;
extern vlib_node_registration_t dns46_reply_node;
extern vlib_node_registration_t dns4_request_node;
extern vlib_node_registration_t dns6_request_node;
extern vlib_node_registration_t dns_resolver_node;
#define foreach_dns46_request_error \
_(NONE, "No error") \
@ -151,7 +156,9 @@ _(DISABLED, "DNS pkts punted (feature disabled)") \
_(PROCESSED, "DNS reply pkts processed") \
_(NO_ELT, "No DNS pool element") \
_(FORMAT_ERROR, "DNS format errors") \
_(TEST_DROP, "DNS reply pkt dropped for test purposes")
_(TEST_DROP, "DNS reply pkt dropped for test purposes") \
_(MULTIPLE_REPLY, "DNS multiple reply packets") \
_(NO_UNRESOLVED_ENTRY, "No unresolved entry for pkt")
typedef enum
{
@ -192,11 +199,14 @@ void vnet_dns_create_resolver_process (dns_main_t * dm);
format_function_t format_dns_reply;
static inline void
dns_cache_lock (dns_main_t * dm)
dns_cache_lock (dns_main_t * dm, int tag)
{
if (dm->cache_lock)
{
ASSERT (tag);
ASSERT (dm->cache_lock_tag == 0);
clib_spinlock_lock (&dm->cache_lock);
dm->cache_lock_tag = tag;
}
}
@ -205,6 +215,8 @@ dns_cache_unlock (dns_main_t * dm)
{
if (dm->cache_lock)
{
ASSERT (dm->cache_lock_tag);
dm->cache_lock_tag = 0;
clib_spinlock_unlock (&dm->cache_lock);
}
}

View File

@ -0,0 +1,19 @@
/*
* dns_all_api_h.h - skeleton vpp engine plug-in api #include file
*
* Copyright (c) <current-year> <your-organization>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Include the generated file, see BUILT_SOURCES in Makefile.am */
#include <dns/dns.api.h>

View File

@ -0,0 +1,31 @@
/*
* dns_msg_enum.h - skeleton vpp engine plug-in message enumeration
*
* Copyright (c) <current-year> <your-organization>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef included_dns_msg_enum_h
#define included_dns_msg_enum_h
#include <vppinfra/byte_order.h>
#define vl_msg_id(n,h) n,
typedef enum {
#include <dns/dns_all_api_h.h>
/* We'll want to know how many messages IDs we need... */
VL_MSG_FIRST_AVAILABLE,
} vl_msg_id_t;
#undef vl_msg_id
#endif /* included_dns_msg_enum_h */

Some files were not shown because too many files have changed in this diff Show More