Commit Graph

10853 Commits

Author SHA1 Message Date
Mohsin Kazmi
0972edc1c2 gso: add ipsec tunnel tests
Type: test

Change-Id: I831bc8c21f8ce869054eafcb14542508039c1b82
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-07-09 13:50:20 +00:00
Florin Coras
a4d0956082 session: allow listen in any fib if default namespace
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If0712f01bdd6f2fc892bcbe4e2cee28affd02520
2021-07-08 21:43:34 +00:00
Steven Luong
8e3f109a06 interface: unable to to assign tx queue to last worker thread
Using the cli "set interface tx-queue", it is not possible to assign
tx queue to the last worker thread.

The reason is that vdm->first_worker_thread_index is 1. Adding that
to clib_bitmap_last_set (bitmap) exceeds vdm->last_worker_thread_index
when the CLI specifies the last worker thread.

Also make the threads argument optional to enable user to unbind a queue
from any thread.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I796259c20f571289c8f5a97b9418caf452d0ab3d
2021-07-08 16:53:17 +00:00
Neale Ranns
0cc23b7dde tap: Set the MTU on the TUN deivce
Type: fix

For a TAP device the MTU is set via the ethernet_register for TUN we
need to do it explicitly (like we do for other tunnel types).

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie6a13c795acb35b53f8d99b05c70c3e73a7b428e
2021-07-08 15:52:46 +00:00
Florin Coras
647acd5eb4 tcp: use tcp output for half open connections
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I05be39671a9ed0688d4e006f0f9354aa6560a41b
2021-07-06 22:30:28 +00:00
Florin Coras
57b2e4acb1 tcp: use main thread pool for half-opens
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4b3427b966f9ff1ba8895fed7db662d56650f3f5
2021-07-06 14:53:44 -07:00
Benoît Ganne
3169e9ff1e l3xc: reset dpo on delete
When removing a l3xc path we must release the corresponding dpo.

Type: fix

Change-Id: Ib6309797cb11374264c786e064f262ad13c6f0a1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-07-06 15:43:20 +00:00
wanghanlin
72228a259b vcl: fix packetdrill test error
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: I36d9affa5ee7160e95ee0ed463595bef752bbe9a
2021-07-06 14:28:52 +00:00
wanghanlin
85207e699c vcl: print current app state for timeout
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Id701b1a1bee4e41b76d324ea05beb07ca57f825c
2021-07-06 14:24:32 +00:00
wanghanlin
97c6e0d4d1 vcl: fix return value check for ldp_fd_to_vlsh
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Iaad4022e84f4979016bb46c2ff5cfc5d43d6ff50
2021-07-06 14:23:42 +00:00
Rajaselvam
8cc66b55ae vrrp: Fix for test-all testcases failure.
Failure due to the method vrrp_adv_packet scope and self reference.

Type: fix
Signed-off-by: rajaselvam <rajaselvam@gmail.com>
Change-Id: I4ec14ea37928142651eb08fcc5736bc9c24ab062
2021-07-06 13:02:35 +00:00
Damjan Marion
a5167edc66 build: remove unused files and sections
Type: make
Change-Id: Ia1d8c53c5fb02f7e5c86efab6e6ccd0fdb16bc96
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-02 16:18:33 +00:00
Neale Ranns
9de8028a0b ipsec: ADD/update IPSec documentation
Type: docs

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ica576e13953a3c720a7c093af649d1dd380cc2c0
2021-07-02 15:45:21 +00:00
Filip Tehlar
0577ff1c39 interface: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I189bfcca2d5fa1f37d05a72c92d04bf260343043
2021-07-02 15:43:33 +00:00
Filip Tehlar
63c0fd334e sr: do not use vnet_all_api.h
.. as it is going to be removed.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Id3a4a4ea1e1b7361d43735bfa5470c28fc65209f
2021-07-02 15:41:28 +00:00
Tianyu Li
70b1cbdf2b vlib: fix buffer pool alignment size
Alignment size should be CLIB_CACHE_LINE_BYTES(64)
instead of CLIB_LOG2_CACHE_LINE_BYTES(6)

Type: fix

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: If2d5ae324093be64454377866297f5e76ccddc93
2021-07-02 14:28:24 +00:00
Benoît Ganne
ecadf6a539 crypto: fix sw async crypto with chained buffers
When a buffer in the chain comes with a negative current_data offset,
the conversion to sgl will skip it because of resetting offset to 0.
Moreover, crypto_start_offset is relative to the 1st buffer data pointer
so we should not check it against subsequent buffers anyway.

