8839 Commits

Author SHA1 Message Date
Damjan Marion
162330f25a build: rework x86 CPU variants
Type: improvement
Change-Id: Ief243f88e654e578ef9b8060fcf535b364aececb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-30 13:25:29 +02:00
Florin Coras
dc0ded7dd7 vcl: disconnect both flavors of bapi transport on destroy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6697296b45c5816a31535b0cf44b8e726292b8bb
2020-04-30 10:18:54 +00:00
Lijian.Zhang
690ce8672c build: support arch-specific compiling for Neoverse N1
Enable arch-specific compiling and dynamic optimal function selection
for Arm Neoverse-N1.

Support for -march=armv8.2-a+crc+crypto -mtune=neoverse-n1 for
Neoverse-N1 is added starting from gcc-9.2.0

                    without change  with change improvement
[L2 - 1x flows]     11.00 Mpps      11.46 Mpps  4%
[L2 - 10Kx flows]   6.83 Mpps       7.17 Mpps   5%
[L3 - 1x flows]     10.39 Mpps      10.78 Mpps  3.7%
[L3 - 10Kx flows]   6.67 Mpps       7.19 Mpps   7.8%

Type: feature

Change-Id: I5d24d17820b3dd6909b913202e8c31fc7d48650f
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
2020-04-30 10:18:39 +00:00
Filip Tehlar
e09912001f ikev2: use thread local vlib_main in vlib_time_now
Type: fix

Change-Id: I8e4a47bd16fa8475ef695c09e3487eabf08faabe
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-04-30 10:16:13 +00:00
Matthew Smith
3d18fbf8e6 tap: allow deletion of tun interface
Type: improvement

tap_delete_if() returns early if the interface type is not
VIRTIO_IF_TYPE_TAP. Allow VIRTIO_IF_TYPE_TUN also and take
appropriate action for those interfaces.

Change-Id: I196b6d6f3f5e1543a14d6be76fd879d44c9794fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-30 07:59:52 +00:00
Damjan Marion
6e39ff03a6 build: detect GNU Assembler AVX-512 bug and disable AVX-512 variants if needed
Type: fix
Change-Id: I098f6c79be3c2e4db001edc0cf0a229bf6e0b13d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-29 20:04:03 +00:00
Tom Seidenberg
5a7f2f1224 ip: use thread local vm instead of thread main for vlib_time_now calls
Type: fix
Change-Id: I8d68e7c7392dcb748a2a84e72c7b1ca0c6c0eb07
Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
2020-04-29 17:48:55 +00:00
Damjan Marion
4ba16a44b1 misc: switch to clang-9
Type: improvement
Change-Id: Iebf77a63c0c19b130a3fbd26b5293304a9fed4c1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-29 17:20:47 +00:00
Florin Coras
a3108e65f3 hsa: cleanup ifdefs in sock tests
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1f03d80c4ee2a555dc6baa262d6df4521c1ae818
2020-04-29 16:39:16 +00:00
Benoît Ganne
3a76dc3f4f devices: vhost: simplify string copies for GCC-10
GCC-10 increases string truncations warnings. Refactor string copies
confusing it.

Type: refactor

Change-Id: I9720a0539059de00ab212ff2fc73055f04f5af1d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-29 15:18:52 +00:00
Mohsin Kazmi
28adbb3aef tap: fix missing "num-rx-queues" from cli help
Type: fix

Change-Id: Ib09c7cebb6978b3adc09ac36cb32f7947b143e51
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-29 13:10:08 +02:00
Florin Coras
d7586d50f6 vcl: add separate fcntl64 ldp handler
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb81e2901398dd6ae94931c705a704c7b52bbb36
2020-04-29 08:45:39 +00:00
Paul Vinciguerra
c4ae0fffb5 interface: fix interface_types.api enums
Unspecified c enums start at 0.
Unspecified api enums start at 1.

Type: fix

