3846 Commits

Author SHA1 Message Date
Dave Barach
104404348f Fix bugs in emacs plugin templates
use api_helper_macros.h
declare plugin_main_t external in the header file
declare plugin_main_t instance in plugin.c
setup main_t->vlib_main, main_t->vnet_main in the init routine

Change-Id: Ib8c742a60c63adfe9724447e1a2acc8c7723e90c
Signed-off-by: Dave Barach <dave@barachs.net>
2018-04-03 19:56:11 +00:00
Florin Coras
a46b4c9b5e session: use fib index in ip local test
Change-Id: I148cb40c8bea55dabe54fa6a662d46862e571640
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-04-03 19:34:03 +00:00
Andrew Yourtchenko
57612ebcf3 make test: print a warning in case a core_pattern contains a filter program
The default config on Ubuntu 16.04.4 desktop results in truncated cores
when running make test which coredumps. Uninstalling the filter program
(apport) makes the corefiles normal size. Print a warning about that fact,
so the others potentially affected didn't have to wonder.

Change-Id: Iba4b0a2765a25100d6e24fd7f4de0e0339efd835
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-31 12:49:40 +00:00
Steven
074f698be5 tapv2: Sporadic SIGABRT in ethernet_input [VPP-1183]
virtio_free_rx_buffers uses the wrong slot in the vring to get
the buffer index. It uses desc_next. It should be last_used_idx
which is the slot number for the first valid descriptor.

Change-Id: I6b62b794f06869fbffffce45430b8b2e37b1266c
Signed-off-by: Steven <sluong@cisco.com>
2018-03-30 22:26:40 -07:00
Jakub Grajciar
3744fc7abc libmemif: zero-copy-slave mode + header space
Slave is now able to dequeue buffers from rx queue and enqueue them to tx queue
(zero-copy operation). Slave can produce buffers with headroom, which will allow adding
 encap without copy.

Change-Id: Ia189f8de1a68be787545ed46cf78d36403e7e9bf
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-30 20:48:36 +00:00
Andrew Yourtchenko
17ddc0fee1 acl-plugin: implement an optional session reclassification when ACL is (re-)applied
There were several discussions in which users would expect the sessions to be deleted
if the new policy after the change does not permit them.
There is no right or wrong answer to this question - it is a policy decision.

This patch implements an idea to approach this. It uses a per-interface-per-direction counter to designate
a "policy epoch" - a period of unchanging rulesets. The moment one removes or adds an ACL applied to
an interface, this counter increments.
The newly created connections inherit the current policy epoch in a given direction.
Likewise, this counter increments if anyone updates an ACL applied to an interface.

There is also a new (so far hidden) CLI "set acl-plugin reclassify-sessions [0|1]"
(with default being 0) which allows to enable the checking of the existing sessions
against the current policy epoch in a given direction.

The session is not verified unless there is traffic hitting that session
 *in the direction of the policy creation* - if the epoch has changed,
the session is deleted and within the same processing cycle is evaluated
against the ACL rule base and recreated - thus, it should allow traffic-driven
session state refresh without affecting the connectivity for the existing sessions.

If the packet is coming in the direction opposite to which the session was initially
created, the state adjustment is never done, because doing so generically
is not really possible without diving too deep into the special cases,
which may or may not work.

Change-Id: I9e90426492d4bd474b5e89ea8dfb75a7c9de2646
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-30 20:48:01 +00:00
Maciek Konstantynowicz
6091d230e3 Updated sample startup.conf with supported plugin config options.
Change-Id: Id2884a4c2208b4382fce56019b11e4b7fdc4275b
Signed-off-by: Maciek Konstantynowicz <mkonstan@cisco.com>
2018-03-30 20:47:32 +00:00
John DeNisco
4dc8397629 Fix minor issues.
Change-Id: I1ce5106d99dd4d4b1c033d4873b4511e9a170afc
Signed-off-by: John DeNisco <jdenisco@cisco.com>
2018-03-30 20:46:03 +00:00
Chris Luke
76981eedcd Add missing stdint.h
Coverity has started whining about uint32_t missing in this .h