Type: fix

Change-Id: Id177a90bfda242a5372c7e8836cf6668e98c780e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-07-02 09:21:20 +00:00
Neale Ranns
e40e7542a9 misc: Don't IPv[46] enable local0, it doesn't receive packets.
Type: improvement

local0 exists just to burn sw_if_index=0 so we catch common API errors.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I2901bb7d36d4c512e6698134a807bf9516ee05db
2021-07-02 07:41:32 +00:00
Steven Luong
a57a7005d6 vmxnet3: support manual thread assignment to tx queue
Thread assignment to tx queue has always been automatic and there
was no way to modify it. With this patch, it is now possible to use
the cli "set interface tx-queue" to change the thread assignment to
tx queue for vmxnet3 interface, thanks to the new tx infra.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1544e3557f70251d4bd423cc3d9f28ee1d44db4a
2021-07-01 12:55:29 +00:00
Filip Tehlar
5ff59a1f8b ip: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I4b6d881571c158b7a69a78b9680732d090c4f8b5
2021-07-01 10:10:35 +00:00
Benoît Ganne
b946b209b9 memif: fix tx desc length for chained buffers in copy mode
When enqueuing chained buffer, we must update the descriptor length for
each fragment descriptor in addition to the last.

Type: fix

Change-Id: I9bc95fe557a049eeea4abd41c695153632d52a52
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-06-30 18:59:12 +00:00
Benoît Ganne
41e64e76d2 rdma: fix chained buffer tx path in dv mode
When switching to the direct verb chain buffer tx path, we must account
for all remaining packets, including the packets that would wrapped
around.
Previously we were using the 'n' counter but ignoring the 'n_wrap'
counter: if some packets would have wrapped around in the default path,
it would be ignored by the chained buffer tx path.
Compute the correct number of remaining packets based on the old and
current txq tail instead.
Also simplify the chained tx function parameters.

Type: fix

Change-Id: If12b41a8f143fda80290342e2904792f7501c559
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-06-30 18:58:42 +00:00
Benoît Ganne
44d524f941 memif: fix chain buffer length in zero-copy mode
The total_length_not_including_first_buffer field must be reset before
being updated otherwise it will quicly grows as stale values are reused.

Type: fix

Change-Id: Ic48c0822660998b0dfc0b5fdeadae6071b2d03f7
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-06-30 18:57:59 +00:00
Florin Coras
734268f484 vcl: coverity fixes
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I290e4b0dff6afe7ce755074f3aaaf945dbbf3e09
2021-06-30 14:51:19 +00:00
Neale Ranns
53dd08c59e ipsec: Derive the TUNNEL_V6 flag from the configured address types
Type: improvement

There's no need for the user to set the TUNNEL_V6 flag, it can be
derived from the tunnel's address type.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I073073dc970b8a3f2b2645bc697fc00db1adbb47
2021-06-30 14:05:55 +00:00
Florin Coras
595724a490 session: free ctrl event data on connect rpc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I56c4682aef59ed0e69073f9001341c425e65bd48
2021-06-29 20:22:51 +00:00
Neale Ranns
5b8911020e ipsec: Fix setting the hi-sequence number for decrypt
Type: fix

two problems;
 1 - just because anti-reply is not enabled doesn't mean the high sequence
number should not be used.
   - fix, there needs to be some means to detect a wrapped packet, so we
use a window size of 2^30.
 2 - The SA object was used as a scratch pad for the high-sequence
