Compare commits

...

63 Commits

Author SHA1 Message Date
Benoît Ganne
752f6fe1b0 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-06 17:03:39 +01:00
Andrew Yourtchenko
3e0dafb746 misc: 19.08.3 Release Notes
Also remove the duplicate 17.01.1 section

Change-Id: I809f417fabea96df506886ae6576b6e8c1b72caf
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-07 18:11:26 +00:00
Jieqiang Wang
ed837b8626 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:28:57 +00:00
Neale Ranns
7006026dec 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>
(cherry picked from commit aecb10b97fa97b215c415ceaa3cac4c97204922f)
2020-07-29 14:15:24 +00:00
Andrew Yourtchenko
7a071e3704 misc: fix the MAKE_PARALLEL_JOBS for 'make verify' target
MAKE_PARALLEL_JOBS was prepending "-j", which in case of nested targets like "verify"
resulted in ninja being executed with "-j -j" flags.

Solution: prepend -j only at the moment of setting the MAKE_PARALLEL_FLAGS variable,
this keeps MAKE_PARALLEL_JOBS intact regardless of depth of the job call tree.

Type: make
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I10a69fe527758e5a862852a9f2102aeaca30e88f
(cherry picked from commit 56ac770df97065ea705ff2f3070055a410113b9f)
2020-06-09 07:20:05 +00:00
Rajesh Goel
a54a9efce7 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 08:48:19 +00:00
Mohsin Kazmi
e4f0020e8d bonding: fix the gso flags
Type: fix

Only add GSO and Checksum offload flags when gso is
enabled.

Change-Id: I58945a4ffbb9a0e6a8640fc01424c63feef16306
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-20 11:24:58 +00:00
Mohsin Kazmi
1140266af1 gso: fix the gso segmentation
Type: fix

This fix is backported from master partial of patch:
gso: add vxlan tunnel support

It fixes required number of buffers for segmentation and
also enables gso infra node on sub-interfaces.

Change-Id: I2cf93cdb39c67e2252a3549905d141fffa95d249
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-20 11:24:33 +00:00
Jakub Grajciar
aefcd1a357 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>
2020-05-15 09:27:38 +00:00
Neale Ranns
08f8d3dfea ipsec: Add/Del SA not MP safe
Type: fix

some crytto engines store key data indexed by SA index. Creating new SAs
means this store reallocs with packets inflight; bad stuff ensues.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ia23c3a59e2d05fb006bdbd9922d01ee192e22853
2020-05-07 01:00:15 +00:00
Dave Barach
9b5d0b7108 vlib: add ASSERT to vlib_time_now(...)
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad
mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
(cherry picked from commit 77d98382824ca211fb55fcf842931930ccfb3baa)
2020-05-07 00:57:02 +00:00
Andrew Yourtchenko
03dd7c08d4 misc: 19.08.2 Release Notes
Change-Id: I78f9edf9c15e9f4a2451be084c04c6318fbb978d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit ec9ce338f05fb8bc90908ed17b8a0bc9eb8cd9f9)
2020-05-04 12:00:37 +00:00
Steven Luong
8da4a72ee1 bonding: Add GSO support
Add GSO support, configurable from the CLI.

Type: feature
Ticket: VPP-1820

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I65885a071b24c74437e6cfe5eff237b01bc1744b
(cherry picked from commit a06f68556e506a6ff7f31a617a036614c84f71c0)
2020-05-01 18:21:37 +00:00
Steven Luong
31325df5e9 virtio: vhost checksum problem for ipv6
When checksum is enable for IPv6, it erroneously set the flag
VNET_BUFFER_F_OFFLOAD_IP_CKSUM. That flag is meant for ip4 packets only.

Type: fix
Ticket: VPP-1857

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id03b2937bfa34e2a9b50a36aafe0700bad7fb95e
(cherry picked from commit f78294d8468f156e066e7e69aab3a1b285810c3a)
(cherry picked from commit 82b62bbf58bc3d1143a359d8f58f7be2f473cddd)
2020-04-29 03:51:30 +00:00
IJsbrand Wijnands
1a78a8da6f build: building applications outside of vpp is missing header files
Building applications using the VPP bin_api outside of the VPP tree is broken, missing these includes.

Type: fix

Change-Id:

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: Ibcb2fea0f5740a73b9577392aa54ac3c93c8d2b5
(cherry picked from commit 724c8051d1f589c8890b0a4ad41a29d8d6581c9c)
2020-04-20 19:52:15 +00:00
Dave Barach
844ec17f93 dhcp: fix unicast pkts, clean up state machine
Send dhcp unicast packets to ip4-lookup. Otherwise, these packets
won't reach a dhcp server on a different subnet.

Do an immediate client scan after processing wakeup events.

Calculate the next process wakeup time by scanning all
clients.

Increase maximum (idle, no-clients-configured) timeout to 1000
seconds.

Reduce log spew.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3d10cd4c353298ed0b19e7e30887dc1d8d07b19e
(cherry picked from commit c54162981cdd41d65ed283df36955007552ddffe)
2020-04-13 15:04:37 -04:00
Dave Barach
943fb15593 ping: fix buffer allocator error handling
The code sets f->n_vectors = n_to_send, but it can bail out of the
loop if vlib_buffer_copy(...) returns 0.

Need to fix f->n_vectors in the error return path, or we enqueue some
number of 0xfefefefe buffer indices in a debug image or worse in a
production image.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2d886266006c6c1c2f9ef8e3b95eb46ac6c0b3df
(cherry picked from commit 8324c55f95dd5ddbf1f5f9c47907204a12e152ef)
2020-04-13 15:05:01 +00:00
Dave Barach
4603e34497 l2: handle complete clone fail in l2_flood
vlib_buffer_clone(...) may not manage to produce any buffer clones at
all.

vlib_buffer_clone_256 should not smash the original buffer reference
count if no clones are produced.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I14d9d53637a220485c7a0036cfc75a4149b264ea
(cherry picked from commit 95e19253320ab07748787f4c8a7620704563f6b8)
2020-04-13 15:02:16 +00:00
Dave Barach
d55f62f788 misc: check return values from vlib_buffer_copy(...)
vlib_buffer_copy(...) returns NULL if the system is temporarily out of
buffers.

This is NOT correct. Please don't be this person:

   c0 = vlib_buffer_copy (vm, p0);
   ci0 = vlib_get_buffer_index (vm, c0);

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic25ef58965871ea5d2b40904df9506803f69e47e
(cherry picked from commit 954c707972bf7efcd227e26d9679544813a78115)
2020-04-13 14:57:22 +00:00
Neale Ranns
8c6efc0610 geneve: Fix the byte swapping for the VNI
Type: fix

- swipe away the vomit indent left last time.
- add tests for VNIs > 16bit

Change-Id: I2d1f591bfb9d7a18996c38969365a509168d4193
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 91fd910d7d7611a28d1f85482ed5d5c3ee6a8853)
2020-04-10 09:49:55 -04:00
Aloys Augustin
5a4ee8d824 tests: pin sphinx and sphinx-rtd-theme
Add these two packages to requirements.txt so that their version and
the version of their dependencies are pinned to limit the risk of
unexpected breakage.

Change-Id: If330404f2e840af3d2628f997ce406cd14e7e128
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 1f2e146bd3f78ac6c7caf7ed92eff82a75644de6)
2020-04-07 17:19:54 +00:00
Andrew Yourtchenko
121e5c1478 docs: pin down sphinx to avoid crash with Sphinx 3.0.0
The vpp-make-test-docs-verify jobs started to fail. The last successful run of it shows:

reating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_gbp_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vrf.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/modules.rst.
sphinx-build -b html -d /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/.sphinx-cache  /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api -c /w/workspace/vpp-make-test-docs-verify-master/test/doc /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/html
Running Sphinx v2.4.4
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 161 source files that are out of date
updating environment: [new config] 161 added, 0 changed, 0 removed
reading sources... [  0%] bfd
reading sources... [  1%] debug
reading sources... [  1%] debug_internal
reading sources... [  2%] discover_tests

