Compare commits

...

58 Commits

Author SHA1 Message Date
3a0d8536de fix packets redirect ineffective on af-packet interface
Change-Id: Ibdc03c4c79632a61c5f36b8e907ec2bd7ebb0dc7
Signed-off-by: chenxiang <chenxndsc@163.com>
2018-10-01 09:55:13 +00:00
ca7a68e0fb gcc8 and Wstringop-truncation
gcc8 introduced a new warning (Wstringop-truncation) which in our case
is being treated as error.
Disabling the warning globally might introduce bugs related to string
truncation which are not desired by the developer (e.g. bug).
Instead, this patch disables the warning only for those occurences
which have been verified to be non-bugs but the desired behaviour as per
developer will.

Change-Id: I0f04ff6b4fad44061e80a65af633fd7e0148a0c5
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
(cherry picked from commit 99d7a72cbc)
2018-07-09 12:28:30 +00:00
6bb589c8ac node functions cannot be always_inline
Thanks to gcc-8 for highlighting this...

Change-Id: I53bfab631a40fd1b680c76a48b0307a33fa2b154
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 2574d9f41a)
2018-07-09 07:09:15 +00:00
a652002ffe IGMP: use simple u32 bit hash key
some IGMP hashse use only a u32 key, which is not stored in the object, so don't use memory based hash

Change-Id: Iaa4eddf568ea0164bc2a812da4cc502f1811b93c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-11 02:08:30 -04:00
98ee17424b Add reaper functions to want events APIs (VPP-1304)
Change-Id: Iaeb52d94cb6da63ee93af7c1cf2dade6046cba1d
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-10 19:27:56 -04:00
d9aa9ff03c BIER CLI show commands; no crash on non-existant objects (VPP-1303)
DBGvpp# sh bier disp entry
DBGvpp# sh bier disp entry 0
No such BIER disp entry: 0
DBGvpp# sh bier disp table
DBGvpp# sh bier disp table 0
No such BIER disp table: 0
DBGvpp# sh bier disp table 11
No such BIER disp table: 11
DBGvpp#

DBGvpp# sh bier bift
no BIFT entries
DBGvpp# sh bier bift set 0
no BIFT entries
DBGvpp# sh bier bift set 0 sd 0 bsl 0
no BIFT entries
DBGvpp#

DBGvpp# sh bier fib
No BIER tables
DBGvpp# sh bier fib 0
DBGvpp# sh bier fib 0 4

DBGvpp# sh bier fmask
DBGvpp# sh bier fmask 2
No BIER f-mask 2

DBGvpp# sh bier imp
DBGvpp# sh bier imp 0
No such BIER imposition: 0

Change-Id: Ibadac3441dd8a6d1b96bd9ee4358e28498875b95
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 8f6e321862)
2018-06-06 00:35:08 +00:00
2302d0dfa2 VPP-1286: close the fd after mmap-ing svm segments
Broken for years. Duh.

Change-Id: Ie5fb8e802f143aacd3301c45b136b24a8d4f6d74
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit ada24ea701)
2018-05-30 18:56:29 +00:00
2857b14e22 bond: performance harvesting [VPP-1298]
- hash is great. But it is a bit too slow for the DP. Use direct array indexing
to quickly retrieve the slave interface.
- the algorithm used by flow hash is great. But it is a bit too slow for the DP.
Use l2_hash_hash() extracted from lb_hash.h which ECMP is using. It makes use
of intrinsic crc32 instruction set.
- shortcut modulo arithmetic when the operand is 2**x (where x up to 4) to
avoid division instruction.
- special case for link count == 1 in bond_tx_fn()
- use clib_mem_unaligned to access data for the packet to avoid alignment error
- Fix some typos for packet tracing.

Change-Id: I8eae3ad497061c5473aa675ba894ee0211120d25
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 0d88301a57)
2018-05-30 05:09:13 +00:00
54908a2c2f Revert "Fix the alignment of IP4 Fib Tables (VPP-1280)"
This reverts commit 6a4b97a616.

subsequent commit 01b2c23fae added the same cache line alignment and resulted in a duplicate member causing a build failure.

Change-Id: I6208095afe0d5da2a85147e8f70c80035e49092e
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-29 21:16:59 -04:00
01b2c23fae 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>
2018-05-18 12:14:55 +00:00
6a4b97a616 Fix the alignment of IP4 Fib Tables (VPP-1280)
Change-Id: I63cedfac3dcb6dec380d02325eeebb1f35518309
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-18 08:16:10 +00:00
974a760a5e 18.01.2 Release Notes
Change-Id: I17ba98b48409d907081a0fd8d7db35adf45192ef
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-05-17 12:06:27 -04:00
adec5c44da 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>
(cherry picked from commit 7cb7bb3fa1)
2018-05-10 14:45:53 +00:00
8037694b7b opensuse: OS_ID field content changed for SUSE
Change-Id: Ie8d11769ff8ba53793293a7828ef21422cdacf57
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-05-08 16:02:50 +00:00
cc47c2d1d4 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>
2018-05-02 13:20:30 +00:00
c9b6ec7f59 Add reference to 18.04 test framework documentation
Change-Id: I0f24e0f0fde0568161edf52f40c5b83877ed7130
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-04-30 10:00:20 -04:00
fe80b9f064 TAP memory leaks:
1 - use bit-map to re-use ID values and thus VLIB nodes
2 - free vrings
3 - free hw_address on HW interface delete (a HW * struct is memset on pool_get)
4 - free temporary node names during TX node setup

Change-Id: Id114c8bb9c844fd4ceb02fbbeb4b511ecfeb61ce
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-27 09:23:18 -04:00
ac2b7363f4 VPP 18.04 release notes
- Notes for the 18.04 release
- Fixes for table layout of previous API summary
- Update list_api_changes.py script

Change-Id: Id99ed4df2e76e2704f949ee940eedf9ede7e8f4b
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-04-25 10:41:03 -04:00
516d63ff2c span: crash in span_mirror [VPP-1254]
It is possible for span-input to get call with sw_if_index which is greater than
sm->interfaces and crashes in span_mirror () in the following line

  span_interface_t *si0 = vec_elt_at_index (sm->interfaces, sw_if_index0);

For example, span-input mirrors a main interface as source, it may actually get
call for traffic coming in from the subinterface and crashes.

The fix is simply to check if sw_if_index >= vec_len (sm->interfaces) and
punt if it is.

Change-Id: I8312eb321d638518e14ba2326fffd1a7919646ca
Signed-off-by: Steven <sluong@cisco.com>
2018-04-24 22:47:44 -07:00
6e4f40b6a9 memory leak
obvious leak of parent_indices

Change-Id: I572b33de1756c8062a87c754117d990622fe12fe
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-04-24 18:04:55 +00:00
df53f5fda2 mem-leak in stats handling (VPP-1250)
Change-Id: I55f978c84a56bc089e5657c528195b6c84409364
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-04-24 11:01:29 +00:00
42c6599bf3 lacp: deleting the bond subinterface may cause lacp to lose the partner [VPP-1251]
Problem:
When the bond subinterface is removed, it was observed that we lost the lacp
partner. Show hardware shows rx counter goes up, but show interface does not
for the slave interfaces.

Cause:
We reset the interface promiscuous mode when the bond subinterface is deleted.
This causes dpdk not to accept any packet. Leave the interface in promiscuous
mode fixes the problem.

Other fixes:
There are few places we use hw_if_index as if they are sw_if_index. But they
don't necessarily have the same value. As soon as a subinterface is created,
they start to diverge. The fix is to use the correct API for the hw_if_index
and sw_if_index.

Change-Id: I1e6b8bca0a4aae396d217a141271cbf968500c91
Signed-off-by: Steven <sluong@cisco.com>
2018-04-24 10:59:37 +00:00
b0a517b6c8 Script to list patches that changed api files.
- Add Ole Troan's script from vpp-dev email:
  https://lists.fd.io/pipermail/vpp-dev/2017-October/007037.html

Change-Id: I0cbf5118169dc25f0edd659a5a9f5cde8619f780
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-04-23 23:08:27 -04:00
d216301e4a DPDK: CVE-2018-1059
For further details, please see
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1059

