Compare commits

...

54 Commits

Author SHA1 Message Date
Benoît Ganne
3c1021a679 ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-07 14:34:27 +01:00
Dave Wallace
f53edbc3b4 build: touch files when extracting rpm tarballs
Type: fix

- Long story short, intermittently centos jobs have been
  failing with clock skew issues. When someone commits a
  patch on a machine with the date ahead of UTC, then clock
  skew will be encountered when extracting the RPM source
  tarball. See [0] and [1] for details.

- Replace 'make bootstrap' with 'make install-dep' in
  RPM package build specfile.

[0] https://unix.stackexchange.com/questions/164807/does-git-archive-use-the-wrong-file-timestamp
[1] https://git.fd.io/vpp/tree/Makefile#n380

Change-Id: Iebfb9eb2e26c1f2e4488e871da86d0c60b9f4048
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 27b50fea143f2d45613ef982870cd2052e21fb0f)
2020-09-21 18:53:31 +00:00
Andrew Yourtchenko
09f1679977 misc: 19.08.3 Release Notes
Also remove the duplicate 17.07.1 section

Change-Id: I809f417fabea96df506886ae6576b6e8c1b72caf
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-07 18:09:41 +00:00
Milan Lenco
202978f31a ipsec: fix esp padding
Type: fix
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Change-Id: Ic8db52b41d7e5af3425099f008984e50afb3da74
2020-08-20 13:58:58 +00:00
Florin Coras
69e6364cd8 vcl: fix epoll timeout
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I917158a62e5881b97917c3339527d3c34c37565a
(cherry picked from commit 0edfb1a06ed093c5ed82be34b42b8cacc3ac0ff8)
2020-08-17 21:24:20 +00:00
Jieqiang Wang
b639d50299 build: Fix 'make install-deps' errors on aarch64 CentOS 7
On CentOS-7 aarch64, command of 'debuginfo-install -y glibc openssl-libs mbedtls-devel zlib' in 'make install-deps' fails because it tries to install the corresponding *debuginfo* packages from some inaccessible/unmaintained repos on aarch64, e.g., centos-sclo-rh-debuginfo. The error message shows as below.

Using 'debuginfo-install --enablerepo=xxx' also fails because it will still enable all the repos including the broken repos on aarch64. Using 'debuginfo-install --disablerepo=xxx' (xxx is the broken repo) works fine but we are not centain about that if VPP user will install additional broken repos on aarch64 or not. So to fix this error, we install all the *debuginfo* packages for 'glibc openssl-libs mbedtls-devel zlib' packages using 'yum install' instead.

[root@ ~]# debuginfo-install -y glibc openssl-libs mbedtls-devel zlib
Loaded plugins: auto-update-debuginfo, fastestmirror, ovl
enabling epel-debuginfo
enabling base-debuginfo
enabling centos-sclo-rh-debuginfo
Loading mirror speeds from cached hostfile
epel/aarch64/metalink                                                                                                                                                                       | 8.2 kB  00:00:00
epel-debuginfo/aarch64/metalink                                                                                                                                                             | 8.5 kB  00:00:00
 * base: mirror.aktkn.sg
 * centos-sclo-rh: mirror.aktkn.sg
 * epel: mirrors.yun-idc.com
 * epel-debuginfo: mirrors.yun-idc.com
 * extras: mirror.aktkn.sg
 * updates: mirror.xtom.com.hk
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

failure: repodata/repomd.xml from centos-sclo-rh-debuginfo: [Errno 256] No more mirrors to try.
http://debuginfo.centos.org/centos/7/sclo/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Type: fix

Change-Id: I017c3b20a167d8035c3ae617b9ad5ae479e52f57
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
(cherry picked from commit 81b95c1fe2ece45ee2a5d895631b608733384182)
2020-07-30 17:29:12 +00:00
Steven Luong
9ba2ead1a7 stats: memory leak in stat_validate_counter_vector
Free the existing vectors prior to losing them.

Type: fix
Ticket: VPPSUPP-94

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic15f1fbc7a0c6c348065fc9759ee5d5c43013b91
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit e29fb5bf1b9ab87f4213d990377ea2604990135b)
2020-07-22 15:41:43 +00:00
Andrew Yourtchenko
b1500e9fff misc: 20.05.1 Release Notes
Change-Id: Ib77b5928ba0db64ffe747f3b9a9f1248cc239b2a
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-07-15 18:37:38 +00:00
Mohsin Kazmi
9736d6f328 virtio: fix the msix for multiqueue
Type: fix

Change-Id: Ie0cff37b474f8d85a3ae376e0f547a347fb1ad8a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 8046fdc10b14fd161ee81d0a25cfa79793ef698b)
2020-07-15 17:35:33 +00:00
Elias Rudberg
49ab961abf misc: ipfix-export unformat u16 collector_port fix
Use %U and unformat_udp_port instead of %u for unformat() call for
u16 collector_port number in set_ipfix_exporter_command_fn() to
avoid corruption of other variables which can happen if unformat()
with %u is used with a 16-bit variable. This avoids crash due to
corrupted fib_index value.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Id54273fcc458a7f9c5aa4025aa91711f160c1c1a
(cherry picked from commit 2dca180db989ea7afacdf4e70cc85e4408557382)
2020-07-15 17:05:13 +00:00
Elias Rudberg
fa729ec6cd nat: fix regarding vm arg for vlib_time_now call
Change in snat_ipfix_header_create() to use thread-specific
vlib_main_t *vm pointer to avoid problems with different threads
accessing the same vlib_main_t data structure. This avoids
assertion failure when vlib_time_now() is called with a vm
corresponding to a different thread.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I2096c1debb5688d3b97e5ed9a0ea78d94053d8b7
(cherry picked from commit 5556813fb63d28240a17ccf18f947e60c4cbb263)
2020-07-15 11:04:47 +00:00
Chinmaya Agarwal
bc69426737 sr: fix for SID index across segment lists within a sr policy
Type: fix
Signed-off-by: Chinmaya Agarwal <chinmaya.agarwal@hsc.com>
Change-Id: I9aa5456bf94356e8702fbfd39b14db4c2e74d3e6
(cherry picked from commit edc2ea435b5c407a78f4fcb42d750338d6cdd6d5)
2020-07-14 19:32:27 +00:00
Mohsin Kazmi
82103e9fe1 tap: fix dump for TUN interfaces
Type: fix

Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 86f281a841b5ec67c6a440dfc691e4c42b883df9)
2020-07-14 19:25:51 +00:00
Mohsin Kazmi
5ac8c6f1f3 tap: fix the tun sndbuf value for kernel 4.20 and later
Type: fix

From kernel 4.20, xdp support has been added in tun_sendmsg.
If sndbuf == INT_MAX, kernel executes xdp data path
for tun driver which assumes packets are ethernet frames.
This patch is avoiding the xdp data path in kernel by setting
the sendbuf value < INT_MAX.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ia4aa54b177b96d56a2d513d18d26ca01d5b88929
(cherry picked from commit 4834a66b7b3ef73e486c40ea9d8e36cc2e09c473)
2020-07-08 08:44:44 +00:00
Mohsin Kazmi
d4b5fdde42 tap: remove the bridge configurations for TUN interface
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ifeae641ec0aa7de74e33e582234505bf6e28ca87
(cherry picked from commit add4a412d1f5271be21f99fe15a93cb73c38b833)
2020-07-01 10:06:30 +00:00
Mohsin Kazmi
6d52257a2d gso: fix the l2 path
Type: fix

