vpp.git
5 years agoVPPAPIGEN: Add union and enum support and IP4/IP6 address type. 10/12410/4
Ole Troan [Tue, 24 Apr 2018 04:02:37 +0000 (00:02 -0400)]
VPPAPIGEN: Add union and enum support and IP4/IP6 address type.

Note: The Python, Java and C/C++ bindings must be updated before ip/ip_types.api can be used.

ip_types.api:

typedef ip4_address {
  u8 address[4];
};

typedef ip6_address {
  u8 address[16];
};

enum address_family {
  ADDRESS_IP4 = 0,
  ADDRESS_IP6,
};

union address_union {
  vl_api_ip4_address_t ip4;
  vl_api_ip6_address_t ip6;
};

typedef address {
  vl_api_address_family_t af;
  vl_api_address_union_t un;
};

Change-Id: I22f67092f24db5bd650a03c6f446a84cd9fd1074
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agodpdk:flow add vxlan flow support 24/12624/4
Eyal Bari [Thu, 17 May 2018 13:26:34 +0000 (16:26 +0300)]
dpdk:flow add vxlan flow support

Change-Id: Ic9f98c022e32715af395c9ed618589434eb0e526
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agotcp: cc improvements and fixes 95/12695/6
Florin Coras [Tue, 22 May 2018 18:39:59 +0000 (11:39 -0700)]
tcp: cc improvements and fixes

Change-Id: I6615bb612bcc3f795b5f822ea55209bb30ef35b5
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoavf plugin: add support for logging 75/12675/4
Jakub Grajciar [Mon, 21 May 2018 10:39:03 +0000 (12:39 +0200)]
avf plugin: add support for logging

Change-Id: Ic8c5b527395fc99f1e1a72e51f8d41c9b4f415df
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
5 years agoacl-plugin: refactor to introduce multiarch dataplane functions 51/12651/6
Andrew Yourtchenko [Fri, 18 May 2018 16:48:00 +0000 (18:48 +0200)]
acl-plugin: refactor to introduce multiarch dataplane functions

This commit splits the functions from fa_node.c
into the pure dataplane node functions (which are multiarch-compiled),
session management node functions (which are compiled only once),
and session find/add/delete functions which are split out into the inlines.

As part of the refactoring:

- get rid of BV() macros in the affected chunk of code,
  rather use the explicit bihash function names.

- add the magic trailer to the new files to
  ensure make checkstyle watches them.

- move the bihash_template.c include for 40_8 bihash into acl.c

Change-Id: I4d781e9ec4307ea84e92af93c09470ea2bd0c375
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
5 years agovppinfra: add clib_count_equal_uXX and clib_memset_uXX functions 90/12690/2
Damjan Marion [Tue, 22 May 2018 12:07:47 +0000 (14:07 +0200)]
vppinfra: add clib_count_equal_uXX and clib_memset_uXX functions

Change-Id: I56782652d8ef10304900cc293cfc0502689d800e
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoCSIT-928 dpdk/ipsec: performance improvement 82/11082/22
Radu Nicolau [Mon, 12 Mar 2018 13:52:41 +0000 (13:52 +0000)]
CSIT-928 dpdk/ipsec: performance improvement

Replace hash with a vector to improve performance.
Plus other minor performance improvements.

Change-Id: I3f0ebd909782ce3727f6360ce5ff5ddd131f8574
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
5 years agotcp: unlock link-local adjacencies on connection cleanup 36/12636/6
Florin Coras [Thu, 17 May 2018 20:28:34 +0000 (13:28 -0700)]
tcp: unlock link-local adjacencies on connection cleanup

Change-Id: I37705fb572045f42be4c2dabbd8460c8f8872167
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agodpdk:enable flow director perfect mode 85/12585/2
Eyal Bari [Wed, 16 May 2018 08:30:23 +0000 (11:30 +0300)]
dpdk:enable flow director perfect mode

when flows are enabled on the device

Change-Id: I971764988d5a9e7078468f627205b3fa60736263
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agovector functions cleanup and improvements 61/12661/3
Damjan Marion [Fri, 18 May 2018 22:04:23 +0000 (00:04 +0200)]
vector functions cleanup and improvements

Remove functions which have native C equivalent (i.e. _is_equal can be
replaced with ==, _add with +)
Add SSE4.2, AVX-512 implementations of splat, load_unaligned, store_unaligned,
is_all_zero, is_equal, is_all_equal

Change-Id: Ie80b0e482e7a76248ad79399c2576468532354cd
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoMLX DPDK glue: exclude dependency on OFED libraries 58/12658/3
Igor Mikhailov (imichail) [Sat, 19 May 2018 03:08:26 +0000 (20:08 -0700)]
MLX DPDK glue: exclude dependency on OFED libraries

MLX DPDK mlx5_glue.so, compiled under RTE_LIBRTE_MLX5_DLOPEN_DEPS,
provides a run-time check for OFED libraries.
To do so, it links with -libverbs -lmlx5 so that the binding could
occur or fail at runtime (see DPDK 59b91be and VPP 59b91be).
However RPM install fails on systems without OFED installed since
RPM spec has an entry "Requires: libmlx5".
To overcome this, exclude such requirement from the spec.

Same applies to mlx4_glue.so, compiled under RTE_LIBRTE_MLX4_DLOPEN_DEPS