The failing jobs show:

Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vrf.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/modules.rst.
sphinx-build -b html -d /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/.sphinx-cache  /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api -c /w/workspace/vpp-make-test-docs-verify-master/test/doc /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/html
Running Sphinx v3.0.0
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 161 source files that are out of date
updating environment: [new config] 161 added, 0 changed, 0 removed
reading sources... [  0%] bfd

Exception occurred:
  File "/usr/lib/python3.6/inspect.py", line 516, in unwrap
    raise ValueError('wrapper loop when unwrapping {!r}'.format(f))
ValueError: wrapper loop when unwrapping scapy.fields.BitEnumField
The full traceback has been saved in /tmp/sphinx-err-n84dadfq.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:39: recipe for target 'html' failed
make[2]: *** [html] Error 2
make[2]: Leaving directory '/w/workspace/vpp-make-test-docs-verify-master/test/doc'
Makefile:274: recipe for target '/w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc' failed

Type: fix

Change-Id: Id98c0f94104e455ea819aacec62f605e53db13ce
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit a2ffc6c2fee60a2289aa9aa549de8a88e4ca2d98)
2020-04-06 15:29:28 +00:00
Dave Barach
58d2ba355b vppinfra: fix typo in dlmalloc.c
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idc567717494b4c40c307f20a40d5e10cd26b0a46
(cherry picked from commit 6e6968f06435727e6887abef4669715c9e59de6b)
2020-03-30 10:41:34 -04:00
Dave Barach
e9501c506c dhcp: update secondary radv_info structures
For details, see the Jira ticket below. Fix gerrit 23350.

Type: fix
Fixes: 28a6eb7
Ticket: VPP-1840

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic9248734bb330eadb302f8410e8db9c64723f075
(cherry picked from commit d1586962a5f8f14fb81c930174d12d0453adaab8)
2020-03-30 13:56:52 +00:00
Dave Barach
1453c47a45 vppinfra: correct fixed pool header size calculation
Remove duplicate space allocation for the pool header. Not significant
w/ CLIB_CACHE_LINE_BYTES >= 64 since the code rounds the size of the
pool header to an even multiple of the cache line size.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I923f2a60e7565cf2dfbc18d78264bf82ff30c926
(cherry picked from commit 6e495ce428e110665ee9616e0951015963502cac)
2020-03-30 13:56:42 +00:00
Dave Barach
a42f9a5423 ip-neighbor: fix ip6_ra_cmd
The option parsing loop had "break" statements included in each
'if (unformat (line_input, "this-option ...") option_values=xxx;'
statement.

Result: the code would silently ignore all but the first
option. Probably broken forever, not easy to spot because the code
looks OK even though it's badly broken.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I667bee85b4ca654b53fb3af421f957957ed0f0f8
(cherry picked from commit 7249b90ab21c20138907e692dcb6032aea9e2f0f)
2020-03-30 13:56:32 +00:00
Mohsin Kazmi
247bbe2cfa tap: fix the host mac address
Tap configuration code sets the host mac address
two time. This patch fixes it.

Type: fix

Change-Id: I7bebb9b7f25352a8a9a98bae6a0636757c0cea9c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 3039753eda526e63d57a09debd3762e5590459df)
2020-03-27 14:29:37 +00:00
Mohsin Kazmi
fd8da46498 tap: fix host mtu configuration setting
host mtu can't be set if tap interface is in namespace.
This patch fixes this issue.

Type: fix

Change-Id: I63811c4b56c708fe708061a8afbaec41994f08ca
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 91592c0c9cdd1bc61a2796e41a8becc30aaf8082)
2020-03-27 14:29:18 +00:00
Mohsin Kazmi
a8e2c583e2 tap: fix the default parameter for num_rx_queues
Type: fix

Change-Id: I1a20fea56f1ba1fada7c7ce96ea333bf097b1273
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 9f32b6acada965d61236fd112445297fc22b60c7)
2020-03-27 14:29:08 +00:00
Mohsin Kazmi
9bf616ca89 tap: fix the numa/queue for buffers
Type: fix

Change-Id: Ib320171708bebde6d1dae0b2c665f9bcfc9102db
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 547a61654629370211468679b263c49571ecb1f9)
2020-03-27 14:28:48 +00:00
Mohsin Kazmi
d6420459c7 virtio: fix link up/down flag
Type: fix

"set int state <interface> down" puts the virtio device link
down. It will not put the link in "UP" state, when
"set int state <interface up>" will be used again to change
the interface admin up. This patch fixes it.

To test:
create tap
set int state tap0 up
set int state tap0 down
sh hardware
sh int
set int state tap0 up
sh int
sh hardware

Change-Id: I3c0e31539f8a2a1e40220e7fb57eedecf408f067
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 529f0e97b6064039c500adce0d54b738954b2ffa)
2020-03-27 14:28:37 +00:00
Mohsin Kazmi
4f81e6ffe1 virtio: fix the out of order descriptors in tx
Type: fix

Some vhost-backends give used descriptors back in
out-of-order. This patch fixes the native virtio to
handle out-of-order descriptors.

Change-Id: I57323303349f6a385e412ee22772ab979ae8edbf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 7f6d145accc6e63b150ab4efc282f19cbe996b57)
2020-03-27 09:39:58 +00:00
Florin Coras
0dfc3af13b classify: fix pcap filter set init
Type: fix

Change-Id: I6a48a6c14bfb84b3460e8211021bc9df6e915dba
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit cd681adab40f49d1305144b6bbbd5118e63a2805)
2020-03-25 13:52:12 +00:00
Neale Ranns
f2e2dd340a ip: Adding IP tables is no MP safe
Type: fix

it was marked MP safe in the CLI (which it shouldn't be) but
it it not marked MP safe on the API.

Change-Id: I4bdea498a510a8b406d13d62a899b6d03656f7e8
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-03-25 08:11:46 +00:00
Elias Rudberg
042e8b0d3d nat: in2out/out2in handoff node index bugfix
This fixes a bug in the initialization of handoff_out2in_index and
handoff_in2out_index where the node index for out2in was set to the
in2out node, and vice versa.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I983ddd3b3cec06f4cb3fb95b2a9cda4ab6d1270f
(cherry picked from commit dd9aedaf377f4af8620408843bd3e4610d3df5f9)
2020-03-17 10:03:46 +00:00
Ole Troan
ef678a4bd1 vppapigen: fix options representation
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ief77110160120ea0e1291cc79949a73404cdbfda
(cherry picked from commit 59b6c0c86d0c3310b8d87b9f2600b6fc7682b549)
2020-03-16 09:10:27 +00:00
Elias Rudberg
8e50e48f4d rdma: fix bug related to ring buffer
Fix a bug that caused some input packets to be dropped due to errors of
the type 'ip4 length > l2 length'. The change is related to the second
call to the rdma_device_input_bufs() function that happens when the end
of the ring buffer is reached.

Type: fix
Change-Id: I332d69ab22242b3443a0baca6e5dd86349a54765
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
(cherry picked from commit e5ecf3ea4b456afb710f4ed903cd7e4c1ae87859)
2020-03-11 20:03:18 +00:00
Steven Luong
6f171a7756 dpdk: TSO does not work for Cisco VIC
While TSO is supported for Intel NIC, Cisco VIC does not work.
The problem is due to txmode offloads is not properly set for
the Cisco VIC when enable-tcp-udp-checksum is configured.

Type: fix
Ticket: VPP-1838

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I72c41db9b327ed8d08ef70d74e8cc6206d4a102f
(cherry picked from commit ac8bb9263438221cc93db62257ffd8db711530e2)
2020-03-10 14:23:08 +00:00
Steven Luong
4056ed59a0 avf: Handle chain buffer in TX properly
For chain buffer, need to traverse b->next_buffer to transmit all buffers
in the chain. Only set EOP at the last descriptor in the chain to signal
this is a chain descriptor.

Introduce slow path to handle ring wrap. This is needed because chain
buffer may consist of multiple pieces and it may span from near the end of
the ring to the beginning of the ring.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id7c872f3e39e09f3566aa63f3cdba8f40736d508
(cherry picked from commit f7ab7b2d9bc0f42c1e766d22d49dd0dc4f28abb6)
2020-03-10 14:22:23 +00:00
Matthew Smith
cd88ca366c ip6: fix l4 checksum with hop-by-hop header
L4 checksums for IPv6 should be calculated using a pseudo header that
includes the source/destination addresses, payload length, and payload
protocol.

ip6_tcp_udp_icmp_compute_checksum() was using the payload length and
protocol from the IPv6 header. If there is a hop-by-hop header (or any
other extension header), the payload length used for the pseudo header
should only include the upper layer header and payload and not the
extension header bytes. Same deal with the protocol, the upper layer
next header value should be used instead of the extension header.

Type: fix
Fixes: cb9cadad57

Change-Id: Ifa2c9ad41c0fc4eea674f0671255b637c8e01f71
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 97677a26f7c857e7ee0acbdb2c13eef214aa70a8)
2020-03-10 14:21:06 +00:00
Neale Ranns
24064d02aa fib: adjacency midchain teardown (VPP-1841)
Type: fix