Change-Id: I4f91175444dec9800d651aa5a5e0472359de63d1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit ec1d61efe6d01a1a687f39e57a601ac693833b07)
2020-06-29 10:43:35 +00:00
Aloys Augustin
42382f5427 tests: fix deps pinning / patching
This ensures we don't recompute the requirements-{2,3}.txt on each make
test run, and skips patching scapy if it is already patched instead of
failing.

Change-Id: I3da57182ae49f3dd04db139d96734a5d145fedff
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 8eca60df745b7656b96db16e75b0deda66bfc515)
2020-06-29 08:21:57 +00:00
John Lo
93dd1da259 l2: L2/L3 mode swicth cleanup and l2-patch fix
Cleanup L2/L3 mode switch to not redirect to/from ethernet-input node
as it is no longer necessary.
L2 patch should use sw_if_index for device feature enable/disable.

Type: fix

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I0f24161d027b07c188fd1e05276146f94c075710
(cherry picked from commit f415a3b53a51b261d08cc3312c25f250d6bc1bd6)
2020-06-11 14:44:11 +00:00
Dave Barach
a37c63c6d8 vppinfra: refactor mpcap.h
vppinfra source files MUST NOT #include <vlib/vlib.h>, <vnet/vnet.h>
or similar. Move mpcap_add_packet(...), mpcap_add_buffer(...) to a new
file: src/vnet/mpcap.h.

Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id517aef6fe49b618f853ce32940b91ba45a1e60d
(cherry picked from commit 2a41919e39d4672f76a654f30be9c2093cef4fad)
2020-06-11 14:42:33 +00:00
Dave Barach
ecbca13d7e nat: update ip4-udp src port for checksum == 0 pkts
Otherwise, the out2in path will discard return-path traffic with
probability 1.0.

Type: fix
Fixes: gerrit 23963 / f126e746fc01c75bc99329d10ce9127b26b23814

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I621ed99329c04ef358035747dde599c0016b58f5
(cherry picked from commit 63c672c440d92cc570c587254afb4167617ec0b7)
2020-06-11 14:41:44 +00:00
Florin Coras
7037fde018 vcl: support connected udp listens
Request connected udp listener behavior by setting
VPPCOM_ATTR_SET_CONNECTED attribute with vppcom_session_attr

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba95155c0f41cea8c6e1a4263946270d49c213ac
(cherry picked from commit 1e96617d952e2d5d8cc367a226702f8f825ed039)
2020-06-04 20:47:53 +00:00
Paul Vinciguerra
53b5233057 lisp: fix api_format reference
Type: fix
Ticket: VPP-1885

Change-Id: I474fffd4d36f439a19d475a8cb20171ca88274ec
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit 353535bb4856d8ee6d818a3c75b8b576b9967ee4)
2020-06-03 18:20:02 +00:00
Mohsin Kazmi
369dc2c67a gso: fix flag for inner header
Type: fix

Change-Id: Ic3fc488521636f7f7c9402a20db45fdb599adaae
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit be03b5c15598131355da91967d05321c15fa1f24)
2020-06-03 17:56:56 +00:00
Florin Coras
e0db09034a lisp: fix api_format
Type: fix
Ticket: VPP-1885
Fixes: 58db6e1

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6431e49b315e09490fed8fd70ac53872836c6a09
(cherry picked from commit f3c1e4b61269cd93302073a631a2549f1aeb24d9)
2020-06-03 17:56:09 +00:00
Florin Coras
201c8e4d2a vcl: fix udp connected check
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I83dafe10cdc78fbb9a751f32155cd84d281b12d9
(cherry picked from commit a4dac8af0eb4271db0c528a00beca58f41b51c95)
2020-06-03 17:55:37 +00:00
Florin Coras
4ee279b03e lisp: fix custom dump
Type: fix
Ticket: VPP-1886
Fixes: 58db6e1

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic40018a756e57bfec05ffbc5e30d18f4feb315db
(cherry picked from commit 9b72b153d85d0e3e0ca218bcf1564805424b64b9)
2020-06-03 17:55:24 +00:00
Neale Ranns
4e4d3fd016 fib: Safe adj walk
Type: fix

the hash walk does not give the same guarantees as the bihash so
walk in a safe manner.

Change-Id: Idfe48c3a84ab3a341d887f7d196bc81ba34ae8b0
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 22391fa92b95ee0376eb372450d6315523c8a9ae)
2020-06-03 17:52:01 +00:00
John Lo
5e69119cdd ethernet: fix DMAC check and skip unnecessary ones (VPP-1868)
Fix and optimize DMAC check in ethernet-input node to utilize NIC or
driver which support L3 DMAC-filtering mode so that DMAC check can be
bypassed safely for interfaces/sub-interfaces in L3 mode.
Checking of interface in L3-DMAC-filtering state to avoid DMAC check
require the following:
a) Fix interface driver init sequence for devices which supports L3
   DMAC-filtering to indicate its capability and initialize interface
   to L3 DMAC-filtering state.
b) Fix ethernet_set_flags() function and its associated callback
   flags_change() functions registered by various drivers in interface
   infra to provide proper L3 DMAC filtering status.
Maintain interface/sub-interface L3 config count so DMAC checks can be
bypassed if L3 forwarding is not setup on any main/sub-interfaces.

Type: fix
Ticket: VPP-1868

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae
(cherry picked from commit 4a302ee7c75f3d4fd1a73a9d1f6c34b3bde8d620)
2020-06-01 21:16:37 +00:00
Andrew Yourtchenko
ab572152d9 misc: 20.05 Release Notes
Change-Id: If68e419b00f8961c814727713f989fd0d72f6f1b
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-05-27 18:02:25 +00:00
Damjan Marion
550da2b75a vppinfra: fix SIGBUS in bihash init when running unpriviledged, take two
Looks like MAP_LOCK is not enough, so call mlock(...) instead....

Type: fix
Change-Id: I1bc668a2bf3c861ca1c2d376c0fb6bfea87d4f48
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27 17:11:25 +00:00
Neale Ranns
aecb10b97f fib: IPv6 lookup data structure MP safe when prefixes change (VPP-1881)
Type: fix

adding routes should be MP safe. When new prefixes with differrent
prefix lengths are added, adjust the sorted list in an MP safe way.

Change-Id: Ib73a3c84d01eb86d17f8e79ea2bd2505dd9afb3d
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-05-27 16:26:34 +00:00
Neale Ranns
af3022f0e8 ipsec: Add/Del IPSec SA is not MP safe
Type: fix

we can probably do better, but for now this is needed

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I07161f5ac07a70a0e6db6608ba31659d9bc2c9ed
2020-05-27 15:19:05 +00:00
Florin Coras
449f34e2f3 vcl: fix ldp fcntl64
Type: fix
Ticket: VPP-1882

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I342d8f928fcc7de74f9bd288c1a5d63ea1f90020
(cherry picked from commit 0ab36f55753d3d1417c41f8a3aec5e79a882555c)
2020-05-27 11:23:34 +00:00
Andrew Yourtchenko
e2e3c38be6 misc: Avoid sample.md from in the VPP docs, clean up the extraneous copy
I had cleaned up the sample.md previously for 20.01, but when later
that was merged to master, the file was renamed. So, fix this issue.

Change-Id: I6347685af216901fbfdd445606735b9bf79f8fe5
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-05-27 11:22:59 +00:00
Neale Ranns
77d12df8eb fib: Fix interpose source reactivate
Type: fix