Change-Id: I0ff6efc49581104743cc7e5b1f7cdbc1665ce9ba
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
5 years agolog: Validate the size of vec in vlib_log 50/12650/3
Mohsin Kazmi [Fri, 18 May 2018 14:27:26 +0000 (16:27 +0200)]
log: Validate the size of vec in vlib_log

Change-Id: I6d1218c17ee055275596b9a49767f15994aa1b2b
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
5 years agoDisable vector code in vlib_buffer_enqueue_to_next if no msb mask function 59/12659/3
Damjan Marion [Sat, 19 May 2018 08:27:10 +0000 (10:27 +0200)]
Disable vector code in vlib_buffer_enqueue_to_next if no msb mask function

This fixes ARM64 build where we dont have defined u16x8_msb_mask(...)

Change-Id: I864f5134a0d951601810c800f587d173b3b7ef41
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agotcp_echo: support multiple connections 41/12641/7
Florin Coras [Fri, 18 May 2018 07:41:55 +0000 (00:41 -0700)]
tcp_echo: support multiple connections

Change-Id: I6d8e1351e088728f7363550a0fc117256cae2841
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoIP unnumbered dump 46/12646/3
Neale Ranns [Fri, 18 May 2018 09:27:10 +0000 (02:27 -0700)]
IP unnumbered dump

Change-Id: I4f245fd225bcc563fafee2696cd039477d661c57
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years agoAdd vlib_buffer_enqueue_to_next inline function 35/12635/3
Damjan Marion [Thu, 17 May 2018 19:12:13 +0000 (21:12 +0200)]
Add vlib_buffer_enqueue_to_next inline function

Change-Id: I1042c0fe179b57a00ce99c8d62cb1bdbe24d9184
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoIP table bind allowed only if table exists 43/12643/2
Neale Ranns [Thu, 17 May 2018 13:34:24 +0000 (06:34 -0700)]
IP table bind allowed only if table exists

Change-Id: If01400e3434b25b2da36ba28ceb8444b216d0e38
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years agoARP: Ensure STATIC and DYANMIC ARP flags are mutually exclusive. 37/12637/2
Jon Loeliger [Thu, 17 May 2018 20:55:00 +0000 (15:55 -0500)]
ARP: Ensure STATIC and DYANMIC ARP flags are mutually exclusive.

Change-Id: I44278dea2ee1daa147b0928bfe26e861907a209f
Signed-off-by: Jon Loeliger <jdl@netgate.com>
5 years agoIP address dump - don't send subnets for unnumbered interfaces 32/12632/2
Neale Ranns [Thu, 17 May 2018 16:38:13 +0000 (09:38 -0700)]
IP address dump - don't send subnets for unnumbered interfaces

Change-Id: I8c64a0d2f757d96ffa7fd042c23b0d814217c215
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years ago18.01.2 Release Notes 33/12633/2
Dave Wallace [Thu, 17 May 2018 16:06:27 +0000 (12:06 -0400)]
18.01.2 Release Notes

Change-Id: I17ba98b48409d907081a0fd8d7db35adf45192ef
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
5 years agosession: add session process node 09/12609/6
Florin Coras [Thu, 17 May 2018 02:28:24 +0000 (19:28 -0700)]
session: add session process node

Add a session process node that handles main thread tx and retransmit in
order to avoid having a polling input node.

Change-Id: I3357e987c023a84b533b32793e37ab4204420f64
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agotap: remove the local vlib_log_info definition 37/11937/3
Mohsin Kazmi [Thu, 17 May 2018 15:21:39 +0000 (17:21 +0200)]
tap: remove the local vlib_log_info definition

Change-Id: Idff55a19d27fed0d57e222f38d2e16c5367911cb
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
5 years agoRework kube-proxy into LB plugin 19/10419/19
Hongjun Ni [Tue, 6 Feb 2018 15:00:22 +0000 (23:00 +0800)]
Rework kube-proxy into LB plugin

Add support of NAT66

Change-Id: Ie6aa79078a3835f989829b9a597c448dfd2f9ea3
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
5 years agoAdd buffer pointer-to-index and index-to-pointer array functions 20/12620/5
Damjan Marion [Thu, 17 May 2018 10:44:00 +0000 (12:44 +0200)]
Add buffer pointer-to-index and index-to-pointer array functions

Change-Id: Ib3fcc3ceb7f315389bcdecbb7d9632540a5dd6ba
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agovlib: Fix WARN-ING macro in function 28/12628/2
Mohsin Kazmi [Thu, 17 May 2018 14:47:08 +0000 (16:47 +0200)]
vlib: Fix WARN-ING macro in function

Change-Id: I238106c2afc46904fb0eb17164f30dbd1378892e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
5 years agoFix failure during enable/disable of features 80/12580/2
Matthew Smith [Tue, 15 May 2018 20:51:30 +0000 (15:51 -0500)]
Fix failure during enable/disable of features

vnet_feature_enable_disable_with_index() checks the
return status of vnet_config_{add,del}_feature().
If the config string heap index returned is the same
index that was in use prior to the add/delete, it is
concluded that a failure occurred and processing of
the feature stops.

Sometimes the config index that is returned
can legitimately be the same index that was in used
before the add/delete. The old list of features can
have its heap entry deallocated before a new entry for
the new list is allocated. The heap entry for the new
list can be the entry that was deallocated while
deleting the old one.

Make vnet_config_{add,del}_feature() return ~0 on
failure. Look for that return value as an indication
that an error occurred in
vnet_enable_disable_feature_by_index().