Change-Id: I431c11302c0ad897a968134ce90496af3db7bb86
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-29 07:44:33 +00:00
Florin Coras
34de6fea13 flow: explicit rss function enum cast
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8c0eb5b5b12ffac1ff5dc89cab10bdb8e4be4322
2020-04-29 04:08:47 +00:00
Dave Barach
77d9838282 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: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
2020-04-28 23:04:23 +00:00
Florin Coras
635f5068f0 svm: fix fifo alignemnt in batch prealloc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5cdf3cff820a0679f78b212a277d1873c2cfb980
2020-04-28 21:50:55 +00:00
Benoît Ganne
049d0b438e vlib: use flexible array in vlib_buffer for GCC-10
GCC-10 increase overflows-related warnings but gets confused by 0-length
arrays. Use C99 flexible length array instead.

Type: fix

Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-28 21:19:22 +00:00
Jakub Grajciar
07363a45fe gomemif: introduce gomemif
golang native memif driver

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I693156a44011c80025245d25134f5bf5db6eba82
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-04-28 21:18:37 +00:00
Andreas Schultz
c458c49366 vppinfra: type prove vec_new and vec_resize
Some vector functions (e.g. vec_new) pass the vector pointer through
vec_resize. This turn the pointer from a real type into a void pointer.
Explicitly cast the pointer back to its original type to catch type
mismatches.

Type: improvement

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: Id13e52d4f038af2cee28e5abf1aca720f8909378
2020-04-28 21:16:58 +00:00
Chenmin Sun
24e2c50bf3 flow: add RSS support
This patch enables the RSS configuration through vnet/flow interface
With this RSS feature, users can config the RSS functions for specific flows

Currently, it supports:
  default, toeplitz and symmetric_toeplitz rss function, and
  ipv4-tcp/ipv4-udp/ipv6-tcp/ipv6-ucp flow types

Users can use the following options to combine with above flow
types for more specific hash input set selection:
  l3-src-only, l3-dst-only, l4-src-only, l4-dst-only

Command line:
test flow add dst-ip any proto udp rss function default rss types ipv4-tcp use l3-dst-only
test flow add dst-ip any proto udp rss function toeplitz rss types ipv4-udp use l4-src-only
test flow add dst-ip any proto udp rss function symmetric_toeplitz rss types ipv6-udp use l3-src-only and l3-dst-only

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I213efc76dc8af37f2f63605884f353e05b0f5d2a
2020-04-28 21:13:50 +00:00
Aloys Augustin
2857e7850c tap: use one tap fd per rx queue
This matches vhost queues to linux netdev queues and avoids random
packet shuffling across vhost queues on rx.

Change-Id: I9901689d361e440fb0b91c9fbaf8124ce525b316
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-28 21:10:36 +00:00
Filip Tehlar
beee60d2c3 ipsec: fix buffer alloc
Type: fix

Change-Id: I0f12c19b79df19b692f18ac13d6c32341853b764
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-04-28 21:09:14 +00:00
Klement Sekera
ca6307ccb9 nat: remove unused code
Type: refactor

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I0f82d937b4829e5a7f074d4d566fa49319a11716
2020-04-28 21:06:32 +00:00
Dave Barach
37b445468e vppinfra: improve test coverage
Bonus corner-case bugfix in bitmap.h, found during the exercise.
Issue dates from 2001 or thereabouts. Please review this specific
change carefully.

lcov_post: filter system include directories and generated files in
build-root

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iaa0b63e9dc571dfe3d992197ac49ba4d93403c61
2020-04-28 20:55:20 +00:00
Paul Vinciguerra
bfb377ce79 docs: add missing spelling dictionary
Type: docs

Change-Id: I334312f8bfe2000d4613908c2a0ba7e6a39d3825
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-28 17:43:44 +00:00
Paul Vinciguerra
6230b9d123 tests: fix update_path_flags for multicast in vpp_ip_route
add support for the case where the first path doesn't
  match the searched interface.

Type: test

Change-Id: I29bd724cfe275ec5489d32c37ef2af12d6d1102a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-28 16:42:36 +00:00
Paul Vinciguerra
e64e5fff4d tests: implement ipaddress convenience methods
Add vpp specific properties to ip addresses for use in the api.
  .vapi_af  -- returns [ADDRESS_IP4, ADDRESS_IP6]
  .vapi_af_name -- returns the string ['ip4', 'ip6']

  Update tests to demonstrate usage.