when the interpose is on an adj-fib and the cover is removed the adj
source will not install. this lead to no path list being found for the
interpose source and a crash. pick a drop path list in this case.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ied217da043926c913657080f5ffb151201225d23
2020-05-26 16:48:15 +00:00
Neale Ranns
bc69eca2ab fib: Use basic hash for adjacency neighbour table (VPP-1877)
Type: improvement

a bihash per-interface used too much memory.

Change-Id: I447bb66c0907e1632fa5d886a3600e518663c39e
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 20aec3db441074ee5a861a40d6e02fad2f3dcb37)
2020-05-26 14:55:13 +00:00
Rajesh Goel
61f368a80f ipsec: DES/3DES fixing the iv_len for openssl crypto
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: I8d128598b4c872f19b64c779c19b5908ba2f2c08
(cherry picked from commit d1d90f5951df93625594f1904cddd95880838ff0)
2020-05-26 11:30:18 +00:00
Florin Coras
0f878da203 vcl: do not propagate epoll events if session closed
Type: fix
Ticket: VPP-1880

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1e9652b476bbc07852b4e701a948c36a0d8c67fa
2020-05-26 11:28:49 +00:00
Florin Coras
89c12dbe23 tcp: fix sack block validation on wrap
Type: fix
Fixes: 487507f
Ticket: VPP-1879

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia9813ae09d14111dc8edac0fa6ab082e13ab6e2e
(cherry picked from commit 3b9540966f877ae67d374cab334c31bd6e3f8c8b)
2020-05-25 20:34:17 +00:00
Damjan Marion
11974e5f5a vppinfra: fix SIGBUS in bihash init when running unpriviledged
Obserbed when VPP is running in k8s container

Type: fix
Change-Id: Ibbff9c3921bd7f4f97d47cb6f10eed8ed5efe269
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-25 16:02:14 +00:00
PiotrX Kleski
8b4221ee8f ipsec: fixed chaining ops after add footer and icv
In case there is no free space in first buffer for ICV and footer,
additional buffer will be added, but esp_encrypt will stay in single
buffer mode.
The issue happens for the following payload sizes:
 - TCP packets with payload 1992
 - ICMP packets with payload 2004

This fix moves the single/chained buffer ops selection to after
esp_add_footer_and_icv call.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Change-Id: Ic5ceba418f738933f96edb3e489ca2d149033b79
(cherry picked from commit fdca4dd1a1a817e65bf44e435261d893fc0c51d6)
2020-05-25 16:01:25 +00:00
Satoru Matsushima
04d4d92f96 srv6-mobile: Update the doc of 20.05 for gtp4.dt and gtp6.dt funcitons.
Document update to reflect merged SRv6 functions into 20.05 of lookup and forwarding for inner IP packet encapsulated with outer IP and GTP-U headers.

Type: docs

Signed-off-by: Satoru Matsushima <satoru.matsushima@gmail.com>
Change-Id: I85c9ddf6bf9fa63f2b8b6e03eff3ecec1e7615ab
2020-05-25 15:59:41 +00:00
Neale Ranns
be955ef316 ip: Dual loop error in midchain chksum
Type: fix

Change-Id: Idf7c80b7d81f796bd0512bca4276bcfcf2af241a
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit fc74697ed3b45499027b272332af786e8e7917bb)
2020-05-21 07:09:46 +00:00
Alexander Chernavin
63f9e7cc0e nat: fix segv if out of ports in ed mode
Type: fix
Ticket: VPP-1870
Change-Id: Ife726d2f6baaa3516c209011183f39670cf6a55d
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
(cherry picked from commit 88120824acc299a0aec17ce4c208dbc8be394779)
2020-05-20 16:35:42 +00:00
yedg
d3088e94ec ip: fix interface ip address del sw_if_index check
Type: fix

Signed-off-by: Ye donggang <yedg@wangsu.com>
Change-Id: Ia9f72ff2be455ecd4ff3d16e884c5a50f9df69fe
(cherry picked from commit dbd366b239c0506b0d9984e7481967e038f10a23)
2020-05-20 16:34:42 +00:00
Benoît Ganne
d657203443 docs: asan: update doc to match current status
Type: docs

Change-Id: I45265876c9c778f6b91d39f30eb6035f14d166ec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit ca86c95a3413214110a03b001d45d018385b92dc)
2020-05-20 16:01:56 +00:00
Benoît Ganne
00b060a778 dpdk: fix pktmbuf pool private data init
Type: fix

Change-Id: I7349840af48eec209532dab43a8ad0bd68993268
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit c32a84c70efb45081568fc8aa5fa1884d74865fe)
2020-05-20 07:10:35 +00:00
Onong Tayeng
a3674c0e18 lisp: API doc/comments cleanup
Removing the comments around eid_type which seem to have been overlooked
by the original patch https://gerrit.fd.io/r/c/vpp/+/24663.

NOTE: This patch is a doc-only change. It does two things:
    1. Remove comments around obsolete eid_type type
    2. Update the comments to reflect the new vl_api_eid_t type

This is to ensure correct documentation is displayed to user/reader of
VPP docs in 20.05.

Type: fix

Signed-off-by: Onong Tayeng <otayeng@cisco.com>
Change-Id: I48e1993cf8869cb32e159d1956f3ec1e5943e33f
(cherry picked from commit 4ab5190eb4167ac4c06cd649ec8a860784ab1d41)
2020-05-19 10:35:53 +00:00
Jakub Grajciar
06107a7243 interface: fix interface rx mode config API
Swap byte order for fields of type vl_api_rx_mode_t.

Ticket: VPP-1871
Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ia1745257b57209d41661d38067e0dd7618f9a9b9
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
(cherry picked from commit aefcd1a3579ec2c93f606b151d563d87ea211387)
2020-05-19 07:23:20 +00:00
Florin Coras
0762fbc46e vcl: remove udpc transport
Type: refactor
Ticket: VPP-1875

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I145ff3301f168973c4f7f32c337bbcac47900705
(cherry picked from commit 3ca663e743dda703e76d8493a0c5cf13d7004c63)
2020-05-18 16:44:16 +00:00
Florin Coras
b5898d2f77 tcp: fix bogus time update due to missing cast
Type: fix
Ticket: VPP-1874

Seems clang needs explicit casting to u64 of u64 and f64 multiplication
before truncating to u32

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib0d7a33d4c5e68577e401e854fc3e55e0723da93
(cherry picked from commit 17b5c3d6ab83a597e7c79613041f2fd7470825bd)
2020-05-18 16:43:50 +00:00
hanlin
8337806b5f vcl svm: fix rx event loss
When vcl_epoll_wait_handle_mq handles rx events exceeding maxevents, VPP will not signal because cursize > 0, and the remaining rx events cannot be triggered because the eventfd event has been read. Therefore, we should dequeue all events until cursize = 0. And then handle msg up to maxevents with vcl_epoll_wait_handle_mq_event and those beyond with vcl_handle_mq_event.

Type: fix
Ticket: VPP-1873
Signed-off-by: hanlin <hanlin_wang@163.com>
Change-Id: I8a0c87cb41c837deb8284b40f668cc3c7d9d6e56
Signed-off-by: hanlin <hanlin_wang@163.com>
(cherry picked from commit d0e646f6892e9c85278c9538760a8940c86dcdbb)
2020-05-16 22:09:05 +00:00
Andrew Yourtchenko
765ef37670 docs: Add link to 20.05 test framework docs
Change-Id: I429a29a5cb1f311bec4361c758b14b51b0afc8aa
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-05-13 22:59:30 +00:00
Andrew Yourtchenko
b8e9009400 docs: Initial changes for stable/2005 branch
This patch adds an entry for the defaultbranch
    in .gitreview

Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I6f78398d6c7779b52d64ad65285c0194f0849996
2020-05-13 19:14:40 +00:00
77 changed files with 1777 additions and 620 deletions