Change-Id: I88bb3ff88a76971c1b5e5ece74784ce8ba78373c
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agoAllow openSUSE tumbleweed 25/12625/2
Marco Varlese [Thu, 17 May 2018 13:46:13 +0000 (15:46 +0200)]
Allow openSUSE tumbleweed

Change-Id: I2ab7f5d2a30620b12bd345d6102a3d381ee5d5ec
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
5 years agoFixes in IPv6 RD control plane 19/12619/3
Juraj Sloboda [Thu, 17 May 2018 10:05:27 +0000 (12:05 +0200)]
Fixes in IPv6 RD control plane

Add default route to the VRF table in which the interface is bound.
Add missing pool_put.

Change-Id: Id76c7dbfbf9bcf18357f372f3eee9b931df1995e
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
5 years agoflow:redirect to node 87/12587/4
Eyal Bari [Wed, 16 May 2018 09:15:32 +0000 (12:15 +0300)]
flow:redirect to node

Change-Id: I4b6577b496c56f27f07dd0066fcfdfd0cebb6f1a
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoNAT44: nat44_del_session and nat44_user_session_details API update (VPP-1271) 69/12569/4
Matus Fabian [Mon, 14 May 2018 13:20:28 +0000 (06:20 -0700)]
NAT44: nat44_del_session and nat44_user_session_details API update (VPP-1271)

Change-Id: I484d79000c1bbd87ff83847cf567bf3414a719d3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agotcp: handle link-local addresses 05/12205/12
Florin Coras [Thu, 26 Apr 2018 15:26:52 +0000 (08:26 -0700)]
tcp: handle link-local addresses

Change-Id: I9ede6bc861350c7d9e78fa4d96cd584c2816d06f
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoPacket generator: preserve pcap file timestamps 04/12604/2
Dave Barach [Wed, 16 May 2018 15:34:35 +0000 (11:34 -0400)]
Packet generator: preserve pcap file timestamps

Set vnet_buffer2(b0)->pg_replay_timestamp, for use when desired.

Fix a memory leak in pg_stream_free(...), which wasn't freeing the
replay packet templates.

Change-Id: I01822a9e91a52de4774d2b95cf0c2ee254a915e9
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agodpdk: fix rte_eth_dev_set_mtu callsites to use same mtu value 06/12206/2
Rui Cai [Thu, 26 Apr 2018 23:15:57 +0000 (23:15 +0000)]
dpdk: fix rte_eth_dev_set_mtu callsites to use same mtu value

During dpdk_lib_init, it calculates MRU and MTU and later calls
rte_eth_dev_set_mtu with calculated MTU value. However, dpdk_device_setup
calls rte_eth_dev_set_mtu with hi->max_packet_bytes, which is set to be
MRU value in dpdk_lib_init earlier.

Most of the time, MRU != MTU in dpdk_lib_init and it looks like
hi->max_packet_bytes is treated as MTU in other parts of vpp codebase.
Therefore, dpdk_lib_init should be consistent and use MTU instead of MRU
for hi->max_packet_bytes.

Change-Id: I23ff2a6cd45d6bc819b6f64d5f0fc0490b8a44de
Signed-off-by: Rui Cai <rucai@microsoft.com>
5 years agoDrop IPsec packets when interface is down 08/12608/2
Matthew Smith [Wed, 16 May 2018 03:03:05 +0000 (22:03 -0500)]
Drop IPsec packets when interface is down

Packets arriving on an IPsec tunnel interface
are decrypted and forwarded even if the
interface is down.

Check interface flags. If the interface is down,
cause packet to be dropped and increment the
counters for drops.

Change-Id: I94456bda3bd8eade0f3f522ad7cc341251174e6e
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agomake test: unify packet checksum verifications 91/12591/3
Klement Sekera [Wed, 16 May 2018 08:52:54 +0000 (10:52 +0200)]
make test: unify packet checksum verifications

Change-Id: If9cc7c5e32ebecff398fd38b39e8f485754a4ad4
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoFix broken compilation for non-numa aware platforms 19/12519/3
Sachin Saxena [Thu, 10 May 2018 10:52:09 +0000 (16:22 +0530)]
Fix broken compilation for non-numa aware platforms

 - The dpdk plugin always looks for libnuma library during compilation.
   For non-numa aware platforms compilation breaks, if third party
   libnuma lib is not available.
 - Issue is more severe with Cross Compilation scenario where one has to
   download and cross compile libnuma-dev package even when target platofrom
   is NUMA disabled.
   Like when cross compiling for ARM platforms, Linaro tool-chain doesn't have
   libnuma by default.

Change-Id: Ib85b3188b787c23ba33b47e3f6123c74fd37190e
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agoecho client: used fixed pool for preallocated sessions 05/12605/2
Florin Coras [Wed, 16 May 2018 16:28:02 +0000 (09:28 -0700)]
echo client: used fixed pool for preallocated sessions

Change-Id: I9e2cf74ebe3e8750fa8d03930d2d72f4cae453c2
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoUpdate ipfix documentation 77/12577/2
Dave Barach [Tue, 15 May 2018 14:26:41 +0000 (10:26 -0400)]
Update ipfix documentation

Change-Id: Ie942efab86d24a953fe34754e3d50df54b560dc0
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoNo overlapping sub-nets on any interface in the same table/VRF (VPP-943) 57/8057/14
Neale Ranns [Mon, 14 Aug 2017 17:35:44 +0000 (10:35 -0700)]
No overlapping sub-nets on any interface in the same table/VRF (VPP-943)