Change-Id: I57992121c0593d6a0ada35917802d0300cf91259
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-03-30 20:45:36 +00:00
Steven
dd4889e21c lacp: faster convergence for slow-rate config option
Do fast-rate if we are not yet synchronized with the partner.

Stop sending LACP updates as a flash in the worker thread. Just expire the
timer and let the lacp_process handle sending LACP PDU.

Change-Id: I8b36fe74e752e7f45bd4a8d70512c0341cc197a1
Signed-off-by: Steven <sluong@cisco.com>
2018-03-30 20:44:56 +00:00
Steven
70488ab7f8 bond: show trace causes a crash if the interface is deleted
For the debug image, if the interface is removed and the trace was
collected prior to the interface delete, show trace may cause a crash.
This is because vnet_get_sw_interface_name and vnet_get_sup_hw_interface
are not safe if the interface is deleted.

The fix is to use format_vnet_sw_if_index_name if all we need is to
get the interface name in the trace to display. It would show "DELETED"
which is better than a crash.

Change-Id: I912402d3e71592ece9f49d36c8a6b7af97f3b69e
Signed-off-by: Steven <sluong@cisco.com>
2018-03-30 20:43:49 +00:00
Steve Shin
c1613a72a7 dpdk: fix crash due to incorrect xd->flags value with slave's link toggling
xd->flags is set incorrectly when a slave link is down in bonded interface mode.
This can result in VPP crash when data traffic flows to the interface.

Change-Id: Ideb9f5231db1211e8452c52fde646d681310c951
Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-03-30 13:33:40 +00:00
Chris Luke
30684ac044 Coverity fixes (VPP-1204)
Minor bug fixes

CID 183000: double close
CID 180996: dead code
CID 180995: NULL deref
CID 181957: NULL deref
CID 182676: NULL deref
CID 182675: NULL deref

Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-03-29 15:23:56 -07:00
Florin Coras
f3a3bad800 ip6: fix ip6-local urpf checking
Use sw_if_index[VLIB_TX] if set as fib index when doing the urpf check.

Change-Id: I5ec3e7f7a54c6782704d91e9a5614fd0f7f9e3de
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-29 19:26:49 +00:00
Eyal Bari
109139eed6 l2_input:optimize counter access
only one counter update per frame (was updated per iteration)
only access ethertype for casts (was always accessing ethertype)

Change-Id: I3a3c3219ec63e975cf5bd8cf2d93103932a4aaa3
Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-03-29 15:14:48 +00:00
Florin Coras
56b39f6a9e tcp: fix fib index buffer tagging
Change-Id: I373cc252df3621d44879b8eca70aed17d7752a2a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-29 11:23:58 +00:00
Dave Barach
cc5677b496 No need for this routine to be global
Causes subtle misbehavior elsewhere

Change-Id: I3a0ade26e8e03b8c5dc8e722f6a01fb99ec7a1e0
Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-29 08:10:53 +00:00
Mohsin Kazmi
691abf6f33 vom: Fix the error handling for already existing itf
Change-Id: I5695d51dd4f6daff472877fe1cce3ddcb924b187
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-28 17:25:23 +02:00
Damjan Marion
23d4e8a6b5 Build libmemif as part of verify job
Change-Id: I7e808b5bcbb74343a4ed6782f115ed07e9bfe3a6
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-28 13:41:15 +00:00
Steven
b3caf55730 bond: cli rename
rename "enslave interface <slave> to <BondEthernetx>" to
"bond add <BondEthernetx> <slave>

"detach interface <slave>" to
"bond del <slave>"

Change-Id: I1bf8f017517b1f8a823127c7efedd3766e45cd5b
Signed-off-by: Steven <sluong@cisco.com>
2018-03-28 13:40:27 +00:00
Marco Varlese
e17bb715cf SCTP: use custom fib
Following TCP fixes from Florin (11430), this patch follows the same
approach to indicate a fib (not just using the default one).