View File

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

View File

@ -135,6 +135,11 @@ endif
# +ganglia-devel if building the ganglia plugin
RPM_DEPENDS += chrpath libffi-devel rpm-build
RPM_DEPENDS_DEBUG = glibc-debuginfo e2fsprogs-debuginfo
RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo
RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo
RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
# lowercase- replace spaces with dashes.
SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($$0)}')
SUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
@ -323,7 +328,7 @@ else ifeq ($(OS_ID),centos)
@sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
@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
@sudo -E yum install $(CONFIRM) --enablerepo=base-debuginfo $(RPM_DEPENDS_DEBUG)
else ifeq ($(OS_ID),fedora)
@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ Google Sanitizers
VPP is instrumented to support `Google Sanitizers <https://github.com/google/sanitizers>`_.
As of today, only `AddressSanitizer <https://github.com/google/sanitizers/wiki/AddressSanitizer>`_
is supported and only for the heap.
is supported, only for GCC and only for the heap.
AddressSanitizer
================
@ -20,19 +20,19 @@ build option, so all VPP targets should be supported. For example:
.. code-block:: console
# build a debug image with ASan support:
$ make rebuild VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
$ make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON CC=gcc-8
....
# build a release image with ASan support:
$ make rebuild-release VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
$ make rebuild-release VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON CC=gcc-8
....
# build packages in debug mode with ASan support:
$ make pkg-deb-debug VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
$ make pkg-deb-debug VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON CC=gcc-8
....
# run GBP plugin tests in debug mode with ASan
$ make test-debug TEST=test_gbp VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
$ make test-debug TEST=test_gbp VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON CC=gcc-8
....
Once VPP has been built with ASan support you can use it as usual including

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 20.05](https://docs.fd.io/vpp/20.05/vpp_make_test/html)
- [Test framework documentation for VPP 20.01](https://docs.fd.io/vpp/20.01/vpp_make_test/html)
- [Test framework documentation for VPP 19.08](https://docs.fd.io/vpp/19.08/vpp_make_test/html)
- [Test framework documentation for VPP 19.04](https://docs.fd.io/vpp/19.04/vpp_make_test/html)

View File

@ -1,82 +0,0 @@
---
title: Home
---
# VPP Status
### Here's the version...
VPP version: <div id="VPPversion"></div>
build date: <div id="VPPbuilddate"></div>
<div id="like_button_container"></div>
### Show Interface
<p>Enter the interface name, then click "Submit" to display interface stats:</p>
<input id="ifacename" type="text"></input>
<button onclick="getStats()">Get Stats</button>
<div id="ifacestats"></div>
{{< rawhtml >}}
<script>
function getStats() {
var url="http://192.168.10.1:1234/interface_stats.json?";
var iface=document.getElementById("ifacename").value;
url=url.concat(iface);
fetch(url, {
method: 'POST',
mode: 'no-cors',
cache: 'no-cache',
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then(function(obj) {
console.log(obj)
var result=obj.interface_stats.name;
result = result.concat(": rx-pkts: ");
result = result.concat(obj.interface_stats.rx_packets);
result = result.concat(" rx-bytes: ");
result = result.concat(obj.interface_stats.rx_bytes);
result = result.concat(": tx-pkts: ");
result = result.concat(obj.interface_stats.tx_packets);
result = result.concat(" tx-bytes: ");
result = result.concat(obj.interface_stats.tx_bytes);
result = result.concat(" drops: ");
result = result.concat(obj.interface_stats.drops);
result = result.concat(" ip4: ");
result = result.concat(obj.interface_stats.ip4);
result = result.concat(" ip6: ");
result = result.concat(obj.interface_stats.ip6);
document.getElementById("ifacestats").innerHTML=result;
})
.catch(function(error) {
console.log(error);
})}
// unconditionally populate vpp version info ->
fetch('http://192.168.10.1:1234/version.json', {
method: 'GET',
mode: 'no-cors',
cache: 'no-cache',
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then(function(obj) {
document.getElementById("VPPbuilddate").innerHTML=obj.vpp_details.build_date;
document.getElementById("VPPversion").innerHTML=obj.vpp_details.version;
})
.catch(function(error) {
console.log(error);
});
</script>
{{< /rawhtml >}}

View File

@ -2605,10 +2605,12 @@ ixge_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hw, u32 flags)
old = r->filter_control;
if (flags & ETHERNET_INTERFACE_FLAG_ACCEPT_ALL)
if (flags == ETHERNET_INTERFACE_FLAG_ACCEPT_ALL)
r->filter_control = old | (1 << 9) /* unicast promiscuous */ ;
else
else if (flags == ETHERNET_INTERFACE_FLAGS_DEFAULT_L3)
r->filter_control = old & ~(1 << 9);
else
return ~0;
return old;
}

View File

@ -169,7 +169,10 @@ Requires(post): python3-policycoreutils
This package contains a tailored VPP SELinux policy
%prep
%setup -q -n %{name}-%{_version}
%setup -q -c -T -n %{name}-%{_version}
cd ..
unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch
cd -
%pre
# Add the vpp group
@ -180,7 +183,7 @@ groupadd -f -r vpp
. /opt/rh/devtoolset-9/enable
%endif
%if %{with aesni}
make bootstrap
make install-dep
make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
%else
make bootstrap AESNI=n

View File

@ -1125,25 +1125,29 @@ avf_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hw, u32 flags)
vlib_main_t *vm = vlib_get_main ();
avf_main_t *am = &avf_main;
avf_device_t *ad = vec_elt_at_index (am->devices, hw->dev_instance);
if (ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC (flags))
clib_error_t *error;
u8 promisc_enabled;
switch (flags)
{
clib_error_t *error;
int promisc_enabled = (flags & ETHERNET_INTERFACE_FLAG_ACCEPT_ALL) != 0;
u32 new_flags = promisc_enabled ?
ad->flags | AVF_DEVICE_F_PROMISC : ad->flags & ~AVF_DEVICE_F_PROMISC;
if (new_flags == ad->flags)
return flags;
if ((error = avf_config_promisc_mode (vm, ad, promisc_enabled)))
{
avf_log_err (ad, "%s: %U", format_clib_error, error);
clib_error_free (error);
return 0;
}
ad->flags = new_flags;
case ETHERNET_INTERFACE_FLAG_DEFAULT_L3:
ad->flags &= ~AVF_DEVICE_F_PROMISC;
break;
case ETHERNET_INTERFACE_FLAG_ACCEPT_ALL:
ad->flags |= AVF_DEVICE_F_PROMISC;
break;
default:
return ~0;
}
promisc_enabled = ((ad->flags & AVF_DEVICE_F_PROMISC) != 0);
if ((error = avf_config_promisc_mode (vm, ad, promisc_enabled)))
{
avf_log_err (ad, "%s: %U", format_clib_error, error);
clib_error_free (error);
return ~0;
}
return 0;
}
@ -1470,6 +1474,13 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
if (error)
goto error;
/* Indicate ability to support L3 DMAC filtering and
* initialize interface to L3 non-promisc mode */
vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, ad->hw_if_index);
hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER;
ethernet_set_flags (vnm, ad->hw_if_index,
ETHERNET_INTERFACE_FLAG_DEFAULT_L3);
vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, ad->hw_if_index);
args->sw_if_index = ad->sw_if_index = sw->sw_if_index;

View File

@ -76,7 +76,8 @@ openssl_ops_enc_cbc (vlib_main_t * vm, vnet_crypto_op_t * ops[],
int out_len = 0;
int iv_len;
if (op->op == VNET_CRYPTO_OP_3DES_CBC_ENC)
if (op->op == VNET_CRYPTO_OP_3DES_CBC_ENC
|| op->op == VNET_CRYPTO_OP_DES_CBC_ENC)
iv_len = 8;
else
iv_len = 16;

View File

@ -91,6 +91,7 @@ dpdk_buffer_pool_init (vlib_main_t * vm, vlib_buffer_pool_t * bp)
rte_mempool_set_ops_byname (nmp, "vpp-no-cache", NULL);
/* Call the mempool priv initializer */
memset (&priv, 0, sizeof (priv));
priv.mbuf_data_room_size = VLIB_BUFFER_PRE_DATA_SIZE +
vlib_buffer_get_default_data_size (vm);
priv.mbuf_priv_size = VLIB_BUFFER_HDR_SIZE;

View File

@ -113,30 +113,33 @@ dpdk_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, u32 flags)
{
dpdk_main_t *dm = &dpdk_main;
dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance);
u32 old = 0;
u32 old = (xd->flags & DPDK_DEVICE_FLAG_PROMISC) != 0;
if (ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC (flags))
{
old = (xd->flags & DPDK_DEVICE_FLAG_PROMISC) != 0;
if (flags & ETHERNET_INTERFACE_FLAG_ACCEPT_ALL)
xd->flags |= DPDK_DEVICE_FLAG_PROMISC;
else
xd->flags &= ~DPDK_DEVICE_FLAG_PROMISC;
if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
if (xd->flags & DPDK_DEVICE_FLAG_PROMISC)
rte_eth_promiscuous_enable (xd->port_id);
else
rte_eth_promiscuous_disable (xd->port_id);
}
}
else if (ETHERNET_INTERFACE_FLAG_CONFIG_MTU (flags))
switch (flags)
{
case ETHERNET_INTERFACE_FLAG_DEFAULT_L3:
/* set to L3/non-promisc mode */
xd->flags &= ~DPDK_DEVICE_FLAG_PROMISC;
break;
case ETHERNET_INTERFACE_FLAG_ACCEPT_ALL:
xd->flags |= DPDK_DEVICE_FLAG_PROMISC;
break;
case ETHERNET_INTERFACE_FLAG_MTU:
xd->port_conf.rxmode.max_rx_pkt_len = hi->max_packet_bytes;
dpdk_device_setup (xd);
return 0;
default:
return ~0;
}
if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
if (xd->flags & DPDK_DEVICE_FLAG_PROMISC)
rte_eth_promiscuous_enable (xd->port_id);
else
rte_eth_promiscuous_disable (xd->port_id);
}
return old;
}
@ -737,6 +740,12 @@ dpdk_lib_init (dpdk_main_t * dm)
hi->max_packet_bytes = mtu;
hi->max_supported_packet_bytes = max_rx_frame;
hi->numa_node = xd->cpu_socket;
/* Indicate ability to support L3 DMAC filtering and
* initialize interface to L3 non-promisc mode */
hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER;
ethernet_set_flags (dm->vnet_main, xd->hw_if_index,
ETHERNET_INTERFACE_FLAG_DEFAULT_L3);
}
if (dm->conf->no_tx_checksum_offload == 0)