Change-Id: I57f8bfbce4feed9d2775875cb8b1b729a47900a4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-02-19 18:42:44 +00:00
Neale Ranns
02d5a67d39 fib: fib path realloc during midchain stack
Type: fix

Change-Id: I0677f46dfa22c8abab7f311230a09ef1cd8ac335
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-02-18 15:23:29 +00:00
Neale Ranns
61b96ce607 fib: Fix some more realloc errors
Type: fix

Change-Id: I6011f5d6eae79019d3c16a260a9bedf0a76d2151
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 6ede570259a91cd0c34b9faf9fec7e4ec8275200)
2020-02-14 16:50:44 +00:00
Dave Barach
af9c2a3435 classify: fix "show classify filter" debug CLI
Null pointer bug, memory leak. D'oh!

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic2865757ed9cbb7f48d23c7c30b64299eb5f6674
(cherry picked from commit 104112f2d412a4576b5e0d3bbb20665d2b5bd615)
2020-02-13 13:35:37 +00:00
Dave Barach
b01058ce2c classify: pcap / packet trace debug CLI bugs
"classify filter trace ... " and "classify filter pcap ..." are
mutually exclusive.

vnet_pcap_dispatch_trace_configure needs to check for
set->table_indices == NULL.

Type: fix
Ticket: VPP-1827

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I43733364087ffb0a43de92e450955033431d559d
(cherry picked from commit 196fce2b62c0d215722dd233aa8bf70a43aa0a66)
2020-02-12 13:45:47 +00:00
John Lo
1d609270b6 ipsec: set l2_len for GRE-TEB tunnel decap
Type: fix
Ticket: VPP-1831

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I655964b22021ac38cbced577091a1156286d4fd6
2020-02-05 14:29:59 +00:00
Dave Barach
a4eac3fb0a vppinfra: fix typo in tw_timer_template.c
Fix minor memory leak

Type: fix
Ticket: VPP-1833
Fixes: 4af9ba1dab

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id10fba70471ca78f73f14146054f6b12c5d4431f
2020-02-05 08:34:18 +00:00
Steven Luong
7611d5d9e7 virtio: vhost gso is broken in some topology
Recent modification added a call to vnet_gso_header_offset_parser in the
beginning of vhost_user_handle_tx_offload. The former routine may set tcp or
udp->checksum to 0. While it is appropriate to set it to 0 for the GSO packet,
it is broken and causes checksum error if the aformentiooned routine is called
by a non-GSO packet. The fix is to not call vhost_user_handle_tx_offload
if the buffer does not indicate checksum offload is needed.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6e699d7a40b7887ff149cd8f77e8f0fa9374ef19
(cherry picked from commit 564e1672917e205d7ae79525bb937df18f8d764b)
2020-02-05 08:33:38 +00:00
Steven Luong
1934b13d36 fib: refresh adj pointer after fib_walk_sync due to possible realloc
fib_walk_sync may call adj_alloc which may cause adj_pool to expand. When
that happens, any previous frame which still use the old adj pointer needs to
refresh. Failure to do so may access or update to the old adj memory
unintentionally and crash mysteriously.

Type: fix
Ticket: VPPSUPP-54

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I173dec4c5ce81c6e26c4fe011b894a7345901b24
(cherry picked from commit 3d5f6229bccf77fcf7e0e17ab4f1b361fedd1b2b)
2020-02-03 15:06:38 +00:00
Andrew Yourtchenko
fce396738f misc: VPP 20.01 Release Notes
Type: docs
Change-Id: Iee518fbb9c72716cc90a3ea8efbf3ecbaa969a84
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-01-29 20:33:31 +00:00
Andrew Yourtchenko
fc98203b5d misc: Markdown cleanups for the 20.01 release
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I821197364a2fee9b52b1f014288b1f5e9e3c494c
2020-01-29 19:32:53 +00:00
Benoît Ganne
a2c1951e56 devices: vhost: fix data offset on input
Regardless of whether the virtio_net_hdr is sent as a separate
descriptors or in the same descriptor as the data, we always want to
skip the header length - maybe moving to the next descriptor along the
way.

Type: fix

Change-Id: Iaa70aeb310e589639b20f8c7029aaa8d3ce5d307
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 5ecc1e4d433a34845c7bfd761dc990413e6c321b)
2020-01-29 18:35:11 +00:00
Florin Coras
fb15c0c0cf session tcp: fix packet tracing
Type: fix
Ticket: VPP-1830

Change-Id: Ib823d016c64998779fb1d00b8aad3acb5e8340be
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 30928f87a3c9d98e288d1364d50c032e052e69ab)
2020-01-28 16:28:32 +00:00
Neale Ranns
7d3c2b738e fib: Reload the adj after possible realloc (VPP-1822)
Type: fix
Fixes: 418b225931634f6d113d2971cb9550837d69929d

Change-Id: Ia5f4ea24188c4f3de87e06a7fd07b40bcb47cfc1
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-27 20:55:34 +00:00
Dave Wallace
664c9613ac nsim: enable output scheduling on main thread
Type: fix
Ticket: VPP-1813

Change-Id: I5d47cb9bc7eb7f3c8485e3b42f0701e81d87ba2a
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit c0c4eec3bc309bcc656eade82f17754875f9ed7c)
2020-01-27 20:55:12 +00:00
Satoru Matsushima
0c514f0d76 srv6-mobile: Update the document
Updating the document of srv6-mobile plugin code integrated into stable/2001. The reason of this patch just only for the document is that the latest commit to master was reverted by the release master for some reason. The commit included not only the code for new feature, but also the updated document for the already merged code into stable/2001. The previous doc is work-in-progress status in terms of its CLI and features. It seems there is some confusion on this patch is trying to update the document of outside feature of stable/2001 which is not true. This patch exactly reflects the correct information of srv6-mobile plugin within the extent of stable/2001.


Type: docs



Signed-off-by: Satoru Matsushima <satoru.matsushima@gmail.com>
Change-Id: I376386ef6fc9584ab945db7358e3c4a698471e9b
Signed-off-by: Satoru Matsushima <satoru.matsushima@gmail.com>
2020-01-27 16:20:25 +00:00
Florin Coras
abd9312516 session: fix node runtime in pre-input queue handler
Call session queue node with the right node runtime instead of the
pre-input node runtime.

Type: fix
Ticket: VPP-1826

Change-Id: I43d20bed4930fc877b187ce7ecdce62034b393c5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 2d8829cbb5f3d214fbc09bf4258573659e0c5e60)
2020-01-25 19:31:43 +00:00
Dave Barach
9af7a98cf8 api: mark api_trace_command_fn thread-safe
Binary API trace replay with multiple worker threads depends in many
cases on worker thread graph replica maintenance. If we (implicitly)
assert a worker thread barrier at the debug CLI level, all graph
replica changes are deferred until the replay operation completes. If
an interface is deleted, the wheels may fall off.