number used during decryption. That means that once the batch has been
processed the high-sequence number used is lost. This means it is not
possible to distinguish this case:
      if (seq < IPSEC_SA_ANTI_REPLAY_WINDOW_LOWER_BOUND (tl))
	{
	  ...
	  if (post_decrypt)
	    {
	      if (hi_seq_used == sa->seq_hi)
		/* the high sequence number used to succesfully decrypt this
		 * packet is the same as the last-sequnence number of the SA.
		 * that means this packet did not cause a wrap.
		 * this packet is thus out of window and should be dropped */
		return 1;
	      else
		/* The packet decrypted with a different high sequence number
		 * to the SA, that means it is the wrap packet and should be
		 * accepted */
		return 0;
	    }
  - fix: don't use the SA as a scratch pad, use the 'packet_data' - the
same place that is used as the scratch pad for the low sequence number.

other consequences:
 - An SA doesn't have seq and last_seq, it has only seq; the sequence
numnber of the last packet tx'd or rx'd.
 - there's 64bits of space available on the SA's first cache line. move
the AES CTR mode IV there.
 - test the ESN/AR combinations to catch the bugs this fixes. This
doubles the amount of tests, but without AR on they only run for 2
seconds. In the AR tests, the time taken to wait for packets that won't
arrive is dropped from 1 to 0.2 seconds thus reducing the runtime of
these tests from 10-15 to about 5 sceonds.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iaac78905289a272dc01930d70decd8109cf5e7a5
2021-06-29 17:12:28 +00:00
liuyacan
3871bd3a07 tcp: add ACK flag to RST packet
According to RFC 793, the ACK control bit is always sent once
the connection is established.

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: Id0fe19114a0cc468dbce4c0938b345c2ac339e73
2021-06-29 15:32:49 +00:00
Florin Coras
fa3884f8a1 vcl: improvements to epoll lt
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If585b9c48f67599c56a8c4b4a5139375bc4287f6
2021-06-29 15:22:05 +00:00
Zachary Leaf
fbab65bc1c ipsec: increment SPD policy counters for bypass and discard actions in ipsec4_input_node
ipsec_spd_policy_counters are incremented only for matched inbound
PROTECT actions (:273 and :370). BYPASS + DISCARD actions also have
SPD policy counters that should be incremented on match.

This fix increments the counters for inbound BYPASS and DISCARD actions.

Type: fix
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: Iac3c6d344be25ba5326e1ed45115ca299dee5f49
2021-06-29 14:52:41 +00:00
wanghanlin
b940fd4d5a vcl: Don't use app_socket_api to notify VPP in parent when child exited
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Icd2fc3cc2d0a0a6060abfb262044cf9e09ab4ba2
2021-06-29 14:30:01 +00:00
wanghanlin
9e42cc285f vcl: Don't memset events to optimize CPU usage
In stress test case, memset may consume a lot of CPU because
vls_epoll_wait is called very frequently.

Type: improvement

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: I9b4e1d6e1c4d7217cf0b2529d8efed792dea7b40
2021-06-29 14:22:13 +00:00
Florin Coras
87f7600dd6 vcl: epoll fix postponed evt handling
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3d208f8ef4638e7557929f4b2bca4d640af85baa
2021-06-28 19:13:29 -07:00
Neale Ranns
ff2e4138cc ipsec: Split the SA add_del API into an separate add and del
Type: improvement

the rationale being that the del only requires the SA's ID, so it's a
bit mean to require the client to fill out all the other information as
well.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ibbc20405e74d6a0e1a3797465ead5271f15888e4
2021-06-28 21:26:30 +00:00
Neale Ranns
9c23ff8c8a ipsec: Enable the extended Sequence Number IPSec tests for GCM
Type: test

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie691b1c8841f5e195525bfff990f12ab918ba394
2021-06-28 13:32:40 +00:00
Jon Loeliger
dabdc19798 vrrp: prevent segfault in multicast join due to missing LL Addr
If an IPv6 Link Layer Address is missing from an interface,
treat it as a down interface.  While this fails to send a
VRRP multicast group join, it also prevents a seg fault.

Type: fix
Fixes: 39e9428b90
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: Iebf69bb30604a96de6587655eb872aa818158a56
2021-06-26 07:39:10 +00:00
Arthur de Kerhor
905c15319c stats: reverts part of a fix on Python client
Puts return statements back inside code blocks under the lock

Type: fix

Change-Id: I76d426f336200035026b92bcb0ffe2b472a3142d
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2021-06-25 23:26:40 +00:00
Beno�t Ganne
7816403eb2 stats: revert "add a retry mechanism in a symlink test"
This reverts commit d70777aa60.

Reason for revert: wrong fix

Type: fix

Change-Id: Ibff1b977eae8d2cc85888165ebf83c42eb661698
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-06-25 17:59:18 +02:00
Arthur de Kerhor
c9ae8cfacc stats: fix race conditions in vpp-api stats client
Type: fix

Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ie5c197f6ec0d41d5e405b22662701d83ad94d29e
2021-06-25 01:04:16 +00:00
Xiaoming Jiang
806709fc7c session: fix session formated str output truncated in cli
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I2c2b739a5aa246bbf53d6663efd403c3aee9dddd
2021-06-24 18:11:13 +00:00
Alexander Chernavin
959613b5d7 linux-cp: stop managing adjacencies for tunnels
Type: fix

Outbound packets which arrive on tun/L3 interfaces use a default
adjacency for the interface & address family from the corresponding
interface pair. However, there are entries in the linux-cp adj table
that are created for them. Managing these entries might cause a
segfault because the rewrite data might exceed the reserved space for
it of 28 bytes in the linux-cp adj key (e.g. in case of GRE IPv6).

With this change, stop creating adjacencies for tun/L3 interfaces in
the linux-cp adj table and delegating them.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I4bcd685860053ab87c65064c182e3ed53fd4fae9
2021-06-24 10:46:19 -04:00
Tianyu Li
1ef38743fd svm: fix asan check failed @svm_map_region on arm
==283032==AddressSanitizer CHECK failed: compiler-rt/lib/asan/asan_mapping.h:366
          "((AddrIsInMem(p))) != (0)" (0x0, 0x0)
    #0 0x49c128 in __asan::AsanCheckFailed
    #1 0x4ae8dc in __sanitizer::CheckFailed
    #2 0x495dec in __asan::ShadowSegmentEndpoint::ShadowSegmentEndpoint
    #3 0x495e48 in __asan_unpoison_memory_region
    #4 0xfffff4e851f8 in svm_map_region /home/vpp/src/svm/svm.c:611:7
    #5 0xfffff4e86d9c in svm_region_init_internal /home/vpp/src/svm/svm.c:797:8
    #6 0xfffff4e87ce4 in svm_region_init_args /home/vpp/src/svm/svm.c:880:3
    #7 0xfffff7f30d30 in vlibmemory_init /home/vpp/src/vlibmemory/memory_api.c:974:3
    #8 0xfffff4fd5368 in vlib_main /home/vpp/src/vlib/main.c:1986:16

svm_global_region_base_va 0x200000000000 is not in the aarch64 mapping range,
leading check failure and vpp cannot start.

aarch64 asan mapping
|| `[0x201000000000, 0xffffffffffff]` || HighMem    ||
|| `[0x041200000000, 0x200fffffffff]` || HighShadow ||
|| `[0x001200000000, 0x0411ffffffff]` || ShadowGap  ||
|| `[0x001000000000, 0x0011ffffffff]` || LowShadow  ||
|| `[0x000000000000, 0x000fffffffff]` || LowMem     ||

x86 asan mapping
|| `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
|| `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
|| `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||
|| `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
|| `[0x000000000000, 0x00007fff7fff]` || LowMem     ||

Type: fix

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I55ddbdcd361d66d4cfaf6459b2fa20fd8b64af37
2021-06-24 14:40:58 +00:00
liuyacan
cde1769a83 vcl: fix vcl_session_write_ready when connecting
Applications like curl will poll the fd after a non-blocking
connect, so we need to avoid returning the wrong event.

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: I7ea146fc954fda631b3d88b46bb80adfbcdf137c
2021-06-24 14:37:17 +00:00
Filip Tehlar
5a9d2a1758 l2: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I7b84767e75d5f8310ec071036a5780fa4530f79f
2021-06-24 08:30:43 +00:00
Matthew Smith
2d9ae462ea linux-cp: add callbacks for pair management
Type: improvement

Allow callbacks to be registered which will be called when an
interface pair is added or deleted.

Change-Id: I1c413ac2ada802021f9e56e2f878ce67e5eda2f5
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-06-24 07:14:16 +00:00
Filip Tehlar
9f562cd9e6 virtio: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I4f9316b16f16a48e2042aa17db596bfd181bd314
2021-06-23 22:28:11 +00:00
Jon Loeliger
c6fe1e87c6 mss_clamp: iterate enabled direction as a vector, not pool
Type: fix
Fixes: bf55e9931c
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I5410a7a5a8cdc1d41abcc42fe5b42e6e2991dc06
2021-06-23 20:29:12 +00:00
Klement Sekera
e506fbc9fe nat: ICMP handling fixes
If ICMP comes from a router on path, source address must not be
rewritten in o2i path to avoid getting wrong checksum.

Fix ICMP checksum computations.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I035debccf966d7dbd63c364cb1e43380d641f708
2021-06-23 17:18:35 +00:00
Filip Tehlar
da5088c930 mpls: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I148022278a792b3687402b6915fe6fb513858a2a
2021-06-23 13:41:21 +00:00
Filip Tehlar
6f6663f3ba span: api cleanup
Use autogenerated code.
Does not change API definitions.

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I7ec4bbb21a079c6f6adfb4f954054b2b07bf19c5
2021-06-23 13:31:58 +00:00