View File

@ -1118,10 +1118,11 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
{
if (!vnet_buffer (b0)->ip.reass.is_non_first_fragment)
{
udp0->src_port = s0->out2in.port;
if (PREDICT_FALSE (udp0->checksum))
{
old_port0 = vnet_buffer (b0)->ip.reass.l4_src_port;
new_port0 = udp0->src_port = s0->out2in.port;
new_port0 = udp0->src_port;
sum0 = udp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0, ip4_header_t, dst_address /* changed member */
);
@ -1325,10 +1326,11 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
{
if (!vnet_buffer (b0)->ip.reass.is_non_first_fragment)
{
udp1->src_port = s1->out2in.port;
if (PREDICT_FALSE (udp1->checksum))
{
old_port1 = vnet_buffer (b1)->ip.reass.l4_src_port;
new_port1 = udp1->src_port = s1->out2in.port;
new_port1 = udp1->src_port;
sum1 = udp1->checksum;
sum1 = ip_csum_update (sum1, old_addr1, new_addr1, ip4_header_t, dst_address /* changed member */
);
@ -1567,10 +1569,11 @@ snat_in2out_node_fn_inline (vlib_main_t * vm,
{
if (!vnet_buffer (b0)->ip.reass.is_non_first_fragment)
{
udp0->src_port = s0->out2in.port;
if (PREDICT_FALSE (udp0->checksum))
{
old_port0 = vnet_buffer (b0)->ip.reass.l4_src_port;
new_port0 = udp0->src_port = s0->out2in.port;
new_port0 = udp0->src_port;
sum0 = udp0->checksum;
sum0 = ip_csum_update (sum0, old_addr0, new_addr0, ip4_header_t, dst_address /* changed member */
);

View File

@ -386,7 +386,6 @@ slow_path_ed (snat_main_t * sm,
{
nat_elog_notice ("addresses exhausted");
b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS];
nat_free_session_data (sm, s, thread_index, 0);
nat_ed_session_delete (sm, s, thread_index, 1);
return NAT_NEXT_DROP;
}

View File

@ -493,6 +493,7 @@ snat_ipfix_header_create (flow_report_main_t * frm,
u32 stream_index;
ip4_header_t *ip;
udp_header_t *udp;
vlib_main_t *vm = vlib_get_main ();
stream_index = clib_atomic_fetch_or(&silm->stream_index, 0);
stream = &frm->streams[stream_index];
@ -521,7 +522,7 @@ snat_ipfix_header_create (flow_report_main_t * frm,
h->export_time = clib_host_to_net_u32 ((u32)
(((f64) frm->unix_time_0) +
(vlib_time_now (frm->vlib_main) -
(vlib_time_now (vm) -
frm->vlib_time_0)));
sequence_number = clib_atomic_fetch_add (&stream->sequence_number, 1);

View File

@ -4712,6 +4712,53 @@ class TestNAT44EndpointDependent(MethodHolder):
sessions = self.statistics.get_counter('/nat44/total-sessions')
self.assertEqual(sessions[0][0], 3)
def test_dynamic_out_of_ports(self):
""" NAT44 dynamic translation test: out of ports """
flags = self.config_flags.NAT_IS_INSIDE
self.vapi.nat44_interface_add_del_feature(
sw_if_index=self.pg0.sw_if_index,
flags=flags, is_add=1)
self.vapi.nat44_interface_add_del_feature(
sw_if_index=self.pg1.sw_if_index,
is_add=1)
nat_config = self.vapi.nat_show_config()
self.assertEqual(1, nat_config.endpoint_dependent)
# in2out and no NAT addresses added
err_old = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/out of ports')
pkts = self.create_stream_in(self.pg0, self.pg1)
self.pg0.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
self.pg1.get_capture(0, timeout=1)
err_new = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/out of ports')
self.assertEqual(err_new - err_old, len(pkts))
# in2out after NAT addresses added
self.nat44_add_address(self.nat_addr)
err_old = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/out of ports')
pkts = self.create_stream_in(self.pg0, self.pg1)
self.pg0.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
capture = self.pg1.get_capture(len(pkts))
self.verify_capture_out(capture)
err_new = self.statistics.get_err_counter(
'/err/nat44-ed-in2out-slowpath/out of ports')
self.assertEqual(err_new, err_old)
def test_dynamic_output_feature_vrf(self):
""" NAT44 dynamic translation test: output-feature, VRF"""

View File

@ -182,7 +182,7 @@ rdma_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hw, u32 flags)
switch (flags)
{
case 0:
case ETHERNET_INTERFACE_FLAG_DEFAULT_L3:
return rdma_dev_set_ucast (rd);
case ETHERNET_INTERFACE_FLAG_ACCEPT_ALL:
return rdma_dev_set_promisc (rd);
@ -339,9 +339,18 @@ rdma_async_event_cleanup (rdma_device_t * rd)
static clib_error_t *
rdma_register_interface (vnet_main_t * vnm, rdma_device_t * rd)
{
return ethernet_register_interface (vnm, rdma_device_class.index,
rd->dev_instance, rd->hwaddr.bytes,
&rd->hw_if_index, rdma_flag_change);
clib_error_t *err =
ethernet_register_interface (vnm, rdma_device_class.index,
rd->dev_instance, rd->hwaddr.bytes,
&rd->hw_if_index, rdma_flag_change);
/* Indicate ability to support L3 DMAC filtering and
* initialize interface to L3 non-promisc mode */
vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, rd->hw_if_index);
hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER;
ethernet_set_flags (vnm, rd->hw_if_index,
ETHERNET_INTERFACE_FLAG_DEFAULT_L3);
return err;
}
static void

View File

@ -3,22 +3,29 @@ SRv6 Mobile User Plane Plugins {#srv6_mobile_plugin_doc}
# Introduction
This plugin module can provide the stateless mobile user plane protocols translation between GTP-U and SRv6. The functions of the translation take advantage of SRv6 network programmability.
This plugin module can provide the stateless mobile user plane protocols translation between GTP-U and SRv6. The plugin also provides FIB table lookup for an IPv4/IPv6 packet encapsulated in GTP-U. These plugin functions take advantage of SRv6 network programmability.
[SRv6 Mobile User Plane](https://tools.ietf.org/html/draft-ietf-dmm-srv6-mobile-uplane) defines the user plane protocol using SRv6
including following stateless translation functions:
- **T.M.GTP4.D:**
- **T.M.GTP4.D:**
GTP-U over UDP/IPv4 -> SRv6
- **End.M.GTP4.E:**
- **End.M.GTP4.E:**
SRv6 -> GTP-U over UDP/IPv4
- **End.M.GTP6.D:**
- **End.M.GTP6.D:**
GTP-U over UDP/IPv6 -> SRv6
- **End.M.GTP6.E:**
- **End.M.GTP6.E:**
SRv6 -> GTP-U over UDP/IPv6
These functions benefit user plane(overlay) to be able to utilize data plane(underlay) networks properly. And also it benefits data plane to be able to handle user plane in routing paradigm.
In addition to the above functions, the plugin supports following functions:
- **T.M.GTP4.DT{4|6|46}:**
FIB table lookup for IPv4/IP6 encapsulated in GTP-U over UDP/IPv4
- **End.M.GTP6.DT{4|6|46}:**
FIB table lookup for IPv4/IP6 encapsulated in GTP-U over UDP/IPv6
Noted that the prefix of function names follow naming convention of SRv6 network programming. "T" means transit function, "End" means end function, "M" means Mobility specific function. The suffix "D" and "E" mean that "decapsulation" and "encapsulation" respectively.
@ -138,5 +145,57 @@ For example, the below command configures the SID prefix 2001:db8::/64 with `end
sr localsid prefix 2001:db8::/64 behavior end.m.gtp6.e
```
## FIB Table Lookup for Inner IPv4/IPv6 packet
SRv6 Mobile functions of `t.m.gtp4.dt*` and `end.m.gtp6.dt*` support decapsulating outer IP/UDP/GTP-U headers and forwarding inner IP packet based on specific fib table.
In case of the both outer and inner IP address families are IPv4, `t.m.gtp4.dt4` function supports GTP-U decapsulation and fib lookup for inner IPv4 with an associated steering policy and the following parameters:
- SID: A SRv6 SID to represents the function
- FIB: fib-table number for inner IPv4 packet lookup and forwarding
The following command instantiates a new T.M.GTP4.DT4 function.
```
sr policy add bsid SID behavior t.m.gtp4.dt4 fib-table FIB
```
For example, the below commands configure D5:: as the SID instantiates `t.m.gtp4.dt4` function. A steering policy for packets destine to 172.20.0.1 binds to the SID.
```
sr steer l3 172.20.0.1/32 via bsid D5::
sr policy add bsid D5:: behavior t.m.gtp4.dt4 fib-table 0
```
In addition, inner IPv6, or mix of IPv4 and IPv6 inner packet cases require the function to be configured with local-fib table.
- LOCAL-FIB: fib-table number for lookup and forward GTP-U packet based on outer IP destination address
This is inner IPv6 case specific. The reason is that GTP-U encapsulates link local IPv6 packet for NDP (Neighber Discovery Protocol). Outer GTP-U header should be kept until the packets reach to the node responsible for NDP handling. It is typically UPF(User Plane Function) node.
The following command instantiate a new T.M.GTP4.DT6 function.
```
sr policy add bsid D5:: behavior t.m.gtp4.dt6 fib-table 0 local-fib-table LOCAL-FIB
```
Following example configures fib 0 for inner packet and fib 1 for outer GTP-U packet forwarding:
```
sr policy add bsid D5:: behavior t.m.gtp4.dt6 fib-table 0 local-fib-table 1
```
If you need to suport both IPv4 and IPv6 inner packet lookup with just one SID, you can configure `t.m.gtp4.dt46` function:
```
sr policy add bsid D5:: behavior t.m.gtp4.dt46 fib-table 0 local-fib-table 1
```
In case of GTP-U over IPv6 case, `end.m.gtp6.dt4`, `end.m.gtp6.dt6` and `end.m.gtp6.dt46` functions support inner IPv4, IPv6 and IPv4/IPv6 lookup and forwarding respectively. Specifiyng fib table for inner IP packet forwarding is required as same as GTP-U over IPv4 case, and local-fib table for inner IPv6 and IPv4/IPv6 cases as well.
```
sr localsid prefix D::/64 behavior end.m.gtp6.dt46 fib-table 0 local-fib-table 0
```
To run some demo setup please refer to: @subpage srv6_mobile_runner_doc

View File

@ -18,7 +18,7 @@
#include <vnet/vnet.h>
#include <vnet/pg/pg.h>
#include <vppinfra/error.h>
#include <vppinfra/mpcap.h>
#include <vnet/mpcap.h>
#include <vnet/ethernet/ethernet.h>
static mpcap_main_t test_mpcap_main = {

View File

@ -637,6 +637,32 @@ tcp_test_sack_rx (vlib_main_t * vm, unformat_input_t * input)
TCP_TEST ((sb->rxt_sacked == 300), "last rxt sacked bytes %d",
sb->rxt_sacked);
/*
* Restart
*/
scoreboard_clear (sb);
vec_reset_length (tc->rcv_opts.sacks);
/*
* Broken sacks:
* block.start > snd_nxt
* && block.start < blk.end
* && block.end <= snd_nxt
*/
tc->flags = 0;
block.start = 2147483647;
block.end = 4294967295;
vec_add1 (tc->rcv_opts.sacks, block);
tc->snd_una = tc->snd_nxt = 1969067947;
tcp_rcv_sacks (tc, tc->snd_una);
/*
* Clear
*/
scoreboard_clear (sb);
vec_reset_length (tc->rcv_opts.sacks);
return 0;
}

View File

@ -2901,7 +2901,7 @@ unformat_nsh_address (unformat_input_t * input, va_list * args)
return unformat (input, "SPI:%d SI:%d", &nsh->spi, &nsh->si);
}
u8 *
static u8 *
format_nsh_address_vat (u8 * s, va_list * args)
{
nsh_t *a = va_arg (*args, nsh_t *);
@ -2958,7 +2958,7 @@ vl_api_one_eid_table_details_t_handler (vl_api_one_eid_table_details_t * mp)
s = format (0, "%d", clib_net_to_host_u32 (mp->locator_set_index));
eid = format (0, "%U", format_lisp_eid_vat,
mp->deid, mp->seid, mp->is_src_dst);
&mp->deid, &mp->seid, mp->is_src_dst);
vec_add1 (eid, 0);
print (vam->ofp, "[%d] %-35s%-20s%-30s%-20d%-20d%-10d%-20s",
@ -3007,7 +3007,7 @@ vl_api_one_eid_table_details_t_handler_json (vl_api_one_eid_table_details_t
else
{
eid = format (0, "%U", format_lisp_eid_vat,
mp->deid, mp->seid, mp->is_src_dst);
&mp->deid, &mp->seid, mp->is_src_dst);
vec_add1 (eid, 0);
vat_json_object_add_string_copy (node, "eid", eid);
vec_free (eid);
@ -3031,9 +3031,9 @@ vl_api_one_stats_details_t_handler (vl_api_one_stats_details_t * mp)
u8 *seid = 0, *deid = 0;
ip46_address_t lloc, rloc;
deid = format (0, "%U", format_lisp_eid_vat, mp->deid, 0);
deid = format (0, "%U", format_lisp_eid_vat, &mp->deid, 0, 0);
seid = format (0, "%U", format_lisp_eid_vat, mp->seid, 0);
seid = format (0, "%U", format_lisp_eid_vat, &mp->seid, 0, 0);
vec_add1 (deid, 0);
vec_add1 (seid, 0);
@ -3079,9 +3079,9 @@ vl_api_one_stats_details_t_handler_json (vl_api_one_stats_details_t * mp)
node = vat_json_array_add (&vam->json_tree);
vat_json_init_object (node);
deid = format (0, "%U", format_lisp_eid_vat, mp->deid, 0);
deid = format (0, "%U", format_lisp_eid_vat, &mp->deid, 0, 0);
seid = format (0, "%U", format_lisp_eid_vat, mp->seid, 0);
seid = format (0, "%U", format_lisp_eid_vat, &mp->seid, 0, 0);
vec_add1 (deid, 0);
vec_add1 (seid, 0);

View File

@ -477,17 +477,11 @@ writev (int fd, const struct iovec * iov, int iovcnt)
return size;
}
int
fcntl (int fd, int cmd, ...)
static int
fcntl_internal (int fd, int cmd, va_list ap)
{
vls_handle_t vlsh;
int rv = 0;
va_list ap;
if ((errno = -ldp_init ()))
return -1;
va_start (ap, cmd);
vlsh = ldp_fd_to_vlsh (fd);
LDBG (0, "fd %u vlsh %d, cmd %u", fd, vlsh, cmd);
@ -533,6 +527,20 @@ fcntl (int fd, int cmd, ...)
#endif
}
return rv;
}
int
fcntl (int fd, int cmd, ...)
{
va_list ap;
int rv;
if ((errno = -ldp_init ()))
return -1;
va_start (ap, cmd);
rv = fcntl_internal (fd, cmd, ap);
va_end (ap);
return rv;
@ -544,8 +552,11 @@ fcntl64 (int fd, int cmd, ...)
va_list ap;
int rv;
if ((errno = -ldp_init ()))
return -1;
va_start (ap, cmd);
rv = fcntl (fd, cmd, ap);
rv = fcntl_internal (fd, cmd, ap);
va_end (ap);
return rv;
}

View File

@ -550,45 +550,16 @@ libc_eventfd (int count, int flags)
int
libc_vfcntl (int fd, int cmd, va_list ap)
{
long int args[4];
int rc;
int i;
swrap_bind_symbol_libc (fcntl);
for (i = 0; i < 4; i++)
{
args[i] = va_arg (ap, long int);
}
rc = swrap.libc.symbols._libc_fcntl.f (fd,
cmd,
args[0], args[1], args[2], args[3]);
return rc;
return swrap.libc.symbols._libc_fcntl.f (fd, cmd, va_arg (ap, long int));
}
#ifdef HAVE_FCNTL64
int
libc_vfcntl64 (int fd, int cmd, va_list ap)
{
long int args[4];
int rc;
int i;
swrap_bind_symbol_libc (fcntl64);
for (i = 0; i < 4; i++)
{
args[i] = va_arg (ap, long int);
}
rc = swrap.libc.symbols._libc_fcntl64.f (fd,
cmd,
args[0], args[1], args[2],
args[3]);
return rc;
return swrap.libc.symbols._libc_fcntl64.f (fd, cmd, va_arg (ap, long int));
}
#endif

View File

@ -122,7 +122,9 @@ int libc_eventfd (int count, int flags);
int libc_vfcntl (int fd, int cmd, va_list ap);
#ifdef HAVE_FCNTL64
int libc_vfcntl64 (int fd, int cmd, va_list ap);
#endif
int libc_vioctl (int fd, int cmd, va_list ap);

View File

@ -529,7 +529,7 @@ static inline u8
vcl_session_is_cl (vcl_session_t * s)
{
if (s->session_type == VPPCOM_PROTO_UDP)
return 1;
return !(s->flags & VCL_SESSION_F_CONNECTED);
return 0;
}
@ -548,6 +548,12 @@ vcl_session_is_closing (vcl_session_t * s)
|| s->session_state == STATE_DISCONNECT);
}
static inline u8
vcl_session_is_closed (vcl_session_t * s)
{
return (!s || (s->session_state == STATE_CLOSED));
}
static inline int
vcl_session_closing_error (vcl_session_t * s)
{

View File

@ -209,6 +209,8 @@ vcl_send_session_listen (vcl_worker_t * wrk, vcl_session_t * s)
clib_memcpy_fast (&mp->ip, &s->transport.lcl_ip, sizeof (mp->ip));
mp->port = s->transport.lcl_port;
mp->proto = s->session_type;
if (s->flags & VCL_SESSION_F_CONNECTED)
mp->flags = TRANSPORT_CFG_F_CONNECTED;
app_send_ctrl_evt_to_vpp (mq, app_evt);
}
@ -550,7 +552,8 @@ vcl_session_reset_handler (vcl_worker_t * wrk,
return VCL_INVALID_SESSION_INDEX;
}
session->session_state = STATE_DISCONNECT;
if (session->session_state != STATE_CLOSED)
session->session_state = STATE_DISCONNECT;
VDBG (0, "reset session %u [0x%llx]", sid, reset_msg->handle);
return sid;
}
@ -1556,10 +1559,6 @@ vppcom_unformat_proto (uint8_t * proto, char *proto_str)
*proto = VPPCOM_PROTO_UDP;
else if (!strcmp (proto_str, "udp"))
*proto = VPPCOM_PROTO_UDP;
else if (!strcmp (proto_str, "UDPC"))
*proto = VPPCOM_PROTO_UDPC;
else if (!strcmp (proto_str, "udpc"))
*proto = VPPCOM_PROTO_UDPC;
else if (!strcmp (proto_str, "TLS"))
*proto = VPPCOM_PROTO_TLS;
else if (!strcmp (proto_str, "tls"))
@ -2780,7 +2779,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
{
case SESSION_IO_EVT_RX:
sid = e->session_index;
if (!(session = vcl_session_get (wrk, sid)))
session = vcl_session_get (wrk, sid);
if (vcl_session_is_closed (session))
break;
vcl_fifo_rx_evt_valid_or_break (session);
session_events = session->vep.ev.events;
@ -2793,7 +2793,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
break;
case SESSION_IO_EVT_TX:
sid = e->session_index;
if (!(session = vcl_session_get (wrk, sid)))
session = vcl_session_get (wrk, sid);
if (vcl_session_is_closed (session))
break;
session_events = session->vep.ev.events;
if (!(EPOLLOUT & session_events))
@ -2821,7 +2822,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
connected_msg = (session_connected_msg_t *) e->data;
sid = vcl_session_connected_handler (wrk, connected_msg);
/* Generate EPOLLOUT because there's no connected event */
if (!(session = vcl_session_get (wrk, sid)))
session = vcl_session_get (wrk, sid);
if (vcl_session_is_closed (session))
break;
session_events = session->vep.ev.events;
if (!(EPOLLOUT & session_events))
@ -2835,7 +2837,7 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
case SESSION_CTRL_EVT_DISCONNECTED:
disconnected_msg = (session_disconnected_msg_t *) e->data;
session = vcl_session_disconnected_handler (wrk, disconnected_msg);
if (!session)
if (vcl_session_is_closed (session))
break;
session_events = session->vep.ev.events;
add_event = 1;
@ -2844,7 +2846,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
break;
case SESSION_CTRL_EVT_RESET:
sid = vcl_session_reset_handler (wrk, (session_reset_msg_t *) e->data);
if (!(session = vcl_session_get (wrk, sid)))
session = vcl_session_get (wrk, sid);
if (vcl_session_is_closed (session))
break;
session_events = session->vep.ev.events;
add_event = 1;
@ -2923,7 +2926,7 @@ vcl_epoll_wait_handle_mq (vcl_worker_t * wrk, svm_msg_q_t * mq,
}
}
ASSERT (maxevents > *num_ev);
vcl_mq_dequeue_batch (wrk, mq, maxevents - *num_ev);
vcl_mq_dequeue_batch (wrk, mq, ~0);
svm_msg_q_unlock (mq);
handle_dequeued:
@ -2931,7 +2934,10 @@ handle_dequeued:
{
msg = vec_elt_at_index (wrk->mq_msg_vector, i);
e = svm_msg_q_msg_data (mq, msg);
vcl_epoll_wait_handle_mq_event (wrk, e, events, num_ev);
if (*num_ev < maxevents)
vcl_epoll_wait_handle_mq_event (wrk, e, events, num_ev);
else
vcl_handle_mq_event (wrk, e);
svm_msg_q_free_msg (mq, msg);
}
vec_reset_length (wrk->mq_msg_vector);
@ -2961,7 +2967,7 @@ vppcom_epoll_wait_condvar (vcl_worker_t * wrk, struct epoll_event *events,
continue;
now = clib_time_now (&wrk->clib_time);
wait -= now - start;
wait -= (now - start) * 1e3;
start = now;
}
while (wait > 0);
@ -3593,6 +3599,11 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
*(int *) buffer = SHUT_RDWR;
*buflen = sizeof (int);
break;
case VPPCOM_ATTR_SET_CONNECTED:
session->flags |= VCL_SESSION_F_CONNECTED;
break;
default:
rv = VPPCOM_EINVAL;
break;

View File

@ -51,7 +51,6 @@ typedef enum
VPPCOM_PROTO_UDP,
VPPCOM_PROTO_NONE,
VPPCOM_PROTO_TLS,
VPPCOM_PROTO_UDPC,
VPPCOM_PROTO_QUIC,
} vppcom_proto_t;
@ -71,9 +70,6 @@ vppcom_proto_str (vppcom_proto_t proto)
case VPPCOM_PROTO_TLS:
proto_str = "TLS";
break;
case VPPCOM_PROTO_UDPC:
proto_str = "UDPC";
break;
case VPPCOM_PROTO_QUIC:
proto_str = "QUIC";
break;
@ -87,7 +83,7 @@ vppcom_proto_str (vppcom_proto_t proto)
static inline int
vcl_proto_is_dgram (uint8_t proto)
{
return proto == VPPCOM_PROTO_UDP || proto == VPPCOM_PROTO_UDPC;
return proto == VPPCOM_PROTO_UDP;
}
typedef enum
@ -164,6 +160,7 @@ typedef enum
VPPCOM_ATTR_SET_TCP_USER_MSS,
VPPCOM_ATTR_SET_SHUT,
VPPCOM_ATTR_GET_SHUT,
VPPCOM_ATTR_SET_CONNECTED,
} vppcom_attr_op_t;
typedef struct _vcl_poll

View File

@ -96,7 +96,7 @@ typedef struct vlib_main_t
u64 cpu_time_main_loop_start;
/* Incremented once for each main loop. */
u32 main_loop_count;
volatile u32 main_loop_count;
/* Count of vectors processed this main loop. */
u32 main_loop_vectors_processed;

View File

@ -1434,6 +1434,18 @@ vlib_worker_thread_initial_barrier_sync_and_release (vlib_main_t * vm)
*vlib_worker_threads->wait_at_barrier = 0;
}
/**
* Return true if the wroker thread barrier is held
*/
u8
vlib_worker_thread_barrier_held (void)
{
if (vec_len (vlib_mains) < 2)
return (1);
return (*vlib_worker_threads->wait_at_barrier == 1);
}
void
vlib_worker_thread_barrier_sync_int (vlib_main_t * vm, const char *func_name)
{
@ -1630,6 +1642,41 @@ vlib_worker_thread_barrier_release (vlib_main_t * vm)
}
/**
* Wait until each of the workers has been once around the track
*/
void
vlib_worker_wait_one_loop (void)
{
ASSERT (vlib_get_thread_index () == 0);
if (vec_len (vlib_mains) < 2)
return;
if (vlib_worker_thread_barrier_held ())
return;
u32 *counts = 0;
u32 ii;
vec_validate (counts, vec_len (vlib_mains) - 1);
/* record the current loop counts */
vec_foreach_index (ii, vlib_mains)
counts[ii] = vlib_mains[ii]->main_loop_count;
/* spin until each changes, apart from the main thread, or we'd be
* a while */
for (ii = 1; ii < vec_len (counts); ii++)
{
while (counts[ii] == vlib_mains[ii]->main_loop_count)
CLIB_PAUSE ();
}
vec_free (counts);
return;
}
/*
* Check the frame queue to see if any frames are available.
* If so, pull the packets off the frames and put them to

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