Type: feature

Change-Id: I43447a1522769d99f89debdc714c51700068d771
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-28 15:43:28 +00:00
Jakub Grajciar
58db6e16cf lisp: API cleanup
Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ib7f73a0b6de188982a09040f7739dc46be3cb1de
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-04-28 11:54:00 +00:00
Ray Kinsella
4830e4f78f vlib: startup multi-arch variant configuration
Support for startup node multi-arch variant selection through startup.conf.
This is to facilitate unit, functional testing and benchmarking of non-default
multi-arch variant node code path. Also added parameters to make test, to
specific using multi-arch variants in unit testing.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I94fd332bb629683b7a7dd770ee9f615a9a424060
2020-04-28 11:10:50 +00:00
Ole Troan
a568a19b29 stats: add apis to delete simple/combined counters
vlib_free_simple_counter()
vlib_free_combined_counter()

Frees the name and two dimensional vector from the stats segment.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948
2020-04-28 09:39:47 +00:00
Paul Vinciguerra
c0e9441e79 tests: move defaults from defaultmapping to .api files
facilitates use of papi beyond the tests.

Type: improvement

Change-Id: I3d502d9130b81a7fb65ee69bb06fe55802b28a27
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-28 01:12:04 -04:00
Florin Coras
f5445bf36f tcp: remove sack reneging verbose logging
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4dbbf8456d0ed2350459fcdc0664bbae024072fc
2020-04-28 00:56:39 +00:00
Florin Coras
5226d26d11 svm: null instead of panic if fifo hdr alloc fails
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c5c9e3e7eff8481e48a940e8420d236a16e7649
2020-04-28 00:56:19 +00:00
Simon Zhang
3ff8e23d7d tls: fix wrong usage of session close function issue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I5a73e45e5b8a6a97c068e1ca108d8f8a2c1c0f90
2020-04-28 00:20:08 +00:00
Steven Luong
bc0d9ff672 virtio: support virtio 1.1 packed ring in vhost
virtio 1.1 defines a number of new features. Packed ring is among the most
notable and important one. It combines used, available, and descripptor rings
into one.

This patch provides experimental support for packed ring. To avoid
regression, when packed ring is configured for the interface, it is branched
to a separate RX and TX driver. Non packed ring should continue to perform
as it was before.

Packed ring is tested using qemu4.2 and ubuntu focal fossa (kernel 5.4.0-12)
on the guess VM which supports packed ring.

To configure VPP with packed ring, just add the optional keyword "packed"
when creating the vhost interface. To bring up the guest VM with packed ring,
add "packed=on" in the qemu launch command.

To facilitate troubleshooting, also added "verbose" option in
show vhost desc CLI to include displaying the indirect descriptors.

Known qemu reconnect issue -
If VPP is restarted, guest VMs also need to be restarted. The problem
is kernel virtio-net-pci keeps track of the previous available and used
indices. For virtio 1.0, these indices are in shared memory and qemu can
easily copy them to pass to the backend for reconnect. For virio 1.1, these
indices are no longer in shared memory. Qemu needs a new mechanism to retrieve
them and it is not currently implemented. So when the protocol reconnects,
qemu does not have the correct available and used indices to pass to the
backend. As a result, after the reconnect, virtio-net-pci is reading the TX
ring from the wrong position in the ring, not the same position which the
backend is writing. Similar problem exists also in the RX.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I5afc50b0bafab5a1de7a6dd10f399db3fafd144c
2020-04-27 09:25:32 -07:00
Zhiyong Yang
ba6deb96e9 l2: merge two clib_memcpy_fast into one
Merge two memcpy into one by swapping src and dst address in
l2fwd_trace_t.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Change-Id: I71c5ecad0b453a434b1cb292ef03d88a760255c8
2020-04-27 15:31:48 +00:00
Dave Barach
6d6711b5f0 vlib: pcap rx/tx/dispatch trace test
Mainly intended to improve code coverage, but since the test only runs
for 0.3 seconds we might as well run it all the time.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icfd0f4dbcdbf76abbaa12e16cee1136413c8ae2e
2020-04-27 15:07:59 +00:00
Dave Barach
ce32770251 vlib: deprecate i2c and cj
i2c follows its only use case - the original 82599 driver - into
extras/deprecated.