Type: fix
Ticket: VPP-1824

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9b07d43f8501caa5519e5ff9ae4c19dc2661cc84
2020-01-24 00:21:06 +00:00
Florin Coras
864af09508 hsa: proxy app fixes
Type: fix
Ticket: VPP-1825

Change-Id: Icb4b331c9346d3781f4ddd6f62891c78d4059c1f
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit f5c7305c4ab21fe1c3eeeee1484449586464813a)
2020-01-23 19:00:29 +00:00
Neale Ranns
20398a368c fib: FIB crash removing labelled route (VPP-1818)
Type: fix

The crash occured trying to retreive a NULL path list to walk the path
extensions. A walk shoul not be required, because there should be no
extensins, since all paths are removed. The problem is that when the
paths were added, they were not sorted, hence neither were the
extensions and when they were updated, duplicate extensions were added,
and hence a path removal did not remove them all.
Fix is to make sure paths are sorted.

Change-Id: I069d937de8e7bc8aae3d92f588db4daff727d863
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 257749c40946a9269140d322e374d74c3b6eefb8)
2020-01-22 22:34:43 +00:00
Neale Ranns
29acfa2ad5 ipsec: re-enable DPDK IPSec for tunnel decap/encap (VPP-1823)
Type: fix

Change-Id: Iff9b1960b122f7d326efc37770b4ae3e81eb3122
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-22 19:23:38 +00:00
Neale Ranns
e3cabba9b8 fib: Adjacency realloc during rewrite update walk (VPP-1822)
Type: fix

Change-Id: I0e826284c50713d322ee7943d87fd3363cfbdfbc
Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-01-21 20:26:43 +00:00
Andrew Yourtchenko
c7fe31cfff misc: Initial changes for stable/2001 branch
Type: docs
Change-Id: I0a8a43bd5436b5d3cdd9b8937cd0b2366e523f91
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-01-15 22:09:55 +00:00
116 changed files with 3041 additions and 992 deletions

View File

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

View File

@ -124,6 +124,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)
@ -308,7 +313,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)

1442
RELEASE.md

File diff suppressed because it is too large Load Diff

View File

@ -653,12 +653,10 @@ configure_check_timestamp = \
# NB: GNU Make 4.2 will let us use '$(file </proc/cpuinfo)' to both test
# for file presence and content; for now this will have to do.
ifndef MAKE_PARALLEL_JOBS
MAKE_PARALLEL_JOBS = -j $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
MAKE_PARALLEL_JOBS = $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
$(shell grep -c ^processor /proc/cpuinfo), 2)
else
MAKE_PARALLEL_JOBS := -j $(MAKE_PARALLEL_JOBS)
endif
MAKE_PARALLEL_FLAGS ?= $(if $($(PACKAGE)_make_parallel_fails),,$(MAKE_PARALLEL_JOBS))
MAKE_PARALLEL_FLAGS ?= $(if $($(PACKAGE)_make_parallel_fails),,-j $(MAKE_PARALLEL_JOBS))
# Make command shorthand for packages & tools.
PACKAGE_MAKE = \

View File

@ -16,4 +16,7 @@ Programming notes for developers.
- @subpage stats_doc
- @subpage if_stats_client_doc
- @subpage api_lang_doc
- @subpage handoff_queue_demo_plugin
- @subpage handoff_queue_demo_plugin
- @subpage lcov_code_coverage
- @subpage mdata_doc

View File

@ -16,6 +16,7 @@ Several modules provide operational, dataplane-user focused documentation.
- @subpage lldp_doc
- @subpage map_doc
- @subpage marvel_plugin_doc
- @subpage srv6_mobile_plugin
- @subpage mtu_doc
- @subpage nat64_doc
- @subpage nat_ha_doc

View File

@ -1,3 +1,5 @@
# Code coverage analysis with lcov {#lcov_code_coverage}
## Prerequisites
The Linux gcov and lcov tools are fussy about gcc / g++ compiler

View File

@ -17,4 +17,6 @@ packet-generator new {
}
}
classify filter trace mask l3 ip4 src match l3 ip4 src 192.168.1.15
comment { Pick one, uncomment, and "pcap rx ..." or "trace add pg-input ..." }
comment { classify filter trace mask l3 ip4 src match l3 ip4 src 192.168.1.15 }
comment { classify filter pcap mask l3 ip4 src match l3 ip4 src 192.168.1.15 }

View File