DBGvpp# set int ip addr loop0 10.10.10.10/24
DBGvpp# set int ip addr loop0 10.10.10.11/24
set interface ip address: failed to add 10.10.10.11/24 which conflicts with 10.10.10.10/24 for interface loop0

Change-Id: Iba63ffafbd36b6146ce86adb78139da9d55b40ba
Signed-off-by: Neale Ranns <nranns@cisco.com>
5 years agoVOM: nat-binding populate handle errors 65/12565/3
Neale Ranns [Mon, 14 May 2018 12:16:46 +0000 (05:16 -0700)]
VOM: nat-binding populate handle errors

Change-Id: I8f41c659c6f50efd679a56878c6fdcf426ac9410
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
5 years agoproxy: fix active open connection cleanup 70/12570/1
Florin Coras [Mon, 14 May 2018 08:44:01 +0000 (01:44 -0700)]
proxy: fix active open connection cleanup

Thanks to DucTM for spotting the issue.

Change-Id: I7985560f224c99cf0fdeea0c8457a3ac6f10b03c
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agovom: fix interface admin up/down 42/12542/2
Mohsin Kazmi [Fri, 11 May 2018 13:49:49 +0000 (15:49 +0200)]
vom: fix interface admin up/down

Change-Id: I7b9d28a940e0d7c4a4acda3f4048261c67bf49ff
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
5 years agoRework CP and DP communication in IPv6 RD (VPP-1256) 21/12521/4
Juraj Sloboda [Thu, 3 May 2018 08:03:50 +0000 (10:03 +0200)]
Rework CP and DP communication in IPv6 RD (VPP-1256)

Replace binary API communication between CP and DP with
direct communication using function calls and callbacks.

Change-Id: Ib54f09062217c028e5ee0e96ae2449cf7e9224e3
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
5 years agoNAT44: delete closed TCP session (VPP-1274) 33/12533/2
Matus Fabian [Fri, 11 May 2018 05:48:53 +0000 (22:48 -0700)]
NAT44: delete closed TCP session (VPP-1274)

Change-Id: Id25b447bddccb7b321123e4abc4134e7261a0807
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agoImprove ipfix template packet rewrite construction 54/12554/2
Dave Barach [Sun, 13 May 2018 12:50:25 +0000 (08:50 -0400)]
Improve ipfix template packet rewrite construction

Instead of repeatedly cutting, pasting, and hacking to create a new
callback, use vnet_flow_rewrite_generic_callback(). Add three
arguments to the flow rewrite callback:

(in) pointer to an array of report elements,
(in) length of array,
(out) pointer to the stream index

Change existing code prototypes. Code owners encouraged to evaluate
whether they can use the generic callback or not, at leisure.

/* ipfix field definitions for a particular report */
typedef struct
{
  u32 info_element;
  u32 size;
} ipfix_report_element_t;

Best generated like so:

_(sourceIPv4Address, 4)                         \
_(destinationIPv4Address, 4)                    \
_(sourceTransportPort, 2)                       \
_(destinationTransportPort, 2)                  \
_(protocolIdentifier, 1)                        \
_(flowStartMicroseconds, 8)                     \
_(flowEndMicroseconds, 8)

static ipfix_report_element_t simple_report_elements[] = {
  foreach_simple_report_ipfix_element
};

  ...
  /* Set up the ipfix report */
  memset (&a, 0, sizeof (a));
  a.is_add = 1 /* to enable the report */ ;
  a.domain_id = 1 /* pick a domain ID */ ;
  a.src_port = UDP_DST_PORT_ipfix /* src port for reports */ ;
  a.rewrite_callback = vnet_flow_rewrite_generic_callback;
  a.report_elements = simple_report_elements;
  a.n_report_elements = ARRAY_LEN (simple_report_elements);
  a.stream_indexp = &jim->stream_index;
  a.flow_data_callback = simple_flow_data_callback;

  /* Create the report */
  rv = vnet_flow_report_add_del (frm, &a, &template_id);
  if (rv)
    return rv;
  ...

Change-Id: If6131e6821d3a37a29269c0d58040cdf18ff05e4
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agosession: improve app verbose format function 50/12550/2
Florin Coras [Fri, 11 May 2018 16:20:12 +0000 (09:20 -0700)]
session: improve app verbose format function

Change-Id: Idae4ecb60351f2e74bad2f2a33c073de8412fcb0
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agosession: alloc one frame per output node dispatch 32/12532/10
Florin Coras [Thu, 10 May 2018 20:20:47 +0000 (13:20 -0700)]
session: alloc one frame per output node dispatch

Change-Id: I1f7877af61f3726cfb7b93ce7893f6df23e866a6
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agodpdk: Add constants for failsafe PMD 47/12547/2
Rui Cai [Fri, 11 May 2018 22:13:58 +0000 (22:13 +0000)]
dpdk: Add constants for failsafe PMD

Adding name, enum constants and formatting code
for failsafe PMD.

This is part of initial effort to enable vpp running over
dpdk on failsafe PMD in Microsoft Azure(2/4).

Change-Id: I4eb0093db9f666e2635f7ddff451e3c9064bd0c4
Signed-off-by: Rui Cai <rucai@microsoft.com>
5 years agodpdk: Add build related keywords for failsafe PMD 46/12546/2
Rui Cai [Fri, 11 May 2018 21:52:22 +0000 (21:52 +0000)]
dpdk: Add build related keywords for failsafe PMD

Added build related keywords for TAP, FAILSAFE PMD
and also added some missing keywords for mlx4 PMD