Change-Id: Ib883aa0e9a1c6157acfea69c44426ba07d6c932a
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-28 13:40:04 +00:00
Jakub Grajciar
ab7c2b012d libmemif: add private header size field
Change-Id: I09567c8ee9c92e91918840f80942a005069d9842
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-28 13:35:40 +00:00
Matus Fabian
ea2600ae6a NAT44: make 1:1NAT for DHCP addressed interface persistent
Static mapping is not deleted from resolution vector after address is set on
interface.

Change-Id: Ib7c45ca2e307123d101248c5a1b17d130ac32cd0
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-28 04:20:21 -07:00
Neale Ranns
f0404e9fb6 test: fix VppNeighbor.query_vpp_config
Change-Id: I2a879ee9d5065a14eb351eccd0350693eb1ff521
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-03-28 08:10:59 +00:00
Damjan Marion
d4ac4bb266 avf: keep input node in disabled state unless needed
Change-Id: I9a0105aa2373bd4db218851b1bbee50c6b6dfc7d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-28 08:09:02 +00:00
Matus Fabian
4888b50bb4 NAT44: fix nat44_user_session_dump and nat44_del_session crash with one worker (VPP-1213)
Change-Id: I8e0c7ed2ff462b9ab59c233f56be262ec03c29ff
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-28 07:05:24 +00:00
Eyal Bari
aa0180b9e0 vxlan:refactor add del command function
Change-Id: I33ba5a011100baf1c786f9a63a0cf3d2e1020493
Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-03-27 20:48:29 +00:00
Damjan Marion
2d207bcde2 vlib: gcc-7 -O3 uninitialized values
Change-Id: I59b4142daab439d60a1ebd48b2c1366df0160288
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-27 20:15:54 +00:00
Damjan Marion
be3f4d5a30 vlib: make cloned structures cacheline aligned
This address crash with gcc-7 observed when -o3 is used.

Change-Id: I10e87da8e5037ad480eba7fb0aaa9a657d3bf48d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-27 21:06:21 +02:00
Andrew Yourtchenko
82f2e6e50d acl-plugin: autosize the ACL plugin heap and fix the heap size types and parsing
- autosize the ACL plugin heap size based on the number of workers
- for manual heap size setting, use the proper types (uword),
  and proper format/unformat functions (unformat_memory_size)

Change-Id: I7c46134e949862a0abc9087d7232402fc5a95ad8
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-27 17:43:37 +00:00
Neale Ranns
f756401ddd VOM: Fix connection state
Change-Id: I4851b2245f81bcf3cf5f40909c4d158a51af7068
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-03-27 09:19:04 -07:00
Damjan Marion
d50c987ead memif: add private header size field
private header size allows to reserve firs X bytes of payload to be
considered as private metadata. For now we just support value 0
but adding this field to address future needs without changing protocol
version.

Change-Id: Id77336584c0194a303b20210aff584c7372cba01
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-27 16:04:23 +00:00
Steven
18c0f229ce bond: coverity woes
coverity complains about statements in function A

function A
{
   x % vec_len (y)
}

because vec_len (y) is a macro and may return 0 if the pointer y is null.
But coverity fails to realize the same statement vec_len (y) was already
invoked and checked in the caller of function A and punt if vec_len (y) is 0.

We can fix the coverity warning and shave off a few cpu cycles by caching
the result of vec_len (y) and pass it around to avoid calling vec_len (y)
again in multiple places.

Change-Id: I095166373abd3af3859646f860ee97c52f12fb50
Signed-off-by: Steven <sluong@cisco.com>
2018-03-27 16:03:59 +00:00
Mohsin Kazmi
ed76ee24df VOM: bond: Add support for LACP
Change-Id: I0245263b212142858d3305b0f365d8342912dbb9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-27 15:44:19 +00:00
Dave Wallace
de91006803 VCL: add IPv6 to socket_test.sh and make test
Change-Id: If3827828062a46f1cce43642535333f677f06e62
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-26 21:56:16 +00:00
Szymon Sliwa
0a15e8c3b6 plugins: dpdk: ipsec: fix l3 offset
Changes the source of the l3 offset to a more
proper one, same as I5d9f41599ba8d8eb14ce2d9d523f82ea6e0fd10d.