Change-Id: Icd207f129e5fdcc3d9d8ad56ba5a368926f2804d
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-04-24 01:40:25 +00:00
0c63d82e99 lacp: partner may time us out if fast-rate is configured [VPP-1247]
We should be sending LACP PDU every second if the partner has LACP_TIMEOUT flag
set which means it will time us out in 3 seconds.

Add interface name for lacp trace

Change-Id: If7d816c062d03e80cc0dd7d10dba0b76ace0664a
Signed-off-by: Steven <sluong@cisco.com>
2018-04-23 14:51:47 +00:00
fd2e376521 acl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included in more than one C file
Including the exports.h from multiple .c files belonging to a single plugin results in an error.

Fix that by making all the exported function pointers static, so every place
which includes the exports.h gets its own copy of function pointers.
This will also require to call separately the acl_plugin_exports_init() per file
to initialize them.

Change-Id: Icb70695efa23579c46c716944838766cebc8573e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-04-20 10:55:24 +02:00
774bfc36bb dpdk: resurrect removed code [VPP-1245]
https://gerrit.fd.io/r/#/c/7701/ accidentally removed 3 lines of code in
dpdk/device/init.c which were added by https://gerrit.fd.io/r/#/c/7826/

case VNET_DPDK_PMD_VHOST_ETHER:
xd->port_type = VNET_DPDK_PORT_TYPE_VHOST_ETHER;
break;

Those lines were needed to recognize vhost-user interface which is created
via vdev command in dpdk and display VhostEthernet. Without them,
UnknownEthernet is displayed.

Change-Id: I6d7ee6aecc6a415fbb7308595d515649475bcd5f
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 684d08c7e5)
2018-04-18 18:19:39 +00:00
b3caf66be9 SCTP: coverity scan warnings
This patch addresses 182346, 182347, 182353.

Change-Id: I59c3d74bd3a2122b836c93e22ddb632fa032f7fe
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
(cherry picked from commit 216c35b2c6)
2018-04-18 17:56:43 +00:00
8579a389fc SCTP: coverity warnings
This patch addresses the warning 182994

Change-Id: I071f3cbdf9965c7b57d444f79430ee75c66c856e
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-04-18 15:32:42 +00:00
6cdad6d8ff Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'
Change-Id: I994649761fe2e66e12ae0e49a84fb1d0a966ddfb
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 756cd94417)
2018-04-18 14:23:57 +00:00
332e0440a5 vhost: show vhost-user <interface> may crash [VPP-1242]
show vhost-user <interface> may cause a crash if interface is semi-bogus.
Semi-bogus means it is a known vpp interface which has a hw_if_index, but
it is bogus because it is not a vhost-user interface.

The fix is to add a check to reject non vhost-user interface for the
command.

Change-Id: I63f1e8bfbf46f5ec4c30f9fb3546982b63cd7cc5
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 583f158b44)
2018-04-17 18:30:25 +00:00
88c50b7d4b VPP-1243: fix reassembly CLI
Change-Id: Ie20aaf0eb1a5a338a54f0de4d6da661431be5163
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-17 18:07:25 +02:00
18bde8a579 acl-plugin: VPP-1241: fix the "show acl-plugin tables applied" output
It is a relatively rarely used low level command for code that didn't change,
but due to infra changes it did not survive. Having it working may be very
useful for corner-case debugging. So, fix it for working with
the acl-as-a-service infra.

Change-Id: I11b60e0c78591cc340b043ec240f0311ea1eb2f9
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-04-17 11:40:54 +02:00
bce5e88843 Makefile: Removed clang build from verify
Removed clang build from main verify since that will be driven
in a seperate job going forward

Change-Id: I6efcad0b99fcc6babc4a7eb1475c99816f2cf175
Signed-off-by: Ed Kern <ejk@cisco.com>
2018-04-16 15:16:42 +00:00
27820fd3f0 CSIT-895 dpdk/ipsec: add locks on session data hash updates
Change-Id: I6400b77de388c01e85209e5dc5f11ccafb79a459
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
(cherry picked from commit 5aaea1186e)
2018-04-16 08:39:45 +00:00
743ff8430a bond: ping fails between l2 BD [VPP-1238]
In dpdk based bonding, when the bond interface is configured for l2,
it automatically sets the bond interface to promiscuous mode and sets rx
redirect to ethernet-input. This allows traffic to be bridged to
non compute node facing interface when it is received from the compute
node interface.

For native vpp bonding, we need to do similar things. When the bond interface
is configured for l2, we set the slave interfaces to promiscuous mode
and set rx redirect to ethernet-input because dpdk does not know anything
about the bond interface. Likewise, when a new interface is enslaved, we also
need to do the same thing if the bond interface has already been configured
for l2.

Change-Id: I7e168008e8a4221be74929b2a20e6db0ce8f3110
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 4f8863b214)
2018-04-13 20:02:14 +00:00
a45bdcaceb VOM: Add sub_interface in specific routing table
Change-Id: I3700fc1d140e30da783e41762670618f0298c7db
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 1e583111eb)
2018-04-13 16:15:52 +00:00
1d328abbe9 NAT66: Do not translate if packet not aimed at outside interface
Change-Id: Id5a2a90d81cc9cb87cb6fb89ac2f4ca3cbcb51e2
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
(cherry picked from commit 9341e34b50)
2018-04-13 15:40:44 +00:00
1af3389118 vom: Fix the itf stats replay
Change-Id: Iedc6bbaa1c0a1c3c6e1b8ed6d67db28046a551f4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 58c711a196)
2018-04-13 14:33:51 +00:00
6fc740bbdd VOM: Get vhost-user type from name
Adopt nova naming convention for vhost-user interfaces.

Change-Id: If70f0828106bf594eb11d4f0ed2898a35ec0af15
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 47cca9b0f2)
2018-04-13 13:29:55 +00:00
d3b96ef0d7 acl-plugin: VPP-1239: acl-as-a-service does not match IPv6 packets, works only in lookup context 0
In process of extracting the matching out of the ACL plugin internals,
a couple of pieces setting the miscellaneout fields in the 5tuple structure
did not make it, so they are initialized to zeroes. Move the assignments
to the right place to make both traffic acls and acl-as-a-service working.

Change-Id: I66a7540a13b05113b599f0541999a18fad60385d
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-04-13 13:41:21 +02:00
866c465697 bond: 1 packet/frame == bad performance [VPP-1236]
While https://gerrit.fd.io/r/#/c/11316/ took care of 1 packet/frame for
most of the bonding modes, it missed the broadcast mode. This patch is
to fix the 1 packet/frame for the broadcast mode.

Change-Id: Iac48a2977c7f702f341479cc712a6448090dbc60
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 22b5be06fa)
2018-04-13 02:42:27 +00:00
27669ac245 VPPAPIGEN: Consistent CRC32 on complete file.
Prior to this fix vppapigen would just do a crc32 on the Python representation
of the file as a set of dictionaries. That of course was not a good idea.

Change-Id: Ie454736ffec02fa4679ab27e684b1d6c6406a0f1
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit 17225df81b)
2018-04-11 22:03:59 +00:00
18744ee680 DVR: save the rewrite length in packet meta-data for features
Change-Id: I0efd03bdb84bc9ff2334d398bfdb82486228114a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit 7bf3f9f70e)
2018-04-11 19:17:03 +00:00
1a2b9e6d73 L2: no-flood interface type in the Bridge-Domain
Change-Id: I50ff0cacf88182f8e0be19840c50f4954de586e2
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit 87dad11c87)
2018-04-11 14:59:16 +00:00
70e1ae2659 Change l2-fwd node to allow possible feature before UU-FLOOD
If l2-fwd node does not find an L2FIB entry for DMAC of packet,
use input feature bitmap to find next node instead of always
sending packet to l2-flood node to perform unknow unicast flood.
It provides possibilty of using other feature to forward unknow
unicast packet instead of flooding the BD.

Change-Id: I56b277050537678c92bd548d96d87cadc8d2e287
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit 9a719298c3)
2018-04-10 22:42:35 +00:00
9c4ae7f6d0 test: Fix issues with new version of pycodestyle (VPP-1232)
- Ignore warnings W504 (newline after binary operator) which otherwise
  occurs a significant number of times.