This is part of initial effort to enable vpp running over
dpdk on failsafe PMD in Microsoft Azure (1/4).

Change-Id: I2aebf209fbc6db030185f41971b51a593a003a3a
Signed-off-by: Rui Cai <rucai@microsoft.com>
5 years agodpdk: fix Unknown interface with Mellanox NIC 30/12530/2
Steve Shin [Thu, 10 May 2018 21:14:52 +0000 (14:14 -0700)]
dpdk: fix Unknown interface with Mellanox NIC

When port_type_from_speed_capa() is called before the port link update isn't completed,
xd->port_type becomes VNET_DPDK_PORT_TYPE_UNKNOWN. This happens with Mellanox NIC
without lsc interrupt. Calling rte_eth_link_get before getting dev_info will ensure
the link state is up-to-date.

Change-Id: I83a59654778eb4bf0c65a4a4e225a326227b9641
Signed-off-by: Steve Shin <jonshin@cisco.com>
5 years agoPeriodic scan and probe of IP neighbors to maintain neighbor pools 76/12276/8
John Lo [Sat, 28 Apr 2018 05:19:24 +0000 (01:19 -0400)]
Periodic scan and probe of IP neighbors to maintain neighbor pools

Scan IPv4 and IPv6 neigbor pool entries once a minute to keep them
up to date. The neighbor of an entry is probed if its time-stamp
is older than 1 minute. If the neighbor respond, its time-stamp
will be updated. If there is no response from a neighbor, its
entry will be deleted when the time-stamp of the entry become more
than 4 minutes old. Static neighbor entries are not probed nor
deleted.

Implemented CLI and API to enable and disable priodic scan of IPv4,
IPv6 or both types of IP neighbors. CLI is "ip scan-neighbor" and
API is "ip_scan_neighbor_enable_disable". Other IP neighbor scan
parameters can also be changed from their defaults via the CLI/API.

Change-Id: Id1a0a934ace15d03db845aa698bcbb9cdabebfcd
Signed-off-by: John Lo <loj@cisco.com>
5 years agomake test: reorganize ipsec_ah test code 38/12538/2
Klement Sekera [Fri, 11 May 2018 09:06:09 +0000 (11:06 +0200)]
make test: reorganize ipsec_ah test code

Change-Id: Ie0eb0127affd3d771d19bb7c60e79c31858d82cd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoVPP-1275 Fix memory leaks in IPsec CLI 39/12539/2
Klement Sekera [Fri, 11 May 2018 10:59:05 +0000 (12:59 +0200)]
VPP-1275 Fix memory leaks in IPsec CLI

Change-Id: I1f7c634328f25b33580a215af2daeb498cd3b181
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoAdd ipfix exporter coding guide 06/12506/2
Dave Barach [Wed, 9 May 2018 17:25:09 +0000 (13:25 -0400)]
Add ipfix exporter coding guide

Change-Id: Iaa28f96d613d6fb75bd29958d757de206448eb22
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agoFix issue with xconnect not working on the main interface 27/12527/3
Damjan Marion [Thu, 10 May 2018 18:26:36 +0000 (20:26 +0200)]
Fix issue with xconnect not working on the main interface

Due to union, l2 sub-interface bits were wrongly set
causing sporadic misconfiguration of l2 mode on some
interfaces.

Change-Id: Id77ee281e3a0030878641a786c22ffe16ce1c759
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoRemove the historical memfd api segment bootstrap 28/12528/1
Dave Barach [Thu, 10 May 2018 20:44:27 +0000 (16:44 -0400)]
Remove the historical memfd api segment bootstrap

Clean up default and vpp_api_test custom private api segment allocator
ring configurations.

Change-Id: I145b6d64ba0a6315b5ccb07909c8256eeb772146
Signed-off-by: Dave Barach <dave@barachs.net>
5 years agovppinfra: use count_trailing_zeros in sparse_vec_index 23/12523/3
Damjan Marion [Thu, 10 May 2018 11:40:44 +0000 (13:40 +0200)]
vppinfra: use count_trailing_zeros in sparse_vec_index

It is much cheaper to use ctzll than to do shift,subtract and mask
in likely case when we are looking for 1st set bit in the uword.

Change-Id: I31954081571978878c7098bafad0c85a91755fa2
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoNAT44: sessions counters per user fix (VPP-1270) 00/12500/2
Matus Fabian [Wed, 9 May 2018 11:51:03 +0000 (04:51 -0700)]
NAT44: sessions counters per user fix (VPP-1270)

Change-Id: I6306b81e0e1c3e1c591f929a76bb265c1c1d0859
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agovnet: device flow offload infra 90/11190/19
Damjan Marion [Fri, 16 Mar 2018 00:25:27 +0000 (01:25 +0100)]
vnet: device flow offload infra

Change-Id: Ibea4a96bdec5e368301a03d8b11a0712fa0265e0
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agosession: fix proxy app multithreading 17/12517/2
Florin Coras [Thu, 10 May 2018 00:33:00 +0000 (17:33 -0700)]
session: fix proxy app multithreading

Change-Id: Ic5304749935f69018eb00183bb4670bb9f16273c
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoChange the way IP header pointer is calculated in esp_decrypt nodes 04/12504/2
Szymon Sliwa [Wed, 9 May 2018 12:28:08 +0000 (14:28 +0200)]
Change the way IP header pointer is calculated in esp_decrypt nodes