@ -333,7 +333,8 @@ typedef struct
} avf_input_trace_t;
#define foreach_avf_tx_func_error \
_(NO_FREE_SLOTS, "no free tx slots")
_(SEGMENT_SIZE_EXCEEDED, "segment size exceeded") \
_(NO_FREE_SLOTS, "no free tx slots")
typedef enum
{

View File

@ -31,8 +31,8 @@ avf_tx_desc_get_dtyp (avf_tx_desc_t * d)
}
static_always_inline u16
avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
u32 n_packets, int use_va_dma)
avf_tx_enqueue (vlib_main_t * vm, vlib_node_runtime_t * node, avf_txq_t * txq,
u32 * buffers, u32 n_packets, int use_va_dma)
{
u16 next = txq->next;
u64 bits = AVF_TXD_CMD_EOP | AVF_TXD_CMD_RSV;
@ -41,6 +41,8 @@ avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
u16 mask = txq->size - 1;
vlib_buffer_t *b[4];
avf_tx_desc_t *d = txq->descs + next;
u16 n_desc_needed;
vlib_buffer_t *b0;
/* avoid ring wrap */
n_desc_left = txq->size - clib_max (txq->next, txq->n_enqueued + 8);
@ -48,6 +50,7 @@ avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
if (n_desc_left == 0)
return 0;
/* Fast path, no ring wrap */
while (n_packets_left && n_desc_left)
{
u32 or_flags;
@ -103,6 +106,57 @@ avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
txq->bufs[next] = buffers[0];
b[0] = vlib_get_buffer (vm, buffers[0]);
/* Deal with chain buffer if present */
if (b[0]->flags & VLIB_BUFFER_NEXT_PRESENT)
{
n_desc_needed = 1;
b0 = b[0];
/* Wish there were a buffer count for chain buffer */
while (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
{
b0 = vlib_get_buffer (vm, b0->next_buffer);
n_desc_needed++;
}
/* spec says data descriptor is limited to 8 segments */
if (PREDICT_FALSE (n_desc_needed > 8))
{
vlib_buffer_free_one (vm, buffers[0]);
vlib_error_count (vm, node->node_index,
AVF_TX_ERROR_SEGMENT_SIZE_EXCEEDED, 1);
n_packets_left -= 1;
buffers += 1;
continue;
}
if (PREDICT_FALSE (n_desc_left < n_desc_needed))
/*
* Slow path may be able to to deal with this since it can handle
* ring wrap
*/
break;
while (b[0]->flags & VLIB_BUFFER_NEXT_PRESENT)
{
if (use_va_dma)
d[0].qword[0] = vlib_buffer_get_current_va (b[0]);
else
d[0].qword[0] = vlib_buffer_get_current_pa (vm, b[0]);
d[0].qword[1] = (((u64) b[0]->current_length) << 34) |
AVF_TXD_CMD_RSV;
next += 1;
n_desc += 1;
n_desc_left -= 1;
d += 1;
txq->bufs[next] = b[0]->next_buffer;
b[0] = vlib_get_buffer (vm, b[0]->next_buffer);
}
}
if (use_va_dma)
d[0].qword[0] = vlib_buffer_get_current_va (b[0]);
else
@ -118,6 +172,84 @@ avf_tx_enqueue (vlib_main_t * vm, avf_txq_t * txq, u32 * buffers,
d += 1;
}
/* Slow path to support ring wrap */
if (PREDICT_FALSE (n_packets_left))
{
txq->n_enqueued += n_desc;
n_desc = 0;
d = txq->descs + (next & mask);
/* +8 to be consistent with fast path */
n_desc_left = txq->size - (txq->n_enqueued + 8);
while (n_packets_left && n_desc_left)
{
txq->bufs[next & mask] = buffers[0];
b[0] = vlib_get_buffer (vm, buffers[0]);
/* Deal with chain buffer if present */
if (b[0]->flags & VLIB_BUFFER_NEXT_PRESENT)
{
n_desc_needed = 1;
b0 = b[0];
while (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
{
b0 = vlib_get_buffer (vm, b0->next_buffer);
n_desc_needed++;
}
/* Spec says data descriptor is limited to 8 segments */
if (PREDICT_FALSE (n_desc_needed > 8))
{
vlib_buffer_free_one (vm, buffers[0]);
vlib_error_count (vm, node->node_index,
AVF_TX_ERROR_SEGMENT_SIZE_EXCEEDED, 1);
n_packets_left -= 1;
buffers += 1;
continue;
}
if (PREDICT_FALSE (n_desc_left < n_desc_needed))
break;
while (b[0]->flags & VLIB_BUFFER_NEXT_PRESENT)
{
if (use_va_dma)
d[0].qword[0] = vlib_buffer_get_current_va (b[0]);
else
d[0].qword[0] = vlib_buffer_get_current_pa (vm, b[0]);
d[0].qword[1] = (((u64) b[0]->current_length) << 34) |
AVF_TXD_CMD_RSV;
next += 1;
n_desc += 1;
n_desc_left -= 1;
d = txq->descs + (next & mask);
txq->bufs[next & mask] = b[0]->next_buffer;
b[0] = vlib_get_buffer (vm, b[0]->next_buffer);
}
}
if (use_va_dma)
d[0].qword[0] = vlib_buffer_get_current_va (b[0]);
else
d[0].qword[0] = vlib_buffer_get_current_pa (vm, b[0]);
d[0].qword[1] = (((u64) b[0]->current_length) << 34) | bits;
next += 1;
n_desc += 1;
buffers += 1;
n_packets_left -= 1;
n_desc_left -= 1;
d = txq->descs + (next & mask);
}
}
if ((slot = clib_ring_enq (txq->rs_slots)))
{
u16 rs_slot = slot[0] = (next - 1) & mask;
@ -177,15 +309,15 @@ retry:
n_free = (complete_slot + 1 - first) & mask;
txq->n_enqueued -= n_free;
vlib_buffer_free_from_ring (vm, txq->bufs, first, txq->size,
n_free);
vlib_buffer_free_from_ring_no_next (vm, txq->bufs, first, txq->size,
n_free);
}
}
if (ad->flags & AVF_DEVICE_F_VA_DMA)
n_enq = avf_tx_enqueue (vm, txq, buffers, n_left, 1);
n_enq = avf_tx_enqueue (vm, node, txq, buffers, n_left, 1);
else
n_enq = avf_tx_enqueue (vm, txq, buffers, n_left, 0);
n_enq = avf_tx_enqueue (vm, node, txq, buffers, n_left, 0);
n_left -= n_enq;

View File

@ -72,7 +72,8 @@ openssl_ops_enc_cbc (vlib_main_t * vm, vnet_crypto_op_t * ops[], u32 n_ops,
int out_len;
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

@ -122,9 +122,7 @@ format_dhcp_client (u8 * s, va_list * va)
s =
format (s, "\n retry-count:%d, next-xmt:%.2f", c->retry_count,
c->next_transmit);
s =
format (s, "\n adjacencies:[unicast:%d broadcast:%d]", c->ai_ucast,
c->ai_bcast);
s = format (s, "\n broadcast adjacency:%d", c->ai_bcast);
}
return s;
}
@ -165,15 +163,6 @@ dhcp_client_acquire_address (dhcp_client_main_t * dcm, dhcp_client_t * c)
FIB_ROUTE_PATH_FLAG_NONE);
/* *INDENT-ON* */
}
if (c->learned.dhcp_server.as_u32)
{
ip46_address_t dst = {
.ip4 = c->learned.dhcp_server,
};
c->ai_ucast = adj_nbr_add_or_lock (FIB_PROTOCOL_IP4,
VNET_LINK_IP4, &dst,
c->sw_if_index);
}
}
clib_memcpy (&c->installed, &c->learned, sizeof (c->installed));
c->addresses_installed = 1;
@ -210,8 +199,6 @@ dhcp_client_release_address (dhcp_client_main_t * dcm, dhcp_client_t * c)
DPO_PROTO_IP4, &nh, c->sw_if_index, ~0,
1, FIB_ROUTE_PATH_FLAG_NONE);
}
adj_unlock (c->ai_ucast);
c->ai_ucast = ADJ_INDEX_INVALID;
}
clib_memset (&c->installed, 0, sizeof (c->installed));
c->addresses_installed = 0;
@ -253,7 +240,7 @@ dhcp_client_addr_callback (u32 * cindex)
if (c->event_callback)
c->event_callback (c->client_index, c);
DHCP_INFO ("update: %U", format_dhcp_client, dcm, c);
DHCP_INFO ("update: %U", format_dhcp_client, dcm, c, 1 /* verbose */ );
}
static void
@ -492,7 +479,7 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c,
DHCP_INFO ("send: type:%U bcast:%d %U",
format_dhcp_packet_type, type,
is_broadcast, format_dhcp_client, dcm, c);
is_broadcast, format_dhcp_client, dcm, c, 1 /* verbose */ );
/* Interface(s) down? */
if ((hw->flags & VNET_HW_INTERFACE_FLAG_LINK_UP) == 0)
@ -518,24 +505,13 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c,
vnet_buffer (b)->sw_if_index[VLIB_RX] = c->sw_if_index;
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
if (ADJ_INDEX_INVALID == c->ai_ucast)
is_broadcast = 1;
if (is_broadcast)
{
node_index = ip4_rewrite_node.index;
vnet_buffer (b)->ip.adj_index[VLIB_TX] = c->ai_bcast;
}
else
{
ip_adjacency_t *adj = adj_get (c->ai_ucast);
if (IP_LOOKUP_NEXT_ARP == adj->lookup_next_index)
node_index = ip4_arp_node.index;
else
node_index = ip4_rewrite_node.index;
vnet_buffer (b)->ip.adj_index[VLIB_TX] = c->ai_ucast;
}
node_index = dcm->ip4_lookup_node_index;
/* Enqueue the packet right now */
f = vlib_get_frame_to_node (vm, node_index);
@ -717,8 +693,6 @@ dhcp_discover_state (dhcp_client_main_t * dcm, dhcp_client_t * c, f64 now)
* State machine "DISCOVER" state. Send a dhcp discover packet,
* eventually back off the retry rate.
*/
DHCP_INFO ("enter discover: %U", format_dhcp_client, dcm, c);
/*
* In order to accept any OFFER, whether broadcasted or unicasted, we
* need to configure the dhcp-client-detect feature as an input feature
@ -753,7 +727,8 @@ dhcp_request_state (dhcp_client_main_t * dcm, dhcp_client_t * c, f64 now)
* State machine "REQUEST" state. Send a dhcp request packet,
* eventually drop back to the discover state.
*/
DHCP_INFO ("enter request: %U", format_dhcp_client, dcm, c);
DHCP_INFO ("enter request: %U", format_dhcp_client, dcm, c,
1 /*verbose */ );
send_dhcp_pkt (dcm, c, DHCP_PACKET_REQUEST, 1 /* is_broadcast */ );
@ -793,7 +768,8 @@ dhcp_bound_state (dhcp_client_main_t * dcm, dhcp_client_t * c, f64 now)
*/
if (now > c->lease_expires)
{
DHCP_INFO ("lease expired: %U", format_dhcp_client, dcm, c);
DHCP_INFO ("lease expired: %U", format_dhcp_client, dcm, c,
1 /*verbose */ );
/* reset all data for the client. do not send any more messages
* since the objects to do so have been lost */
@ -801,7 +777,7 @@ dhcp_bound_state (dhcp_client_main_t * dcm, dhcp_client_t * c, f64 now)
return 1;
}
DHCP_INFO ("enter bound: %U", format_dhcp_client, dcm, c);
DHCP_INFO ("enter bound: %U", format_dhcp_client, dcm, c, 1 /* verbose */ );
send_dhcp_pkt (dcm, c, DHCP_PACKET_REQUEST, 0 /* is_broadcast */ );
c->retry_count++;
@ -827,7 +803,9 @@ dhcp_client_sm (f64 now, f64 timeout, uword pool_index)
/* Time for us to do something with this client? */
if (now < c->next_transmit)
return timeout;
return c->next_transmit;
DHCP_INFO ("sm active session %d", c - dcm->clients);
again:
switch (c->state)
@ -853,17 +831,15 @@ again:
break;
}
if (c->next_transmit < now + timeout)
return c->next_transmit - now;
return timeout;
return c->next_transmit;
}
static uword
dhcp_client_process (vlib_main_t * vm,
vlib_node_runtime_t * rt, vlib_frame_t * f)
{
f64 timeout = 100.0;
f64 timeout = 1000.0;
f64 next_expire_time, this_next_expire_time;
f64 now;
uword event_type;
uword *event_data = 0;
@ -883,20 +859,32 @@ dhcp_client_process (vlib_main_t * vm,
{
case EVENT_DHCP_CLIENT_WAKEUP:
for (i = 0; i < vec_len (event_data); i++)
timeout = dhcp_client_sm (now, timeout, event_data[i]);
break;
(void) dhcp_client_sm (now, timeout, event_data[i]);
/* FALLTHROUGH */
case ~0:
/* *INDENT-OFF* */
DHCP_INFO ("timeout");
pool_foreach (c, dcm->clients,
({
timeout = dhcp_client_sm (now, timeout,
(uword) (c - dcm->clients));
}));
/* *INDENT-ON* */
if (pool_elts (dcm->clients) == 0)
timeout = 100.0;
if (pool_elts (dcm->clients))
{
/* *INDENT-OFF* */
next_expire_time = 1e70;
pool_foreach (c, dcm->clients,
({
this_next_expire_time = dhcp_client_sm
(now, timeout, (uword) (c - dcm->clients));
next_expire_time = this_next_expire_time < next_expire_time ?
this_next_expire_time : next_expire_time;
}));
if (next_expire_time > now)
timeout = next_expire_time - now;
else
{
clib_warning ("BUG");
timeout = 1.13;
}
/* *INDENT-ON* */
}
else
timeout = 1000.0;
break;
}
@ -999,7 +987,6 @@ dhcp_client_add_del (dhcp_client_add_del_args_t * a)
c->client_identifier = a->client_identifier;
c->set_broadcast_flag = a->set_broadcast_flag;
c->dscp = a->dscp;
c->ai_ucast = ADJ_INDEX_INVALID;
c->ai_bcast = adj_nbr_add_or_lock (FIB_PROTOCOL_IP4,
VNET_LINK_IP4,
&ADJ_BCAST_ADDR, c->sw_if_index);
@ -1015,7 +1002,7 @@ dhcp_client_add_del (dhcp_client_add_del_args_t * a)
vlib_process_signal_event (vm, dhcp_client_process_node.index,
EVENT_DHCP_CLIENT_WAKEUP, c - dcm->clients);
DHCP_INFO ("create: %U", format_dhcp_client, dcm, c);
DHCP_INFO ("create: %U", format_dhcp_client, dcm, c, 1 /* verbose */ );
}
else
{
@ -1249,7 +1236,15 @@ static clib_error_t *
dhcp_client_init (vlib_main_t * vm)
{
dhcp_client_main_t *dcm = &dhcp_client_main;
vlib_node_t *ip4_lookup_node;
ip4_lookup_node = vlib_get_node_by_name (vm, (u8 *) "ip4-lookup");
/* Should never happen... */
if (ip4_lookup_node == 0)
return clib_error_return (0, "ip4-lookup node not found");
dcm->ip4_lookup_node_index = ip4_lookup_node->index;
dcm->vlib_main = vm;
dcm->vnet_main = vnet_get_main ();
dcm->seed = (u32) clib_cpu_time_now ();

View File

@ -108,8 +108,6 @@ typedef struct dhcp_client_t_
u8 client_hardware_address[6];
u8 client_detect_feature_enabled;
/* the unicast adjacency for the DHCP server */
adj_index_t ai_ucast;
/* the broadcast adjacency on the link */
adj_index_t ai_bcast;
/* IP DSCP to set in sent packets */
@ -125,6 +123,9 @@ typedef struct
uword *client_by_sw_if_index;
u32 seed;
/* ip4-lookup node index */
u32 ip4_lookup_node_index;
/* convenience */
vlib_main_t *vlib_main;
vnet_main_t *vnet_main;

View File

@ -30,4 +30,4 @@ dhcp_proxy_error (BAD_YIADDR, "DHCP packets with bad your_ip_address fields")
dhcp_proxy_error (BAD_SVR_FIB_OR_ADDRESS, "DHCP packets not from DHCP server or server FIB.")
dhcp_proxy_error (PKT_TOO_BIG, "DHCP packets which are too big.")
dhcp_proxy_error (FOR_US, "DHCP packets for local client.")
dhcp_proxy_error (ALLOC_FAIL, "DHCP buffer allocation failures.")

View File

@ -364,6 +364,13 @@ dhcp_proxy_to_server_input (vlib_main_t * vm,
u32 ci0;
c0 = vlib_buffer_copy (vm, b0);
if (c0 == NULL)
{
vlib_node_increment_counter
(vm, dhcp_proxy_to_server_node.index,
DHCP_PROXY_ERROR_ALLOC_FAIL, 1);
continue;
}
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (c0);
ci0 = vlib_get_buffer_index (vm, c0);
server = &proxy->dhcp_servers[ii];

View File

@ -258,6 +258,9 @@ check_send_client_message (vlib_main_t * vm,
next_index = ip6_rewrite_mcast_node.index;
c0 = vlib_buffer_copy (vm, p0);
if (c0 == NULL)
return client_state->keep_sending_client_message;
ci0 = vlib_get_buffer_index (vm, c0);
ip = (ip6_header_t *) vlib_buffer_get_current (c0);

View File

@ -70,6 +70,8 @@ typedef struct
{
prefix_info_t *prefix_pool;
const u8 **prefix_group_name_by_index;
/* vector of active prefix pool indicies, prep-H for pool_foreach(..) */
u32 *indices;
} ip6_prefix_main_t;
static ip6_prefix_main_t ip6_prefix_main;
@ -277,6 +279,7 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp)
f64 current_time;
clib_error_t *error = 0;
u32 i;
prefix_info_t *prefix_info;
current_time = vlib_time_now (vm);
@ -363,13 +366,26 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp)
send_client_message_start_stop (sw_if_index, server_index,
mp->msg_type, 0, 0);
vec_reset_length (pm->indices);
/*
* We're going to loop through the pool multiple times,
* so collect active indices.
*/
/* *INDENT-OFF* */
pool_foreach (prefix_info, pm->prefix_pool,
({
vec_add1 (pm->indices, prefix_info - pm->prefix_pool);
}));
/* *INDENT-ON* */
for (i = 0; i < n_prefixes; i++)
{
prefix_info_t *prefix_info = 0;
u8 prefix_length;
u32 valid_time;
u32 preferred_time;
int j;
prefix_info = 0;
api_prefix = &mp->prefixes[i];
prefix = (ip6_address_t *) api_prefix->prefix.address;
@ -386,32 +402,40 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp)
continue;
u8 address_prefix_present = 0;
/* *INDENT-OFF* */
pool_foreach (prefix_info, pm->prefix_pool,
({
if (is_dhcpv6_pd_prefix (prefix_info) &&
prefix_info->opaque_data == sw_if_index &&
prefix_info->prefix_length == prefix_length &&
ip6_prefixes_equal (&prefix_info->prefix, prefix, prefix_length))
{
address_prefix_present = 1;
goto prefix_pool_foreach_out;
}
}));
/* *INDENT-ON* */
prefix_pool_foreach_out:
/* Look for a matching prefix_info */
for (j = 0; j < vec_len (pm->indices); j++)
{
prefix_info = pool_elt_at_index (pm->prefix_pool, pm->indices[j]);
if (is_dhcpv6_pd_prefix (prefix_info) &&
prefix_info->opaque_data == sw_if_index &&
prefix_info->prefix_length == prefix_length &&
ip6_prefixes_equal (&prefix_info->prefix, prefix,
prefix_length))
{
address_prefix_present = 1;
break;
}
}
if (address_prefix_present)
{
/* Found the (primary) prefix, update prefix timers */
prefix_info->preferred_lt = preferred_time;
prefix_info->valid_lt = valid_time;
prefix_info->due_time = current_time + valid_time;
if (prefix_info->due_time > rm->max_valid_due_time)
rm->max_valid_due_time = prefix_info->due_time;
/*
* We found the prefix. Move along.
* Don't touch the prefix timers!
* If we happen to receive a renew reply just before we
* would have sent a solicit to renew the prefix delegation,
* we forget to renew the delegation. Worse luck, we start
* sending router advertisements with a valid time of zero,
* and the wheels fall off...
* Tell the RA code to update any secondary per-interface
* timers that it might be hoarding.
*/
ip6_ra_update_secondary_radv_info
(prefix, prefix_length,
prefix_info->opaque_data /* sw_if_index */ ,
valid_time, preferred_time);
continue;
}
@ -419,6 +443,7 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp)
continue;
pool_get (pm->prefix_pool, prefix_info);
vec_add1 (pm->indices, prefix_info - pm->prefix_pool);
prefix_info->prefix_group_index = client_state->prefix_group_index;
set_is_dhcpv6_pd_prefix (prefix_info, 1);
prefix_info->opaque_data = sw_if_index;

View File

@ -264,6 +264,9 @@ check_pd_send_client_message (vlib_main_t * vm,
next_index = ip6_rewrite_mcast_node.index;
c0 = vlib_buffer_copy (vm, p0);
if (c0 == NULL)
return client_state->keep_sending_client_message;
ci0 = vlib_get_buffer_index (vm, c0);
ip = (ip6_header_t *) vlib_buffer_get_current (c0);

View File

@ -27,3 +27,4 @@ dhcpv6_proxy_error (NO_RELAY_MESSAGE_OPTION, "DHCPv6 reply packets without relay
dhcpv6_proxy_error (BAD_SVR_FIB_OR_ADDRESS, "DHCPv6 packets not from DHCPv6 server or server FIB.")
dhcpv6_proxy_error (PKT_TOO_BIG, "DHCPv6 packets which are too big.")
dhcpv6_proxy_error (WRONG_INTERFACE_ID_OPTION, "DHCPv6 reply to invalid interface.")
dhcpv6_proxy_error (ALLOC_FAIL, "DHCPv6 buffer allocation failures.")

View File

@ -437,6 +437,13 @@ dhcpv6_proxy_to_server_input (vlib_main_t * vm,
u32 ci0;
c0 = vlib_buffer_copy (vm, b0);
if (c0 == NULL)
{
vlib_node_increment_counter
(vm, dhcpv6_proxy_to_server_node.index,
DHCPV6_PROXY_ERROR_ALLOC_FAIL, 1);
continue;
}
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (c0);
ci0 = vlib_get_buffer_index (vm, c0);
server = &proxy->dhcp_servers[ii];

View File

@ -199,6 +199,15 @@ check_l3cache ()
return 0;
}
static void
dpdk_enable_l4_csum_offload (dpdk_device_t * xd)
{
xd->port_conf.txmode.offloads |= DEV_TX_OFFLOAD_TCP_CKSUM;
xd->port_conf.txmode.offloads |= DEV_TX_OFFLOAD_UDP_CKSUM;
xd->flags |= DPDK_DEVICE_FLAG_TX_OFFLOAD |
DPDK_DEVICE_FLAG_INTEL_PHDR_CKSUM;
}
static clib_error_t *
dpdk_lib_init (dpdk_main_t * dm)
{
@ -496,6 +505,8 @@ dpdk_lib_init (dpdk_main_t * dm)
/* Cisco VIC */
case VNET_DPDK_PMD_ENIC:
xd->port_type = port_type_from_link_speed (l.link_speed);
if (dm->conf->enable_tcp_udp_checksum)
dpdk_enable_l4_csum_offload (xd);
break;
/* Intel Red Rock Canyon */

View File

@ -256,7 +256,10 @@ dpdk_esp_decrypt_inline (vlib_main_t * vm,
if (is_ip6)
priv->next = DPDK_CRYPTO_INPUT_NEXT_DECRYPT6_POST;
else
priv->next = DPDK_CRYPTO_INPUT_NEXT_DECRYPT4_POST;
{
priv->next = DPDK_CRYPTO_INPUT_NEXT_DECRYPT4_POST;
b0->flags |= VNET_BUFFER_F_IS_IP4;
}
/* FIXME multi-seg */
vlib_increment_combined_counter

View File

@ -66,6 +66,8 @@ static char *esp_encrypt_error_strings[] = {
extern vlib_node_registration_t dpdk_esp4_encrypt_node;
extern vlib_node_registration_t dpdk_esp6_encrypt_node;
extern vlib_node_registration_t dpdk_esp4_encrypt_tun_node;
extern vlib_node_registration_t dpdk_esp6_encrypt_tun_node;
typedef struct
{
@ -411,8 +413,16 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm,
}
else /* transport mode */
{
priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT;
rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
if (is_tun)
{
rewrite_len = 0;
priv->next = DPDK_CRYPTO_INPUT_NEXT_MIDCHAIN;
}
else
{
priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT;
rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
}
u16 adv = sizeof (esp_header_t) + iv_size + udp_encap_adv;
vlib_buffer_advance (b0, -adv - rewrite_len);
u8 *src = ((u8 *) ih0) - rewrite_len;
@ -576,7 +586,10 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm,
}
if (is_ip6)
{
vlib_node_increment_counter (vm, dpdk_esp6_encrypt_node.index,
vlib_node_increment_counter (vm,
(is_tun ?
dpdk_esp6_encrypt_tun_node.index :
dpdk_esp6_encrypt_node.index),
ESP_ENCRYPT_ERROR_RX_PKTS,
from_frame->n_vectors);
@ -585,7 +598,10 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm,
}
else
{
vlib_node_increment_counter (vm, dpdk_esp4_encrypt_node.index,
vlib_node_increment_counter (vm,
(is_tun ?
dpdk_esp4_encrypt_tun_node.index :
dpdk_esp4_encrypt_node.index),
ESP_ENCRYPT_ERROR_RX_PKTS,
from_frame->n_vectors);

View File

@ -1049,9 +1049,11 @@ dpdk_ipsec_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
"dpdk-esp4-encrypt",
"dpdk-esp4-encrypt-tun",
"dpdk-esp4-decrypt",
"dpdk-esp4-decrypt",
"dpdk-esp6-encrypt",
"dpdk-esp6-encrypt-tun",
"dpdk-esp6-decrypt",
"dpdk-esp6-decrypt",
dpdk_ipsec_check_support,
add_del_sa_session);
int rv = ipsec_select_esp_backend (im, idx);

View File

@ -38,6 +38,7 @@
_(IP4_LOOKUP, "ip4-lookup") \
_(IP6_LOOKUP, "ip6-lookup") \
_(INTERFACE_OUTPUT, "interface-output") \
_(MIDCHAIN, "adj-midchain-tx") \
_(DECRYPT4_POST, "dpdk-esp4-decrypt-post") \
_(DECRYPT6_POST, "dpdk-esp6-decrypt-post")

View File

@ -187,7 +187,7 @@ class TestGtpu(BridgeDomain, VppTestCase):
# Pick first received frame and check if it's correctly encapsulated.
out = self.pg0.get_capture(1)
pkt = out[0]
self.check_encapsulation(pkt, self.single_tunnel_bd)
self.check_encapsulation(pkt, self.single_tunnel_vni)
# payload = self.decapsulate(pkt)
# self.assert_eq_pkts(payload, self.frame_reply)
@ -343,13 +343,14 @@ class TestGtpu(BridgeDomain, VppTestCase):
# Create GTPU VTEP on VPP pg0, and put gtpu_tunnel0 and pg1
# into BD.
cls.single_tunnel_bd = 11
cls.single_tunnel_vni = 11
r = cls.vapi.gtpu_add_del_tunnel(
is_add=True,
mcast_sw_if_index=0xFFFFFFFF,
decap_next_index=0xFFFFFFFF,
src_address=cls.pg0.local_ip4,
dst_address=cls.pg0.remote_ip4,
teid=cls.single_tunnel_bd)
teid=cls.single_tunnel_vni)
cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index,
bd_id=cls.single_tunnel_bd)
cls.vapi.sw_interface_set_l2_bridge(

View File

@ -69,13 +69,12 @@ delete_proxy_session (session_t * s, int is_active_open)
uword *p;
u64 handle;
clib_spinlock_lock_if_init (&pm->sessions_lock);
handle = session_handle (s);
clib_spinlock_lock_if_init (&pm->sessions_lock);
if (is_active_open)
{
active_open_session = s;
p = hash_get (pm->proxy_session_by_active_open_handle, handle);
if (p == 0)
{
@ -85,17 +84,14 @@ delete_proxy_session (session_t * s, int is_active_open)
}
else if (!pool_is_free_index (pm->sessions, p[0]))
{
active_open_session = s;
ps = pool_elt_at_index (pm->sessions, p[0]);
if (ps->vpp_server_handle != ~0)
server_session = session_get_from_handle (ps->vpp_server_handle);
else
server_session = 0;
}
}
else
{
server_session = s;
p = hash_get (pm->proxy_session_by_server_handle, handle);
if (p == 0)
{
@ -105,12 +101,11 @@ delete_proxy_session (session_t * s, int is_active_open)
}
else if (!pool_is_free_index (pm->sessions, p[0]))
{
server_session = s;
ps = pool_elt_at_index (pm->sessions, p[0]);
if (ps->vpp_active_open_handle != ~0)
active_open_session = session_get_from_handle
(ps->vpp_active_open_handle);
else
active_open_session = 0;
}
}
@ -121,8 +116,6 @@ delete_proxy_session (session_t * s, int is_active_open)
pool_put (pm->sessions, ps);
}
clib_spinlock_unlock_if_init (&pm->sessions_lock);
if (active_open_session)
{
a->handle = session_handle (active_open_session);
@ -140,6 +133,8 @@ delete_proxy_session (session_t * s, int is_active_open)
session_handle (server_session));
vnet_disconnect_session (a);
}
clib_spinlock_unlock_if_init (&pm->sessions_lock);
}
static int
@ -232,6 +227,7 @@ proxy_rx_callback (session_t * s)
if (PREDICT_FALSE (max_dequeue == 0))
return 0;
max_dequeue = clib_min (pm->rcv_buffer_size, max_dequeue);
actual_transfer = svm_fifo_peek (rx_fifo, 0 /* relative_offset */ ,
max_dequeue, pm->rx_buf[thread_index]);
@ -239,7 +235,6 @@ proxy_rx_callback (session_t * s)
clib_memset (a, 0, sizeof (*a));
clib_spinlock_lock_if_init (&pm->sessions_lock);
pool_get (pm->sessions, ps);
clib_memset (ps, 0, sizeof (*ps));
ps->server_rx_fifo = rx_fifo;
@ -376,22 +371,6 @@ static session_cb_vft_t active_open_clients = {
};
/* *INDENT-ON* */
static void
create_api_loopbacks (vlib_main_t * vm)
{
proxy_main_t *pm = &proxy_main;
api_main_t *am = vlibapi_get_main ();
vl_shmem_hdr_t *shmem_hdr;
shmem_hdr = am->shmem_hdr;
pm->vl_input_queue = shmem_hdr->vl_input_queue;
pm->server_client_index =
vl_api_memclnt_create_internal ("proxy_server", pm->vl_input_queue);
pm->active_open_client_index =
vl_api_memclnt_create_internal ("proxy_active_open", pm->vl_input_queue);
}
static int
proxy_server_attach ()
{
@ -405,6 +384,7 @@ proxy_server_attach ()
if (pm->private_segment_size)
segment_size = pm->private_segment_size;
a->name = format (0, "proxy-server");
a->api_client_index = pm->server_client_index;
a->session_cb_vft = &proxy_session_cb_vft;
a->options = options;
@ -424,6 +404,7 @@ proxy_server_attach ()
}
pm->server_app_index = a->app_index;
vec_free (a->name);
return 0;
}
@ -439,6 +420,7 @@ active_open_attach (void)
a->api_client_index = pm->active_open_client_index;
a->session_cb_vft = &active_open_clients;
a->name = format (0, "proxy-active-open");
options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
options[APP_OPTIONS_SEGMENT_SIZE] = 512 << 20;
@ -458,6 +440,8 @@ active_open_attach (void)
pm->active_open_app_index = a->app_index;
vec_free (a->name);
return 0;
}
@ -480,9 +464,6 @@ proxy_server_create (vlib_main_t * vm)
u32 num_threads;
int i;
if (pm->server_client_index == (u32) ~ 0)
create_api_loopbacks (vm);
num_threads = 1 /* main thread */ + vtm->n_threads;
vec_validate (proxy_main.server_event_queue, num_threads - 1);
vec_validate (proxy_main.active_open_event_queue, num_threads - 1);
@ -535,6 +516,7 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
pm->private_segment_count = 0;
pm->private_segment_size = 0;
pm->server_uri = 0;
pm->client_uri = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
@ -556,9 +538,9 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
pm->private_segment_size = tmp;
}
else if (unformat (input, "server-uri %s", &pm->server_uri))
;
vec_add1 (pm->server_uri, 0);
else if (unformat (input, "client-uri %s", &pm->client_uri))
pm->client_uri = format (0, "%s%c", pm->client_uri, 0);
vec_add1 (pm->client_uri, 0);
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);

View File

@ -222,14 +222,16 @@ ip6_hbh_ioam_loopback_handler (vlib_buffer_t * b, ip6_header_t * ip,
ioam_trace_option_t *opt;
udp_ping_t *udp;
b0 = vlib_buffer_copy (hm->vlib_main, b);
if (b0 == NULL)
return;
buf_index = vlib_get_buffer_index (hm->vlib_main, b0);
next_node = vlib_get_node_by_name (hm->vlib_main, (u8 *) "ip6-lookup");
nf = vlib_get_frame_to_node (hm->vlib_main, next_node->index);
nf->n_vectors = 0;
to_next = vlib_frame_vector_args (nf);
b0 = vlib_buffer_copy (hm->vlib_main, b);
buf_index = vlib_get_buffer_index (hm->vlib_main, b0);
vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;
vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;

View File

@ -3928,8 +3928,8 @@ snat_config (vlib_main_t * vm, unformat_input_t * input)
sm->worker_in2out_cb = snat_get_worker_in2out_cb;
sm->worker_out2in_cb = snat_get_worker_out2in_cb;
sm->handoff_out2in_index = snat_in2out_node.index;
sm->handoff_in2out_index = snat_out2in_node.index;
sm->handoff_out2in_index = snat_out2in_node.index;
sm->handoff_in2out_index = snat_in2out_node.index;
sm->handoff_in2out_output_index = snat_in2out_output_node.index;
sm->in2out_node_index = snat_in2out_node.index;

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