- Fix two instances of lines >79 chars.

Change-Id: I8cef56f8afc237187995e638e610c8c0554e2bb5
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-04-10 15:19:54 -04:00
1286a15a6e acl-plugin: VPP-1230: fix the "undefined symbol" error for acl_main when using the inline functions
The acl_main struct, which is defined in the acl_plugin, is not visible when
the ACL plugin inline code is being compiled within the context of other plugins.
Fix that by using the global pointer variable, which exists in both the ACL plugin
context and is set in the context of the external plugins using ACL plugin.

Change-Id: Iaa74dd8cf36ff5442a06a25c5c968722116bddf8
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-04-10 12:45:57 +00:00
e5cbccf35f acl-plugin: VPP-1231: add error checking to acl_plugin_set_acl_vec_for_context
The users of ACL lookup contexts might not check the data they supply,
so do it on their behalf in this function, and return an error if
an ACL does not exist or if they attempt to apply the same ACL twice.

Change-Id: I89d871e60f267ce643f88574c83baf9cd0a2d7b3
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-04-10 10:32:57 +00:00
45d9ba1b32 NAT44: don't add static mapping to resolution vector if failed (VPP-1225)
Change-Id: I71660eb327124179ff200763c4743cc81dc6e1c6
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit f13a878736)
2018-04-10 04:13:39 +00:00
c1a30f61ec memif: bug fixes
Change-Id: Id775efb2e85d850e510d00f1b48bb711a3342397
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-09 15:34:04 +00:00
405b0732e1 IPIP: version.h is not needed
Change-Id: I78a4176f98c2b4630a57ac5ddb7faf58ba0c4ee1
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-09 15:33:19 +00:00
52e947dfae make test: fix failure on centos
Change-Id: I1fcc742699a60ef99ce97b35f7b964ee6ad29ddf
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-09 16:04:18 +02:00
decc3c52d7 Restore building of debuginfo RPMs
JIRA: VPP-1227

Remove rpm tmp dir build debuginfo rpms.
Reverses commits to fix a build problem with old versions of rpmbuild
that prevented builds in chrooted environments with short paths
and short project names.

Change-Id: I852696dccc984bf4882fd3ca9ec4c8da080bdb41
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-04-08 13:34:41 +00:00
88f0a3d930 BIER coveroty fix for unintialised return value on error
Change-Id: I2b1d1035f810cb58356626cf081d46eb289265b4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-07 21:05:59 +00:00
24c3733f1f Remove mbedtls from build requirement for Centos
JIRA: VPP-1228

Although mbedtls is in Fedora and Epel, it is not
in Centos yet. It is not strictly necessary for TLS
which also can use openssl.

Change-Id: Id62d52000f9ecda2fc10d1938f02be1142fa5bdb
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
(cherry picked from commit 5f56c091ce)
2018-04-07 21:03:31 +00:00
ca3c508401 Remove subunit from Centos requirements.
JIRA: VPP-1229

Subunit and Subunit-devel in Fedora and Epel but not Centos.
This patch moves the Fedora from the Centos specific requirements.

Change-Id: I093a4571cddf14af5ee2827ba8ee00c7bcbe6fc0
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-04-07 17:14:45 +00:00
7ace56b9d8 Setup for branch stable/1804
Change-Id: I4747aab1610e7c6f2efdab3452383d4326eca41f
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-04-04 14:32:51 -04:00
189 changed files with 3510 additions and 1074 deletions

View File

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

View File

@ -84,19 +84,21 @@ RPM_DEPENDS += apr-devel
RPM_DEPENDS += numactl-devel
RPM_DEPENDS += check check-devel
RPM_DEPENDS += boost boost-devel
RPM_DEPENDS += subunit subunit-devel
RPM_DEPENDS += selinux-policy selinux-policy-devel
RPM_DEPENDS += mbedtls-devel
ifeq ($(OS_ID)-$(OS_VERSION_ID),fedora-25)
RPM_DEPENDS += subunit subunit-devel
RPM_DEPENDS += openssl-devel
RPM_DEPENDS += python-devel python2-ply
RPM_DEPENDS += python2-virtualenv
RPM_DEPENDS += mbedtls-devel
RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
else ifeq ($(shell if [ "$(OS_ID)" = "fedora" ]; then test $(OS_VERSION_ID) -gt 25; echo $$?; fi),0)
RPM_DEPENDS += subunit subunit-devel
RPM_DEPENDS += compat-openssl10-devel
RPM_DEPENDS += python2-devel python2-ply
RPM_DEPENDS += python2-virtualenv
RPM_DEPENDS += mbedtls-devel
RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
else
RPM_DEPENDS += openssl-devel
@ -507,13 +509,6 @@ endef
verify: install-dep $(BR)/.deps.ok dpdk-install-dev
$(call banner,"Building for PLATFORM=vpp using gcc")
@make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
$(call banner,"Installing dependencies")
@sudo -E apt-get update
@sudo -E apt-get $(CONFIRM) $(FORCE) install clang
$(call banner,"Building for PLATFORM=vpp using clang")
@make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
endif
$(call banner,"Building sample-plugin")
@make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
$(call banner,"Building libmemif")

View File

@ -24,28 +24,28 @@ Details of the changes leading up to this version of VPP can be found under
## Directory layout
Directory name | Description
---------------------- | -------------------------------------------
build-data | Build metadata
build-root | Build output directory
doxygen | Documentation generator configuration
dpdk | DPDK patches and build infrastructure
@ref extras/libmemif | Client library for memif
@ref src/examples | VPP example code
@ref src/plugins | VPP bundled plugins directory
@ref src/svm | Shared virtual memory allocation library
src/tests | Standalone tests (not part of test harness)
src/vat | VPP API test program
@ref src/vlib | VPP application library
@ref src/vlibapi | VPP API library
@ref src/vlibmemory | VPP Memory management
@ref src/vlibsocket | VPP Socket I/O
@ref src/vnet | VPP networking
@ref src/vpp | VPP application
@ref src/vpp-api | VPP application API bindings
@ref src/vppinfra | VPP core library
@ref src/vpp/api | Not-yet-relocated API bindings
test | Unit tests and Python test harness
| Directory name | Description |
| ---------------------- | ------------------------------------------- |
| build-data | Build metadata |
| build-root | Build output directory |
| doxygen | Documentation generator configuration |
| dpdk | DPDK patches and build infrastructure |
| @ref extras/libmemif | Client library for memif |
| @ref src/examples | VPP example code |
| @ref src/plugins | VPP bundled plugins directory |
| @ref src/svm | Shared virtual memory allocation library |
| src/tests | Standalone tests (not part of test harness) |
| src/vat | VPP API test program |
| @ref src/vlib | VPP application library |
| @ref src/vlibapi | VPP API library |
| @ref src/vlibmemory | VPP Memory management |
| @ref src/vlibsocket | VPP Socket I/O |
| @ref src/vnet | VPP networking |
| @ref src/vpp | VPP application |
| @ref src/vpp-api | VPP application API bindings |
| @ref src/vppinfra | VPP core library |
| @ref src/vpp/api | Not-yet-relocated API bindings |
| test | Unit tests and Python test harness |
## Getting started