The pointer to IP header was derived from l3_hdr_offset,
which would be ok, if l3_hdr_offset was valid. But it does not
have to be, so it was a bad solution. Now the previous nodes
mark whether it is a IPv6 or IPv4 packet tyle, and in esp_decrypt
we count get ip header pointer by substracting the size
of the ip header from the pointer to esp header (which lies
in front of the ip header).

Change-Id: I6d425b90931053711e8ce9126811b77ae6002a16
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
5 years agoDHCP4 client process replies when renewing lease 81/12481/2
Matthew Smith [Mon, 7 May 2018 12:52:12 +0000 (07:52 -0500)]
DHCP4 client process replies when renewing lease

When a DHCP client is in the bound state, it wakes up
halfway through it's lease (by default) to try and renew
the lease. The ip4-dhcp-client-detect is not enabled as
a feature at this point, so replies sent from the DHCP
server do not get applied to the lease. Eventually the
lease expires, the address is removed from the interface,
a new discovery is performed and the same address is added
back to the interface.

Before sending a request to renew in the bound state, enable
the feature to process the reply.

Change-Id: I95332ee0596f47df6f3c8bf8e3f0698dde9a1fc5
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agovppinfra: use popcnt instruction when available 11/12511/2
Damjan Marion [Thu, 10 May 2018 01:04:08 +0000 (03:04 +0200)]
vppinfra: use popcnt instruction when available

Change-Id: Id02d613b8613a2d448840fe2d6a5e3b168a3c563
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agotcp: fix jumbo retransmits 12/12512/4
Florin Coras [Wed, 9 May 2018 18:34:25 +0000 (11:34 -0700)]
tcp: fix jumbo retransmits

Change-Id: I1c8a14d4d51aa730f0edcf491e3c4725e2d8bd66
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agodpdk:fix tx count 14/12514/2
Eyal Bari [Thu, 10 May 2018 06:12:42 +0000 (09:12 +0300)]
dpdk:fix tx count

Change-Id: I921465ea64b59d42674cc8f19069ed04e3b25026
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agodpdk: fix free of tx dropped packets 13/12513/1
Florin Coras [Wed, 9 May 2018 18:42:54 +0000 (11:42 -0700)]
dpdk: fix free of tx dropped packets

Change-Id: I3669068f694614f8555b33bf0b703c41e45363ef
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoipsec: support UDP encap/decap for NAT traversal 65/12465/4
Klement Sekera [Tue, 17 Apr 2018 16:04:57 +0000 (18:04 +0200)]
ipsec: support UDP encap/decap for NAT traversal

Change-Id: I65c12617ad49e4d5ef242e53988782f0cefa5684
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agosession: cleanup session tx function 39/12439/11
Florin Coras [Fri, 4 May 2018 22:46:57 +0000 (15:46 -0700)]
session: cleanup session tx function

- rework the function to declutter and avoid building more than one tx
  frame
- add dual loop although benefits in my tests seem to be minimal
- improve tcp/udp echo external apps. They have slightly better
  throughput than internal echo apps.
- udp bugfixes

Change-Id: Iea4a245b1b1bb407a7f403dedcce2664a49f774b
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agodpdk: tx code rework 44/12444/6
Damjan Marion [Sat, 5 May 2018 10:30:28 +0000 (12:30 +0200)]
dpdk: tx code rework

Change-Id: Ifea9c772e8784642433b92091f5769eb9ec06890
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agodpdk:fix mbuf index typo's 83/12483/1
Eyal Bari [Wed, 9 May 2018 06:37:54 +0000 (09:37 +0300)]
dpdk:fix mbuf index typo's

Change-Id: I387b22427b3f322969bcf32fcfc189123c8ed6ae
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoNAT44: TCP connection close detection (VPP-1266) 14/12414/2
Matus Fabian [Fri, 4 May 2018 10:57:42 +0000 (03:57 -0700)]
NAT44: TCP connection close detection (VPP-1266)

Change-Id: Iba1cc1179ee80478e29888790a6476571d1904dc
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agoopensuse: OS_ID field content changed for SUSE 68/12468/2
Marco Varlese [Mon, 7 May 2018 13:40:45 +0000 (15:40 +0200)]
opensuse: OS_ID field content changed for SUSE

Change-Id: I4bb582d55b1071d3581155eb158995ca5153ba3c
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
5 years agodpdk: improve perf of buffer indices calc in the input node 67/12467/2
Damjan Marion [Mon, 7 May 2018 13:20:25 +0000 (15:20 +0200)]
dpdk: improve perf of buffer indices calc in the input node

Change-Id: I16557189aa4a763ec496cb4a45f6e12f2d46971f
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agofix: AttributeError: module 'os' has no attribute 'cwd' 76/12076/2
Andrey "Zed" Zaikin [Tue, 24 Apr 2018 11:50:02 +0000 (14:50 +0300)]
fix: AttributeError: module 'os' has no attribute 'cwd'

Change-Id: I1c49a12ef7fa7bd0046f1a420b01c1654b6d21ec
Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
5 years agoBFD: Fix format_ip46_address() parameter ordering. 51/12451/2
Jon Loeliger [Sat, 5 May 2018 21:11:31 +0000 (16:11 -0500)]
BFD: Fix format_ip46_address() parameter ordering.

Change-Id: I2b50e3fc06b4e905395d4706083f12ebc76826ce
Signed-off-by: Jon Loeliger <jdl@netgate.com>
5 years agovxlan:vxlan.c conform coding style 58/12458/1
Eyal Bari [Mon, 7 May 2018 07:13:44 +0000 (10:13 +0300)]
vxlan:vxlan.c conform coding style

