Compare commits
58 Commits
v19.08-rc0
...
stable/180
Author | SHA1 | Date | |
---|---|---|---|
3a0d8536de | |||
ca7a68e0fb | |||
6bb589c8ac | |||
a652002ffe | |||
98ee17424b | |||
d9aa9ff03c | |||
2302d0dfa2 | |||
2857b14e22 | |||
54908a2c2f | |||
01b2c23fae | |||
6a4b97a616 | |||
974a760a5e | |||
adec5c44da | |||
8037694b7b | |||
cc47c2d1d4 | |||
c9b6ec7f59 | |||
fe80b9f064 | |||
ac2b7363f4 | |||
516d63ff2c | |||
6e4f40b6a9 | |||
df53f5fda2 | |||
42c6599bf3 | |||
b0a517b6c8 | |||
d216301e4a | |||
0c63d82e99 | |||
fd2e376521 | |||
774bfc36bb | |||
b3caf66be9 | |||
8579a389fc | |||
6cdad6d8ff | |||
332e0440a5 | |||
88c50b7d4b | |||
18bde8a579 | |||
bce5e88843 | |||
27820fd3f0 | |||
743ff8430a | |||
a45bdcaceb | |||
1d328abbe9 | |||
1af3389118 | |||
6fc740bbdd | |||
d3b96ef0d7 | |||
866c465697 | |||
27669ac245 | |||
18744ee680 | |||
1a2b9e6d73 | |||
70e1ae2659 | |||
9c4ae7f6d0 | |||
1286a15a6e | |||
e5cbccf35f | |||
45d9ba1b32 | |||
c1a30f61ec | |||
405b0732e1 | |||
52e947dfae | |||
decc3c52d7 | |||
88f0a3d930 | |||
24c3733f1f | |||
ca3c508401 | |||
7ace56b9d8 |
@ -2,3 +2,4 @@
|
||||
host=gerrit.fd.io
|
||||
port=29418
|
||||
project=vpp
|
||||
defaultbranch=stable/1804
|
||||
|
13
Makefile
13
Makefile
@ -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")
|
||||
|
44
README.md
44
README.md
@ -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
1994
RELEASE.md
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
33
extras/scripts/list_api_changes.py
Executable file
33
extras/scripts/list_api_changes.py
Executable 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
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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* */
|
||||
|
||||
|
@ -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
|
||||
|
@ -123,6 +123,9 @@ typedef CLIB_PACKED
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Required for pool_get_aligned */
|
||||
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
|
||||
|
||||
/* Rewrite string */
|
||||
u8 *rewrite;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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_ */
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -96,6 +96,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct ioam_analyser_data_t_
|
||||
{
|
||||
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
|
||||
|
||||
u8 is_free;
|
||||
u8 pad[3];
|
||||
|
||||
|
@ -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])
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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])
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
Reference in New Issue
Block a user