cj is/was an emergency debug tool unused in several years. Move to
extras/deprecated/vlib

Type: refactor

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ib55b65373f62630db295c562974bd8f2456c3107
2020-04-27 15:07:42 +00:00
Benoît Ganne
83ceffcd98 ioam: do not reuse existing vnet symbol
vxlan_gpe_init() is already defined in libvnet. When loading ioam plugin
we end up having 2 different objects using the same symbol.
ASan in GCC-10 started to enforce the One-Definition-Rule and it seems
like good hygiene anyway.

Type: fix

Change-Id: I2ea9af1821bca6482a290742e9a109fc25692f37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 15:04:37 +00:00
Benoît Ganne
a66971f980 vppinfra: selectively disable false-positive GCC-10 warnings
GCC-10 increase overflows-related warnings but is confused by SIMD
operations.

Type: fix

Change-Id: Iafde754c2fbec60e2d0a328f295b1f5c156d8234
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 14:20:52 +00:00
Gao Feng
9165e0365c ip: reassembly: fix one possible use-after-free
When use the kv->v.memory_owner_thread_index as the index to get the
reass in pool, maybe this element is freed by the owner thread because
of timeout, too many fragments, and so on.

So we should check if do_handoff with kv->v.memory_owner_thread_index
before get the reass from pool.

Type: fix

Signed-off-by: Gao Feng <davidfgao@tencent.com>
Change-Id: Ie0f1dc368f86d0fd65292ca0c5e1908348015e09
2020-04-27 13:35:17 +00:00
Benoît Ganne
ffbcf61788 vppinfra: selectively disable false-positive GCC-10 warnings
GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 12:22:30 +00:00
Benoît Ganne
be7dbbbfdd build: add vppinfra/warnings.h to exported headers list
To allow the use of WARN_ON/OFF macros to selectively disable build
warnings.

Type: fix

Change-Id: Iceb9d28b2b80c373afb51900880c23041be836db
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 12:22:30 +00:00
Benoît Ganne
2d25467d13 rdma: tx: interleave prefetches
Type: improvement

Change-Id: Ic2d9b17cf5e524f3ad2a3c5343fe1230aa360e73
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 12:19:39 +00:00
Matthew Smith
81284163a2 devices: allow link state down with netlink
Type: fix

Use the up parameter in vnet_netlink_set_link_state(). It was
ignoring the parameter and always setting IFF_UP on an interface.

Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-27 10:54:13 +00:00
Klement Sekera
770178e365 nat: improve perf - long read after short write
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Idbbad246161d28f595c25e10d7282c8b33fa9876
2020-04-27 08:21:53 +00:00
Stanislav Zaikin
e65eea360c dhcp: fix dhcp proxy behavior for qinq and dot1q subinterfaces
Previous behavior worked only when subinterface ID matches with dot1q tag and doesn't work at all in QinQ case.
In this patch I'm checking how subinterface is configured.

Type: fix

Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Change-Id: I7a662a0442fdc8e68aba5d6f469f3b1139a4bc2d
2020-04-26 13:18:54 +00:00
Florin Coras
681ea6dd28 tls: improve cli state reporting
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I02d60134d6069764da75dc6d206b376a0d46998e
2020-04-25 11:40:43 +00:00
Florin Coras
36d49391aa session vcl: propagate transport cleanup notifications
Type: improvement

Can be used to force app to close a connection on which it still waits
for data.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7c3a8245cbbc23728e4408feb63a659a11f718ed
2020-04-25 11:40:25 +00:00
Florin Coras
5e6222a033 vcl: generate select events on read/write errors
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
2020-04-25 11:39:59 +00:00