Change-Id: I9937912cd760698e39044e8ae022a90b58c8db30
Signed-off-by: Eyal Bari <ebari@cisco.com>
5 years agoautodetect alignment during _vec_resize 33/12433/4
Damjan Marion [Fri, 4 May 2018 18:45:41 +0000 (20:45 +0200)]
autodetect alignment during _vec_resize

Change-Id: I2896dbde78b5d58dc706756f4c76632c303557ae
Signed-off-by: Damjan Marion <damarion@cisco.com>
5 years agoipsec: allow null/null for crypto/integ algorithms pair 22/12422/2
Radu Nicolau [Fri, 4 May 2018 11:51:53 +0000 (12:51 +0100)]
ipsec: allow null/null for crypto/integ algorithms pair

Change-Id: Ic1e189c22e3d344d165e0eab05ccb667eef088a9
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
5 years agoAdd python lex and yacc to spec file build requirements. 29/12429/2
Thomas F Herbert [Thu, 3 May 2018 23:17:13 +0000 (19:17 -0400)]
Add python lex and yacc to spec file build requirements.

Change-Id: Icf1a30c9df4d3298407c00383020debe99acdbff
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
5 years agoFlow: Rename IPFIX exporter. 20/12320/4
Ole Troan [Wed, 2 May 2018 10:45:10 +0000 (12:45 +0200)]
Flow: Rename IPFIX exporter.

Change-Id: I9363cf54b73f7cfd8622af6f1cb250438ea0d3b6
Signed-off-by: Ole Troan <ot@cisco.com>
5 years agobuild-data: Common makefile for NXP DPAA1/DPAA2 platforms 52/12352/8
Sachin Saxena [Fri, 4 May 2018 10:38:43 +0000 (16:08 +0530)]
build-data: Common makefile for NXP DPAA1/DPAA2 platforms

 - Same makefile will be used to support DPAA1 and DPAA2 platforms.
 - Support added to have both on Host compilation as well as Cross compilation.
 - If Cross compiling, by default NXP cutomized toolchain "aarch64-fsl-linux" will be used.
   To use Linaro toolchains, please set env variable CROSS_PREFIX.
   Like: export CROSS_PREFIX=aarch64-linux-gnu

 - Added CPU_MTUNE to modify xxx_mtune , if CPU is not A72 which is default.
 - You may set DPDK_PATH to dpdk installation folder, if wish to use locally compiled DPDK.
 - In case of Cross compilation, OPENSSL_PATH will be required to include OPENSSL libs.

Change-Id: I9057dfc57522b60e306810f684b3085bfccf85e9
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agoHarmonize vec/pool_get_aligned object sizes and alignment requests 79/12379/5
Dave Barach [Thu, 3 May 2018 12:26:39 +0000 (08:26 -0400)]
Harmonize vec/pool_get_aligned object sizes and alignment requests

Object sizes must evenly divide alignment requests, or vice
versa. Otherwise, only the first object will be aligned as
requested.

Three choices: add CLIB_CACHE_LINE_ALIGN_MARK(align_me) at
the end of structures, manually pad to an even divisor or multiple of
the alignment request, or use plain vectors/pools.

static assert for enforcement.

Change-Id: I41aa6ff1a58267301d32aaf4b9cd24678ac1c147
Signed-off-by: Dave Barach <dbarach@cisco.com>
5 years agoarm64: Avoid setting march to corei7 when Cross Compiling for ARM 99/12399/3
Sachin Saxena [Fri, 4 May 2018 09:38:29 +0000 (15:08 +0530)]
arm64: Avoid setting march to corei7 when Cross Compiling for ARM

  When Cross-compiling VPP for arm64 target and build machine is x86_64,
  based on build_cpu value, the march variable is set to corei7 which is
  an unrecoganized option for ARM tool chain.
  This breaks the VPP compilation.

Change-Id: I4cba5b4990e7cf0bdc1403e90c3d18110900bbef
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agoAddress compilation issues with Java > 1.8 25/12325/2
Marco Varlese [Wed, 2 May 2018 11:33:47 +0000 (13:33 +0200)]
Address compilation issues with Java > 1.8

This patch addresses the changes in the JDK to build headers (javah no
longer available)

Change-Id: I3e94b1cf97c8c474535c26b75ea08379338fe0af
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
5 years agoFix format for the dst address in the STN trace 86/12386/2
Milan Lenco [Thu, 3 May 2018 15:31:46 +0000 (17:31 +0200)]
Fix format for the dst address in the STN trace

Output string 's' was not assigned the return value of format() for
the destination address, which, in case the underlying memory was moved
by the realloc, resulted in an invalid memory access by the subsequent
invocations of format().

Change-Id: I2b5dfd85db085c553ca5ec0b3257aeeb437c360a
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
5 years agoVAPI: support VLAs in type definitions 80/12380/3
Klement Sekera [Thu, 3 May 2018 12:27:42 +0000 (14:27 +0200)]
VAPI: support VLAs in type definitions

Change-Id: I8d54415972d6644190857175b0e895c5319ce7b6
Signed-off-by: Klement Sekera <ksekera@cisco.com>
5 years agoNAT: fix bin API dump of static mappings. 30/12330/2
Milan Lenco [Wed, 2 May 2018 12:22:22 +0000 (14:22 +0200)]
NAT: fix bin API dump of static mappings.