1994
RELEASE.md

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,10 @@
Test Framework Documentation {#test_framework_doc}
============================
PyDoc generated documentation for the "make test" framework is available for the following releases
PyDoc generated documentation for the "make test" framework is available for
the following releases:
- [Test framework documentation for VPP 18.04](https://docs.fd.io/vpp/18.04/vpp_make_test/html)
- [Test framework documentation for VPP 18.01](https://docs.fd.io/vpp/18.01/vpp_make_test/html)
- [Test framework documentation for VPP 17.10](https://docs.fd.io/vpp/17.10/vpp_make_test/html)
- [Test framework documentation for VPP 17.04](https://docs.fd.io/vpp/17.04/vpp_make_test/html)

View File

@ -25,14 +25,14 @@ DPDK_MLX5_PMD ?= n
B := $(DPDK_BUILD_DIR)
I := $(DPDK_INSTALL_DIR)
DPDK_VERSION ?= 18.02
DPDK_VERSION ?= 18.02.1
PKG_SUFFIX ?= vpp1
DPDK_BASE_URL ?= http://fast.dpdk.org/rel
DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz
DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL)
DPDK_17.11_TARBALL_MD5_CKSUM := 53ee9e054a8797c9e67ffa0eb5d0c701
DPDK_18.02_TARBALL_MD5_CKSUM := ca13077a014a2102c6e10153dfa3b920
DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION)
DPDK_18.02.1_TARBALL_MD5_CKSUM := 3bbb5468f662e1f7472d4abc5c4cf08e
DPDK_SOURCE := $(B)/dpdk-stable-$(DPDK_VERSION)
MACHINE=$(shell uname -m)
NASM_BASE_URL := http://www.nasm.us/pub/nasm/releasebuilds

View File

@ -3,8 +3,7 @@
%define _vpp_build_dir build-tool-native
%define _unitdir /lib/systemd/system
%define _builddir %{_topdir}
%define _tmp_build_dir %{name}-%{_version}.0
%define _mu_build_dir %{_topdir}/%{_tmp_build_dir}/build-root
%define _mu_build_dir %{_topdir}/%{name}-%{_version}/build-root
%define _vpp_tag %{getenv:TAG}
%if "%{_vpp_tag}" == ""
%define _vpp_tag vpp
@ -50,14 +49,17 @@ Release: %{_release}
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python
BuildRequires: systemd, chrpath
BuildRequires: check, check-devel
BuildRequires: subunit, subunit-devel
%if 0%{?fedora} >= 26
BuildRequires: subunit, subunit-devel
BuildRequires: compat-openssl10-devel
BuildRequires: python2-devel, python2-virtualenv
BuildRequires: mbedtls-devel
%else
%if 0%{?fedora} == 25
BuildRequires: subunit, subunit-devel
BuildRequires: openssl-devel
BuildRequires: python-devel, python2-virtualenv
BuildRequires: mbedtls-devel
%else
BuildREquires: openssl-devel
BuildRequires: python-devel, python-virtualenv
@ -70,7 +72,6 @@ BuildRequires: numactl-devel
BuildRequires: autoconf automake libtool byacc bison flex
BuildRequires: boost boost-devel
BuildRequires: selinux-policy selinux-policy-devel
BuildRequires: mbedtls-devel
Source: %{name}-%{_version}-%{_release}.tar.xz
# Source: vpp-latest.tar.xz
@ -149,20 +150,13 @@ Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targ
This package contains a tailored VPP SELinux policy
%prep
# Unpack into dir with longer name as work around of debugedit bug in in rpm-build 4.13
rm -rf %{name}-%{_version}
rm -rf %{_tmp_build_dir}
/usr/bin/xz -dc '%{_sourcedir}/%{name}-%{_version}-%{_release}.tar.xz' | /usr/bin/tar -xf -
mv %{name}-%{_version} %{_tmp_build_dir}
cd '%{_tmp_build_dir}'
/usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
%setup -q -n %{name}-%{_version}
%pre
# Add the vpp group
groupadd -f -r vpp
%build
cd '%{_tmp_build_dir}'
%if %{with aesni}
make bootstrap
make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages

View File

@ -0,0 +1,33 @@
#!/usr/bin/env python
import os, fnmatch, subprocess
starttag = 'v18.04-rc0'
endtag = 'v18.04-rc2'
emit_md = True
apifiles = []
for root, dirnames, filenames in os.walk('.'):
for filename in fnmatch.filter(filenames, '*.api'):
apifiles.append(os.path.join(root, filename))
for f in apifiles:
commits = subprocess.check_output(['git', 'log',
'--oneline', starttag + '..' + endtag,
f])
if commits:
if f[0:2] == './':
f = f[2:]
if emit_md:
print "| @c %s ||" % f
print "| ------- | ------- |"
for line in commits.splitlines():
parts = line.strip().split()
commit = parts[0]
message = " ".join(parts[1:]).replace("|", "\|")
print "| [%s](https://gerrit.fd.io/r/gitweb?" \
"p=vpp.git;a=commit;h=%s) | %s |" % (
commit, commit, message)
print
else:
print f
print commits

View File

@ -54,6 +54,7 @@
#include "public_inlines.h"
acl_main_t acl_main;
acl_main_t *p_acl_main = &acl_main;
#define REPLY_MSG_ID_BASE am->msg_id_base
#include <vlibapi/api_helper_macros.h>
@ -1346,7 +1347,6 @@ acl_interface_set_inout_acl_list (acl_main_t * am, u32 sw_if_index,
lc_index =
acl_plugin_get_lookup_context_index (am->interface_acl_user_id,
sw_if_index, is_input);
ASSERT (lc_index >= 0);
(*pinout_lc_index_by_sw_if_index)[sw_if_index] = lc_index;
}
acl_plugin_set_acl_vec_for_context (lc_index, vec_acl_list_index);
@ -3936,7 +3936,7 @@ acl_show_aclplugin_tables_fn (vlib_main_t * vm,
clib_error_t *error = 0;
u32 acl_index = ~0;
u32 sw_if_index = ~0;
u32 lc_index = ~0;
int show_acl_hash_info = 0;
int show_applied_info = 0;
int show_mask_type = 0;
@ -3953,7 +3953,7 @@ acl_show_aclplugin_tables_fn (vlib_main_t * vm,
else if (unformat (input, "applied"))
{
show_applied_info = 1;
unformat (input, "sw_if_index %u", &sw_if_index);
unformat (input, "lc_index %u", &lc_index);
}
else if (unformat (input, "mask"))
{
@ -3980,7 +3980,7 @@ acl_show_aclplugin_tables_fn (vlib_main_t * vm,
if (show_acl_hash_info)
acl_plugin_show_tables_acl_hash_info (acl_index);
if (show_applied_info)
acl_plugin_show_tables_applied_info (sw_if_index);
acl_plugin_show_tables_applied_info (lc_index);
if (show_bihash)
acl_plugin_show_tables_bihash (show_bihash_verbose);
@ -4049,7 +4049,7 @@ VLIB_CLI_COMMAND (aclplugin_show_sessions_command, static) = {
VLIB_CLI_COMMAND (aclplugin_show_tables_command, static) = {
.path = "show acl-plugin tables",
.short_help = "show acl-plugin tables [ acl [index N] | applied [ sw_if_index N ] | mask | hash [verbose N] ]",
.short_help = "show acl-plugin tables [ acl [index N] | applied [ lc_index N ] | mask | hash [verbose N] ]",
.function = acl_show_aclplugin_tables_fn,
};

View File

@ -101,6 +101,8 @@ typedef struct
*/
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
u8 tag[64];
u32 count;
acl_rule_t *rules;
@ -108,6 +110,8 @@ typedef struct
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
u8 tag[64];
u32 count;
macip_acl_rule_t *rules;
@ -127,6 +131,8 @@ typedef struct
*/
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
fa_5tuple_t mask;
u32 refcount;
} ace_mask_type_entry_t;
@ -362,6 +368,16 @@ AH has a special treatment of its length, it is in 32-bit words, not 64-bit word
extern acl_main_t acl_main;
/*
* pointer to the above.
* Needed for some gymnastics to be able to provide
* the inline functions from this plugin to other plugins.
* If the ACL_PLUGIN_EXTERNAL_EXPORTS is defined, then
* there is a static definition in public_exports.h - do not collide with that.
*/
#ifndef ACL_PLUGIN_EXTERNAL_EXPORTS
extern acl_main_t *p_acl_main;
#endif
void *acl_plugin_set_heap();

View File

@ -723,9 +723,7 @@ acl_fa_node_fn (vlib_main_t * vm,
acl_plugin_fill_5tuple_inline (lc_index0, b0, is_ip6, is_input, is_l2_path, (fa_5tuple_opaque_t *)&fa_5tuple);
fa_5tuple.l4.lsb_of_sw_if_index = sw_if_index0 & 0xffff;
fa_5tuple.pkt.lc_index = lc_index0;
valid_new_sess = acl_make_5tuple_session_key (am, is_input, is_ip6, sw_if_index0, &fa_5tuple, &kv_sess);
fa_5tuple.pkt.is_ip6 = is_ip6;
// XXDEL fa_5tuple.pkt.is_input = is_input;
fa_5tuple.pkt.mask_type_index_lsb = ~0;
#ifdef FA_NODE_VERBOSE_DEBUG

View File

@ -831,67 +831,42 @@ acl_plugin_print_pae (vlib_main_t * vm, int j, applied_hash_ace_entry_t * pae)
}
void
acl_plugin_show_tables_applied_info (u32 sw_if_index)
acl_plugin_show_tables_applied_info (u32 lc_index)
{
acl_main_t *am = &acl_main;
vlib_main_t *vm = am->vlib_main;
u32 swi; //, j;
vlib_cli_output (vm, "Applied lookup entries for interfaces");
u32 lci, j;
vlib_cli_output (vm, "Applied lookup entries for lookup contexts");
for (swi = 0;
(swi < vec_len (am->input_lc_index_by_sw_if_index))
|| (swi < vec_len (am->output_lc_index_by_sw_if_index)); swi++)
for (lci = 0;
(lci < vec_len(am->applied_hash_acl_info_by_lc_index)); lci++)
{
if ((sw_if_index != ~0) && (sw_if_index != swi))
if ((lc_index != ~0) && (lc_index != lci))
{
continue;
}
/*
vlib_cli_output (vm, "sw_if_index %d:", swi);
if (swi < vec_len (am->input_applied_hash_acl_info_by_sw_if_index))
vlib_cli_output (vm, "lc_index %d:", lci);
if (lci < vec_len (am->applied_hash_acl_info_by_lc_index))
{
applied_hash_acl_info_t *pal =
&am->input_applied_hash_acl_info_by_sw_if_index[swi];
vlib_cli_output (vm, " input lookup mask_type_index_bitmap: %U",
&am->applied_hash_acl_info_by_lc_index[lci];
vlib_cli_output (vm, " lookup mask_type_index_bitmap: %U",
format_bitmap_hex, pal->mask_type_index_bitmap);
vlib_cli_output (vm, " input applied acls: %U", format_vec32,
vlib_cli_output (vm, " applied acls: %U", format_vec32,
pal->applied_acls, "%d");
}
if (swi < vec_len (am->input_hash_entry_vec_by_sw_if_index))
if (lci < vec_len (am->hash_entry_vec_by_lc_index))
{
vlib_cli_output (vm, " input lookup applied entries:");
vlib_cli_output (vm, " lookup applied entries:");
for (j = 0;
j < vec_len (am->input_hash_entry_vec_by_sw_if_index[swi]);
j < vec_len (am->hash_entry_vec_by_lc_index[lci]);
j++)
{
acl_plugin_print_pae (vm, j,
&am->input_hash_entry_vec_by_sw_if_index
[swi][j]);
&am->hash_entry_vec_by_lc_index
[lci][j]);
}
}
if (swi < vec_len (am->output_applied_hash_acl_info_by_sw_if_index))
{
applied_hash_acl_info_t *pal =
&am->output_applied_hash_acl_info_by_sw_if_index[swi];
vlib_cli_output (vm, " output lookup mask_type_index_bitmap: %U",
format_bitmap_hex, pal->mask_type_index_bitmap);
vlib_cli_output (vm, " output applied acls: %U", format_vec32,
pal->applied_acls, "%d");
}
if (swi < vec_len (am->output_hash_entry_vec_by_sw_if_index))
{
vlib_cli_output (vm, " output lookup applied entries:");
for (j = 0;
j < vec_len (am->output_hash_entry_vec_by_sw_if_index[swi]);
j++)
{
acl_plugin_print_pae (vm, j,
&am->output_hash_entry_vec_by_sw_if_index
[swi][j]);
}
}
*/
}
}

View File

@ -201,6 +201,9 @@ void acl_plugin_put_lookup_context_index (u32 lc_index)
*/
int acl_plugin_set_acl_vec_for_context (u32 lc_index, u32 *acl_list)
{
int rv = 0;
uword *seen_acl_bitmap = 0;
u32 *pacln = 0;
acl_main_t *am = &acl_main;
acl_lookup_context_t *acontext;
if (am->trace_acl) {
@ -216,6 +219,25 @@ int acl_plugin_set_acl_vec_for_context (u32 lc_index, u32 *acl_list)
}
void *oldheap = acl_plugin_set_heap ();
vec_foreach (pacln, acl_list)
{
if (pool_is_free_index (am->acls, *pacln))
{
/* ACL is not defined. Can not apply */
clib_warning ("ERROR: ACL %d not defined", *pacln);
rv = VNET_API_ERROR_NO_SUCH_ENTRY;
goto done;
}
if (clib_bitmap_get (seen_acl_bitmap, *pacln))
{
/* ACL being applied twice within the list. error. */
clib_warning ("ERROR: ACL %d being applied twice", *pacln);
rv = VNET_API_ERROR_ENTRY_ALREADY_EXISTS;
goto done;
}
seen_acl_bitmap = clib_bitmap_set (seen_acl_bitmap, *pacln, 1);
}
acontext = pool_elt_at_index(am->acl_lookup_contexts, lc_index);
u32 *old_acl_vector = acontext->acl_indices;
acontext->acl_indices = vec_dup(acl_list);
@ -226,8 +248,11 @@ int acl_plugin_set_acl_vec_for_context (u32 lc_index, u32 *acl_list)
apply_acl_vec(lc_index, acontext->acl_indices);
vec_free(old_acl_vector);
done:
clib_bitmap_free (seen_acl_bitmap);
clib_mem_set_heap (oldheap);
return 0;
return rv;
}

View File

@ -26,7 +26,13 @@
/* check if a given ACL exists */
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
u8 (*acl_plugin_acl_exists) (u32 acl_index);
/*
* Define a pointer to the acl_main which will be filled during the initialization.
*/
static acl_main_t *p_acl_main = 0;
static u8 (*acl_plugin_acl_exists) (u32 acl_index);
#else
u8 acl_plugin_acl_exists (u32 acl_index);
#endif
@ -38,7 +44,7 @@ u8 acl_plugin_acl_exists (u32 acl_index);
*/
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
u32 (*acl_plugin_register_user_module) (char *caller_module_string, char *val1_label, char *val2_label);
static u32 (*acl_plugin_register_user_module) (char *caller_module_string, char *val1_label, char *val2_label);
#else
u32 acl_plugin_register_user_module (char *caller_module_string, char *val1_label, char *val2_label);
#endif
@ -50,7 +56,7 @@ u32 acl_plugin_register_user_module (char *caller_module_string, char *val1_labe
* of use within your module. They are useful for debugging.
*/
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
int (*acl_plugin_get_lookup_context_index) (u32 acl_user_id, u32 val1, u32 val2);
static int (*acl_plugin_get_lookup_context_index) (u32 acl_user_id, u32 val1, u32 val2);
#else
int acl_plugin_get_lookup_context_index (u32 acl_user_id, u32 val1, u32 val2);
#endif
@ -60,7 +66,7 @@ int acl_plugin_get_lookup_context_index (u32 acl_user_id, u32 val1, u32 val2);
* any asssociated data structures.
*/
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
void (*acl_plugin_put_lookup_context_index) (u32 lc_index);
static void (*acl_plugin_put_lookup_context_index) (u32 lc_index);
#else
void acl_plugin_put_lookup_context_index (u32 lc_index);
#endif
@ -70,7 +76,7 @@ void acl_plugin_put_lookup_context_index (u32 lc_index);
* Any existing list will be overwritten. acl_list is a vector.
*/
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
int (*acl_plugin_set_acl_vec_for_context) (u32 lc_index, u32 *acl_list);
static int (*acl_plugin_set_acl_vec_for_context) (u32 lc_index, u32 *acl_list);
#else
int acl_plugin_set_acl_vec_for_context (u32 lc_index, u32 *acl_list);
#endif
@ -78,7 +84,7 @@ int acl_plugin_set_acl_vec_for_context (u32 lc_index, u32 *acl_list);
/* Fill the 5-tuple from the packet */
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
void (*acl_plugin_fill_5tuple) (u32 lc_index, vlib_buffer_t * b0, int is_ip6, int is_input,
static void (*acl_plugin_fill_5tuple) (u32 lc_index, vlib_buffer_t * b0, int is_ip6, int is_input,
int is_l2_path, fa_5tuple_opaque_t * p5tuple_pkt);
#else
void acl_plugin_fill_5tuple (u32 lc_index, vlib_buffer_t * b0, int is_ip6, int is_input,
@ -96,7 +102,7 @@ void acl_plugin_fill_5tuple_inline (u32 lc_index, vlib_buffer_t * b0, int is_ip6
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
int (*acl_plugin_match_5tuple) (u32 lc_index,
static int (*acl_plugin_match_5tuple) (u32 lc_index,
fa_5tuple_opaque_t * pkt_5tuple,
int is_ip6, u8 * r_action,
u32 * r_acl_pos_p,
@ -128,18 +134,19 @@ acl_plugin_match_5tuple_inline (u32 lc_index,
#ifdef ACL_PLUGIN_EXTERNAL_EXPORTS
#define LOAD_SYMBOL_FROM_PLUGIN(p, s) \
#define LOAD_SYMBOL_FROM_PLUGIN_TO(p, s, st) \
({ \
s = vlib_get_plugin_symbol(p, #s); \
if (!s) \
st = vlib_get_plugin_symbol(p, #s); \
if (!st) \
return clib_error_return(0, \
"Plugin %s and/or symbol %s not found.", p, #s); \
})
#define LOAD_SYMBOL(s) LOAD_SYMBOL_FROM_PLUGIN("acl_plugin.so", s)
#define LOAD_SYMBOL(s) LOAD_SYMBOL_FROM_PLUGIN_TO("acl_plugin.so", s, s)
static inline clib_error_t * acl_plugin_exports_init (void)
{
LOAD_SYMBOL_FROM_PLUGIN_TO("acl_plugin.so", acl_main, p_acl_main);
LOAD_SYMBOL(acl_plugin_acl_exists);
LOAD_SYMBOL(acl_plugin_register_user_module);
LOAD_SYMBOL(acl_plugin_get_lookup_context_index);
@ -196,6 +203,7 @@ acl_fill_5tuple (acl_main_t * am, vlib_buffer_t * b0, int is_ip6,
/* Remainder of the key and per-packet non-key data */
p5tuple_pkt->kv.key[4] = 0;
p5tuple_pkt->kv.value = 0;
p5tuple_pkt->pkt.is_ip6 = is_ip6;
if (is_ip6)
{
@ -345,7 +353,7 @@ always_inline void
acl_plugin_fill_5tuple_inline (u32 lc_index, vlib_buffer_t * b0, int is_ip6,
int is_input, int is_l2_path, fa_5tuple_opaque_t * p5tuple_pkt)
{
acl_main_t *am = &acl_main;
acl_main_t *am = p_acl_main;
acl_fill_5tuple(am, b0, is_ip6, is_input, is_l2_path, (fa_5tuple_t *)p5tuple_pkt);
}
@ -528,7 +536,7 @@ acl_plugin_single_acl_match_5tuple (u32 acl_index, fa_5tuple_t * pkt_5tuple,
int is_ip6, u8 * r_action, u32 * r_acl_match_p,
u32 * r_rule_match_p, u32 * trace_bitmap)
{
acl_main_t * am = &acl_main;
acl_main_t * am = p_acl_main;
return single_acl_match_5tuple(am, acl_index, pkt_5tuple, is_ip6, r_action,
r_acl_match_p, r_rule_match_p, trace_bitmap);
}
@ -538,7 +546,7 @@ linear_multi_acl_match_5tuple (u32 lc_index, fa_5tuple_t * pkt_5tuple,
int is_ip6, u8 *r_action, u32 *acl_pos_p, u32 * acl_match_p,
u32 * rule_match_p, u32 * trace_bitmap)
{
acl_main_t *am = &acl_main;
acl_main_t *am = p_acl_main;
int i;
u32 *acl_vector;
u8 action = 0;
@ -691,7 +699,7 @@ hash_multi_acl_match_5tuple (u32 lc_index, fa_5tuple_t * pkt_5tuple,
int is_ip6, u8 *action, u32 *acl_pos_p, u32 * acl_match_p,
u32 * rule_match_p, u32 * trace_bitmap)
{
acl_main_t *am = &acl_main;
acl_main_t *am = p_acl_main;
applied_hash_ace_entry_t **applied_hash_aces = vec_elt_at_index(am->hash_entry_vec_by_lc_index, lc_index);
u32 match_index = multi_acl_match_get_applied_ace_index(am, pkt_5tuple);
if (match_index < vec_len((*applied_hash_aces))) {
@ -717,12 +725,14 @@ acl_plugin_match_5tuple_inline (u32 lc_index,
u32 * r_rule_match_p,
u32 * trace_bitmap)
{
acl_main_t *am = &acl_main;
acl_main_t *am = p_acl_main;
fa_5tuple_t * pkt_5tuple_internal = (fa_5tuple_t *)pkt_5tuple;
pkt_5tuple_internal->pkt.lc_index = lc_index;
if (am->use_hash_acl_matching) {
return hash_multi_acl_match_5tuple(lc_index, (fa_5tuple_t *)pkt_5tuple, is_ip6, r_action,
return hash_multi_acl_match_5tuple(lc_index, pkt_5tuple_internal, is_ip6, r_action,
r_acl_pos_p, r_acl_match_p, r_rule_match_p, trace_bitmap);
} else {
return linear_multi_acl_match_5tuple(lc_index, (fa_5tuple_t *)pkt_5tuple, is_ip6, r_action,
return linear_multi_acl_match_5tuple(lc_index, pkt_5tuple_internal, is_ip6, r_action,
r_acl_pos_p, r_acl_match_p, r_rule_match_p, trace_bitmap);
}
}

View File

@ -125,6 +125,9 @@ typedef uint16_t dpdk_portid_t;
typedef struct
{
/* Required for vec_validate_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
struct rte_ring *swq;
u64 hqos_field0_slabmask;
@ -141,6 +144,8 @@ typedef struct
typedef struct
{
/* Required for vec_validate_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
struct rte_ring **swq;
struct rte_mbuf **pkts_enq;
struct rte_mbuf **pkts_deq;

View File

@ -465,6 +465,10 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_VIRTIO_USER;
break;
case VNET_DPDK_PMD_VHOST_ETHER:
xd->port_type = VNET_DPDK_PORT_TYPE_VHOST_ETHER;
break;
default:
xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN;
}

View File

@ -330,12 +330,11 @@ create_sym_session (struct rte_cryptodev_sym_session **session,
struct rte_crypto_sym_xform *xfs;
struct rte_cryptodev_sym_session **s;
crypto_session_key_t key = { 0 };
clib_error_t *erorr = 0;
key.drv_id = res->drv_id;
key.sa_idx = sa_idx;
data = vec_elt_at_index (dcm->data, res->numa);
sa = pool_elt_at_index (im->sad, sa_idx);
if ((sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128) |
@ -362,6 +361,9 @@ create_sym_session (struct rte_cryptodev_sym_session **session,
}
}
data = vec_elt_at_index (dcm->data, res->numa);
clib_spinlock_lock_if_init (&data->lockp);
/*
* DPDK_VER >= 1708:
* Multiple worker/threads share the session for an SA
@ -375,7 +377,8 @@ create_sym_session (struct rte_cryptodev_sym_session **session,
if (!session[0])
{
data->session_h_failed += 1;
return clib_error_return (0, "failed to create session header");
erorr = clib_error_return (0, "failed to create session header");
goto done;
}
hash_set (data->session_by_sa_index, sa_idx, session[0]);
}
@ -391,13 +394,16 @@ create_sym_session (struct rte_cryptodev_sym_session **session,
if (ret)
{
data->session_drv_failed[res->drv_id] += 1;
return clib_error_return (0, "failed to init session for drv %u",
res->drv_id);
erorr = clib_error_return (0, "failed to init session for drv %u",
res->drv_id);
goto done;
}
hash_set (data->session_by_drv_id_and_sa_index, key.val, session[0]);
return 0;
done:
clib_spinlock_unlock_if_init (&data->lockp);
return erorr;
}
static void __attribute__ ((unused)) clear_and_free_obj (void *obj)
@ -509,34 +515,32 @@ add_del_sa_session (u32 sa_index, u8 is_add)
/* *INDENT-OFF* */
vec_foreach (data, dcm->data)
{
clib_spinlock_lock_if_init (&data->lockp);
val = hash_get (data->session_by_sa_index, sa_index);
s = (struct rte_cryptodev_sym_session *) val;
if (s)
{
vec_foreach_index (drv_id, dcm->drv)
{
key.drv_id = drv_id;
val = hash_get (data->session_by_drv_id_and_sa_index, key.val);
s = (struct rte_cryptodev_sym_session *) val;
if (s)
hash_unset (data->session_by_drv_id_and_sa_index, key.val);
}
if (!val)
continue;
hash_unset (data->session_by_sa_index, sa_index);
s = (struct rte_cryptodev_sym_session *) val[0];
u64 ts = unix_time_now_nsec ();
dpdk_crypto_session_disposal (data->session_disposal, ts);
vec_foreach_index (drv_id, dcm->drv)
{
key.drv_id = drv_id;
val = hash_get (data->session_by_drv_id_and_sa_index, key.val);
crypto_session_disposal_t sd;
sd.ts = ts;
sd.session = s;
if (!val)
continue;
hash_unset (data->session_by_drv_id_and_sa_index, key.val);
}
hash_unset (data->session_by_sa_index, sa_index);
u64 ts = unix_time_now_nsec ();
dpdk_crypto_session_disposal (data->session_disposal, ts);
crypto_session_disposal_t sd;
sd.ts = ts;
sd.session = s;
vec_add1 (data->session_disposal, sd);
vec_add1 (data->session_disposal, sd);
}
clib_spinlock_unlock_if_init (&data->lockp);
}
/* *INDENT-ON* */
@ -925,6 +929,7 @@ crypto_create_session_drv_pool (vlib_main_t * vm, crypto_dev_t * dev)
return error;
data->session_drv[dev->drv_id] = mp;
clib_spinlock_init (&data->lockp);
return NULL;
}
@ -977,6 +982,7 @@ crypto_disable (void)
rte_mempool_free (data->session_drv[i]);
vec_free (data->session_drv);
clib_spinlock_free (&data->lockp);
}
/* *INDENT-ON* */

View File

@ -126,6 +126,8 @@ typedef struct
typedef struct
{
/* Required for vec_validate_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
struct rte_mempool *crypto_op;
struct rte_mempool *session_h;
struct rte_mempool **session_drv;
@ -135,6 +137,7 @@ typedef struct
u64 crypto_op_get_failed;
u64 session_h_failed;
u64 *session_drv_failed;
clib_spinlock_t lockp;
} crypto_data_t;
typedef struct

View File

@ -123,6 +123,9 @@ typedef CLIB_PACKED
typedef struct
{
/* Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Rewrite string */
u8 *rewrite;

View File

@ -50,7 +50,7 @@ igmp_clear_config (igmp_config_t * config)
pool_free (config->sg);
hash_free (config->igmp_sg_by_key);
hash_unset_mem (im->igmp_config_by_sw_if_index, &config->sw_if_index);
hash_unset (im->igmp_config_by_sw_if_index, config->sw_if_index);
pool_put (im->configs, config);
}
@ -503,12 +503,10 @@ igmp_send_state_changed (vlib_main_t * vm, vlib_node_runtime_t * rt,
pool_put (config->sg, sg);
if (pool_elts (config->sg) == 0)
{
hash_unset_mem (im->igmp_config_by_sw_if_index,
&config->sw_if_index);
hash_unset (im->igmp_config_by_sw_if_index, config->sw_if_index);
pool_put (im->configs, config);
}
}
}
void
@ -631,8 +629,8 @@ igmp_listen (vlib_main_t * vm, u8 enable, u32 sw_if_index,
config->adj_index =
adj_mcast_add_or_lock (FIB_PROTOCOL_IP4, VNET_LINK_IP4,
config->sw_if_index);
hash_set_mem (im->igmp_config_by_sw_if_index, &config->sw_if_index,
config - im->configs);
hash_set (im->igmp_config_by_sw_if_index,
config->sw_if_index, config - im->configs);
}
else if (config->cli_api_configured != cli_api_configured)
{
@ -742,11 +740,8 @@ igmp_init (vlib_main_t * vm)
if ((error = vlib_call_init_function (vm, ip4_lookup_init)))
return error;
im->igmp_config_by_sw_if_index =
hash_create_mem (0, sizeof (u32), sizeof (uword));
im->igmp_api_client_by_client_index =
hash_create_mem (0, sizeof (u32), sizeof (uword));
im->igmp_config_by_sw_if_index = hash_create (0, sizeof (u32));
im->igmp_api_client_by_client_index = hash_create (0, sizeof (u32));
vec_validate_aligned (im->buffers, tm->n_vlib_mains - 1,
CLIB_CACHE_LINE_BYTES);

View File

@ -20,6 +20,7 @@
#include <vlib/vlib.h>
#include <vnet/ip/ip.h>
#include <vlibapi/api_helper_macros.h>
#include <vnet/ip/igmp_packet.h>
#include <vnet/adj/adj_mcast.h>
#include <igmp/igmp_format.h>
@ -110,12 +111,6 @@ struct igmp_timer_t_;
typedef struct igmp_timer_t_ igmp_timer_t;
typedef struct igmp_api_client_t_
{
u32 client_index;
u32 pid;
} igmp_api_client_t;
typedef struct
{
u8 *name;
@ -137,7 +132,7 @@ typedef struct igmp_main_t_
uword *igmp_api_client_by_client_index;
/** pool of api clients registered for join/leave notifications */
igmp_api_client_t *api_clients;
vpe_client_registration_t *api_clients;
/* get config index by config key */
uword *igmp_config_by_sw_if_index;
@ -240,7 +235,7 @@ igmp_config_lookup (igmp_main_t * im, u32 sw_if_index)
uword *p;
igmp_config_t *config = NULL;
p = hash_get_mem (im->igmp_config_by_sw_if_index, &sw_if_index);
p = hash_get (im->igmp_config_by_sw_if_index, sw_if_index);
if (p)
config = vec_elt_at_index (im->configs, p[0]);
@ -262,19 +257,6 @@ igmp_sg_lookup (igmp_config_t * config, igmp_sg_key_t * key)
return sg;
}
always_inline igmp_api_client_t *
igmp_api_client_lookup (igmp_main_t * im, u32 client_index)
{
uword *p;
igmp_api_client_t *api_client = NULL;
p = hash_get_mem (im->igmp_api_client_by_client_index, &client_index);
if (p)
api_client = vec_elt_at_index (im->api_clients, p[0]);
return api_client;
}
#endif /* _IGMP_H_ */
/*

View File

@ -186,11 +186,28 @@ vl_api_igmp_clear_interface_t_handler (vl_api_igmp_clear_interface_t * mp)
vl_msg_api_send_shmem (q, (u8 *) & rmp);
}
/** \brief igmp group lookup
@param im - igmp main
@param client_index - client index
*/
static vpe_client_registration_t *
igmp_api_client_lookup (igmp_main_t * im, u32 client_index)
{
uword *p;
vpe_client_registration_t *api_client = NULL;
p = hash_get (im->igmp_api_client_by_client_index, client_index);
if (p)
api_client = vec_elt_at_index (im->api_clients, p[0]);
return api_client;
}
static void
vl_api_want_igmp_events_t_handler (vl_api_want_igmp_events_t * mp)
{
igmp_main_t *im = &igmp_main;
igmp_api_client_t *api_client;
vpe_client_registration_t *api_client;
vl_api_want_igmp_events_reply_t *rmp;
int rv = 0;
@ -202,19 +219,19 @@ vl_api_want_igmp_events_t_handler (vl_api_want_igmp_events_t * mp)
rv = VNET_API_ERROR_INVALID_REGISTRATION;
goto done;
}
hash_unset_mem (im->igmp_api_client_by_client_index,
&api_client->client_index);
hash_unset (im->igmp_api_client_by_client_index,
api_client->client_index);
pool_put (im->api_clients, api_client);
goto done;
}
if (mp->enable)
{
pool_get (im->api_clients, api_client);
memset (api_client, 0, sizeof (igmp_api_client_t));
memset (api_client, 0, sizeof (vpe_client_registration_t));
api_client->client_index = mp->client_index;
api_client->pid = mp->pid;
hash_set_mem (im->igmp_api_client_by_client_index,
&mp->client_index, api_client - im->api_clients);
api_client->client_pid = mp->pid;
hash_set (im->igmp_api_client_by_client_index,
mp->client_index, api_client - im->api_clients);
goto done;
}
rv = VNET_API_ERROR_INVALID_REGISTRATION;
@ -233,6 +250,26 @@ done:;
vl_msg_api_send_shmem (q, (u8 *) & rmp);
}
static clib_error_t *
want_igmp_events_reaper (u32 client_index)
{
igmp_main_t *im = &igmp_main;
vpe_client_registration_t *api_client;
uword *p;
p = hash_get (im->igmp_api_client_by_client_index, client_index);
if (p)
{
api_client = pool_elt_at_index (im->api_clients, p[0]);
pool_put (im->api_clients, api_client);
hash_unset (im->igmp_api_client_by_client_index, client_index);
}
return (NULL);
}
VL_MSG_API_REAPER_FUNCTION (want_igmp_events_reaper);
void
send_igmp_event (unix_shared_memory_queue_t * q, u32 context,
igmp_main_t * im, igmp_config_t * config, igmp_sg_t * sg)
@ -254,7 +291,7 @@ send_igmp_event (unix_shared_memory_queue_t * q, u32 context,
void
igmp_event (igmp_main_t * im, igmp_config_t * config, igmp_sg_t * sg)
{
igmp_api_client_t *api_client;
vpe_client_registration_t *api_client;
unix_shared_memory_queue_t *q;
/* *INDENT-OFF* */
pool_foreach (api_client, im->api_clients,
@ -271,8 +308,7 @@ igmp_event (igmp_main_t * im, igmp_config_t * config, igmp_sg_t * sg)
pool_put (config->sg, sg);
if (pool_elts (config->sg) == 0)
{
hash_unset_mem (im->igmp_config_by_sw_if_index,
&config->sw_if_index);
hash_unset (im->igmp_config_by_sw_if_index, config->sw_if_index);
pool_put (im->configs, config);
}
}

View File

@ -96,6 +96,8 @@ typedef struct
*/
typedef struct ioam_analyser_data_t_
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u8 is_free;
u8 pad[3];

View File

@ -424,7 +424,7 @@ ip6_ioam_analyse_register_hbh_handler (u8 option,
{
ip6_ioam_analyser_main_t *am = &ioam_analyser_main;
ASSERT (option < ARRAY_LEN (am->analyse_hbh_handler));
ASSERT ((u32) option < ARRAY_LEN (am->analyse_hbh_handler));
/* Already registered */
if (am->analyse_hbh_handler[option])
@ -440,7 +440,7 @@ ip6_ioam_analyse_unregister_hbh_handler (u8 option)
{
ip6_ioam_analyser_main_t *am = &ioam_analyser_main;
ASSERT (option < ARRAY_LEN (am->analyse_hbh_handler));
ASSERT ((u32) option < ARRAY_LEN (am->analyse_hbh_handler));
/* Not registered */
if (!am->analyse_hbh_handler[option])

View File

@ -33,6 +33,8 @@
typedef struct ioam_export_buffer
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Allocated buffer */
u32 buffer_index;
u64 touched_at;

View File

@ -98,6 +98,8 @@
*/
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
ip6_address_t src_address;
ip6_address_t dst_address;
u16 src_port;
@ -122,6 +124,8 @@ typedef struct
*/
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 pool_id;
u32 pool_index;
ip6_address_t src_address;
@ -528,8 +532,7 @@ ioam_cache_ts_table_init (vlib_main_t * vm)
CLIB_CACHE_LINE_BYTES);
vec_validate_aligned (cm->ts_stats, no_of_threads - 1,
CLIB_CACHE_LINE_BYTES);
vec_validate_aligned (cm->timer_wheels, no_of_threads - 1,
CLIB_CACHE_LINE_BYTES);
vec_validate (cm->timer_wheels, no_of_threads - 1);
cm->lookup_table_nbuckets = IOAM_CACHE_TABLE_DEFAULT_HASH_NUM_BUCKETS;
cm->lookup_table_nbuckets = 1 << max_log2 (cm->lookup_table_nbuckets);
cm->lookup_table_size = IOAM_CACHE_TABLE_DEFAULT_HASH_MEMORY_SIZE;

View File

@ -89,7 +89,7 @@ vxlan_gpe_ioam_add_register_option (u8 option,
{
vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main;
ASSERT (option < ARRAY_LEN (hm->add_options));
ASSERT ((u32) option < ARRAY_LEN (hm->add_options));
/* Already registered */
if (hm->add_options[option])
@ -106,7 +106,7 @@ vxlan_gpe_add_unregister_option (u8 option)
{
vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main;
ASSERT (option < ARRAY_LEN (hm->add_options));
ASSERT ((u32) option < ARRAY_LEN (hm->add_options));
/* Not registered */
if (!hm->add_options[option])
@ -128,7 +128,7 @@ vxlan_gpe_ioam_register_option (u8 option,
{
vxlan_gpe_ioam_main_t *im = &vxlan_gpe_ioam_main;
ASSERT (option < ARRAY_LEN (im->options));
ASSERT ((u32) option < ARRAY_LEN (im->options));
/* Already registered */
if (im->options[option])
@ -145,7 +145,7 @@ vxlan_gpe_ioam_unregister_option (u8 option)
{
vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main;
ASSERT (option < ARRAY_LEN (hm->options));
ASSERT ((u32) option < ARRAY_LEN (hm->options));
/* Not registered */
if (!hm->options[option])

View File

@ -84,6 +84,9 @@ typedef struct
*/
typedef struct
{
/** Required for pool_get_aligned */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/** Local source IPv4/6 address to be used. */
ip46_address_t src;

View File

@ -242,17 +242,14 @@ show_lacp_fn (vlib_main_t * vm, unformat_input_t * input,
slave_if_t *sif;
clib_error_t *error = 0;
u8 details = 0;
u32 hw_if_index, *sw_if_indices = 0;
vnet_interface_main_t *im = &vnm->interface_main;
vnet_sw_interface_t *sw;
u32 sw_if_index, *sw_if_indices = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat
(input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
(input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index))
{
sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
{
error = clib_error_return (0, "interface is not enslaved");
@ -304,11 +301,9 @@ debug_lacp_command_fn (vlib_main_t * vm, unformat_input_t * input,
lacp_main_t *lm = &lacp_main;
u8 onoff = 0;
u8 input_found = 0;
u32 hw_if_index = ~0;
u32 sw_if_index = ~0;
slave_if_t *sif;
vnet_main_t *vnm = vnet_get_main ();
vnet_interface_main_t *im = &vnm->interface_main;
vnet_sw_interface_t *sw;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
@ -317,7 +312,7 @@ debug_lacp_command_fn (vlib_main_t * vm, unformat_input_t * input,
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "%U",
unformat_vnet_hw_interface, vnm, &hw_if_index))
unformat_vnet_sw_interface, vnm, &sw_if_index))
;
if (input_found)
{
@ -346,10 +341,9 @@ debug_lacp_command_fn (vlib_main_t * vm, unformat_input_t * input,
if (!input_found)
return clib_error_return (0, "must specify on or off");
if (hw_if_index != ~0)
if (sw_if_index != ~0)
{
sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
return (clib_error_return (0, "Please enslave the interface first"));
sif->debug = onoff;

View File

@ -249,6 +249,8 @@ lacp_input_format_trace (u8 * s, va_list * args)
u8 *p;
lacp_state_struct *state_entry;
s = format (s, "%U:\n", format_vnet_sw_if_index_name, vnet_get_main (),
t->sw_if_index);
s = format (s, "Length: %d\n", t->len);
if (t->len >= sizeof (lacp_pdu_t))
{

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