Change-Id: I5ff05d7d89507ecb378a2bd62f5b149189ca9e99
Signed-off-by: Szymon Sliwa <szs@semihalf.com>
2018-03-26 20:14:03 +00:00
Neale Ranns
abcf3ea674 Restore the brief FIB entry printing
Change-Id: I007d48aeb934e5d2f087ca3b8ddc6f7a0e48d411
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-26 20:06:45 +00:00
Damjan Marion
20ba16461c vlib: add support for vfio no-iommu mode
Change-Id: Ic83971d8d9d8d0bb90a35932e60761cd728457f3
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26 20:00:05 +00:00
Mohsin Kazmi
43fc6884b5 afpacket: Fix the reply if itf already exits
Change-Id: I47768ea50140222fec54e97cbaff2049bd3cb599
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-26 17:29:06 +00:00
Damjan Marion
74a6dab687 Disable -Waddress-of-packed-member warnings reported by clang
Change-Id: Ic07ea5b0a7addec7b0ccfbe0570f341056e6d55b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26 13:26:00 +00:00
Andrew Yourtchenko
e1e995db55 acl-plugin: defer the ACL plugin user module registration with ACL lookup until it is needed
Registering ACL plugin user module within the "ACL as a service" infra during the plugin init
causes an unnecesary ACL heap allocation and prevents the changing of the ACL heap size
from the startup config.

Defer this registration until just before it is needed - i.e. when applying an ACL to
an interface.

Change-Id: Ied79967596b3b76d6630f136c998e59f8cdad962
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-26 12:55:57 +00:00
Mohsin Kazmi
06bc26077c plugin: Add plugin 'default' disable/enable
How to use:
  plugins
  {
    plugin default {disable}
    plugin dpdk_plugin.so {enable}
    plugin acl_plugin.so {enable}
  }

It also preserves the old behavior.

Change-Id: I9901c56d82ec4410e69c917992b78052aa6a99e0
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-26 12:18:30 +00:00
Jakub Grajciar
ecfa2aaa63 libmemif: version 2
Change-Id: Ia2532695aa9199d2a7b684aebef43df0b8235531
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-03-26 12:01:49 +00:00
Damjan Marion
b4ff07a2f8 Intel Adaptive Virtual Function native device driver plugin
Change-Id: If168a9c54baaa516ecbe78de2141f11c17aa2f53
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26 12:39:36 +02:00
Florin Coras
f6647e0f36 session: fix local session disconnects
Select the right segment manager for local sessions established via
global table.

Change-Id: I88ad4bf70d0cae160a0c744950098a954dfbc911
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-25 21:22:41 +00:00
Klement Sekera
e1ace19b65 make test: fix DEBUG=gdb/gdbserver options
Change-Id: I5a7fa3b1c247ad5611907db27835724dcd31f575
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:20:41 +00:00
Klement Sekera
b6866046df make test: fix ext build on centos
Change-Id: I2b01f73c4b10a230310a65b6f35526818bf4f76d
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:20:29 +00:00
Klement Sekera
3d6edf5a96 make test: use vpp-dev repo for py-lispnetworking
Change-Id: Ia87d55cad1d466a4cc624f06abbc322cddb5608c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:20:11 +00:00
Klement Sekera
8432e6e6f7 allow specifying number of concurrent jobs
If defined, Use MAKE_PARALLEL_JOBS as number of concurrent jobs for
build process instead of the internal calculation based on /proc/cpuinfo.

Change-Id: I18d1f526dc5c156c1cd9c9cf6dbbfd9cb8dbbad7
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:19:07 +00:00
Klement Sekera
9b6ece7952 make test: enhance core-file information
Change-Id: I1283960a9a49f6d70b9d7b7793cfb345c22ccdea
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:17:30 +00:00