Static mappings with equal local and external IPs
but different ports were dumped as identity mappings.

Change-Id: Ifea7cef5b78aea4c2eb31cf1620185eeef2681e5
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
5 years agoMPLS prefetch fixes 27/12327/3
Neale Ranns [Wed, 2 May 2018 12:15:16 +0000 (05:15 -0700)]
MPLS prefetch fixes

Change-Id: I565d79af410825c72f291ab40178883b1bc6f1df
Signed-off-by: Neale Ranns <nranns@cisco.com>
5 years agoNAT44: fix VAT nat44_user_session_details 09/12309/2
Matus Fabian [Wed, 2 May 2018 07:59:33 +0000 (00:59 -0700)]
NAT44: fix VAT nat44_user_session_details

Change-Id: If379247f0574fbfcca39e752684bf6c81b95187b
Signed-off-by: Matus Fabian <matfabia@cisco.com>
5 years agoNAT44 segv on unknown proto on inside interface 53/12353/2
Matthew Smith [Mon, 30 Apr 2018 21:39:13 +0000 (16:39 -0500)]
NAT44 segv on unknown proto on inside interface

When a packet with an unknown proto arrives
on an inside interface and there are no existing sessions
for the source address, a segv occurs.

snat_in2out_unknown_proto() finds the head of the sessions
dlist, fetches the address of the next element using
head->next, and then dereferences the next element. On the
first packet received from a source address, head->next is
~0, so this results in a segv.

Check that the session list is not empty before trying to
traverse it.

Also removed unnecessary lookup against tsm->user_hash.
Prior call to nat_user_get_or_create() already performed
that lookup and added a user if one didn't exist.

Change-Id: If73e79aa2f8e3962ab7b876ecf55aea40d7a5472
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
5 years agotcp: fix echo server rx retries counter vec alloc 63/12363/2
Florin Coras [Wed, 2 May 2018 21:34:32 +0000 (14:34 -0700)]
tcp: fix echo server rx retries counter vec alloc

If sessions are not preallocated, the rx retries counters are not
correctly validated/initialized

Change-Id: Iaf7456f3a0e2181fcea0c370613d694f8e98276d
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agoFix CentOS 7 build issue with vxlan 49/12349/2
Matthew Smith [Wed, 2 May 2018 14:55:01 +0000 (09:55 -0500)]
Fix CentOS 7 build issue with vxlan

Two vxlan union/struct initializations caused gcc on
CentOS 7 to puke. Modified them to make the build
work again.

Change-Id: Iad667444b86cfde5ee4329993b520028d3b593ad
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
6 years agoScapy; update to release 2.4.0 97/12297/2
Neale Ranns [Tue, 1 May 2018 12:55:59 +0000 (05:55 -0700)]
Scapy; update to release 2.4.0

Change-Id: Ibcae49ab106efa9cd0ff60be60904ac5a2fc0b65
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
6 years agovxlan:encap - use vnet rewrite 88/12288/2
eyal bari [Thu, 26 Apr 2018 10:14:55 +0000 (13:14 +0300)]
vxlan:encap - use vnet rewrite

moving the rewrite into the tunnel struct

Change-Id: Iec74b48e13456d32957e826cffb5ea35a8ebd1a0
Signed-off-by: Eyal Bari <ebari@cisco.com>
6 years agotcp/session: debug improvements/fixes 75/11975/6
Florin Coras [Fri, 20 Apr 2018 17:51:49 +0000 (10:51 -0700)]
tcp/session: debug improvements/fixes

Change-Id: I906e58b4f9827a79a6ab673f8fa2e03036c69820
Signed-off-by: Florin Coras <fcoras@cisco.com>
6 years agoAdd plugin periodic function elisp skeleton 95/12295/2
Dave Barach [Mon, 30 Apr 2018 17:03:46 +0000 (13:03 -0400)]
Add plugin periodic function elisp skeleton

Change-Id: Ide4e2d2a06dff20c94ae5436ba6361b246052867
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoRemove historical README file 93/12293/2
Dave Barach [Mon, 30 Apr 2018 14:50:13 +0000 (10:50 -0400)]
Remove historical README file

Change-Id: I54a00686a7f3a61f583a5f701a0ab6c5480a455b
Signed-off-by: Dave Barach <dave@barachs.net>
6 years agoFIB: elide cover walk for insert of host route 05/12105/2
Neale Ranns [Wed, 25 Apr 2018 08:41:24 +0000 (01:41 -0700)]
FIB: elide cover walk for insert of host route

Change-Id: I2d39e56ff605e3a24927d6330d65d0406f588381
Signed-off-by: Neale Ranns <nranns@cisco.com>
6 years agoAdd reference to 18.04 test framework documentation 91/12291/1
Chris Luke [Mon, 30 Apr 2018 13:59:43 +0000 (09:59 -0400)]
Add reference to 18.04 test framework documentation

Change-Id: I0f24e0f0fde0568161edf52f40c5b83877ed7130
Signed-off-by: Chris Luke <chrisy@flirble.org>
6 years agoplugins: dpdk: fix check which makes not sense, likely a typo 89/12289/1
Szymon Sliwa [Mon, 30 Apr 2018 12:47:24 +0000 (14:47 +0200)]
plugins: dpdk: fix check which makes not sense, likely a typo

Change-Id: If33854f9c32736edf571fb66cdfa759db1c9de25
Signed-off-by: Szymon Sliwa <szs@semihalf.com>