Compare commits
10 Commits
master
...
stable/211
Author | SHA1 | Date | |
---|---|---|---|
|
08ff7a9857 | ||
|
0a485f517d | ||
|
189383ddcc | ||
|
0385458a56 | ||
|
895a0a1fed | ||
|
48797d204f | ||
|
0e0384cde9 | ||
|
9298a7ec0c | ||
|
c1931b2f09 | ||
|
fd9d936b3c |
@ -2,3 +2,4 @@
|
||||
host=gerrit.fd.io
|
||||
port=29418
|
||||
project=vpp
|
||||
defaultbranch=stable/2110
|
||||
|
483
RELEASE.md
483
RELEASE.md
File diff suppressed because it is too large
Load Diff
6
build/external/packages/rdma-core.mk
vendored
6
build/external/packages/rdma-core.mk
vendored
@ -42,12 +42,12 @@ endef
|
||||
|
||||
define rdma-core_install_cmds
|
||||
mkdir -p $(rdma-core_install_dir)/lib/pkgconfig
|
||||
cp -av $(rdma-core_build_dir)/include $(rdma-core_install_dir) > $(rdma-core_install_log)
|
||||
cp -v $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc \
|
||||
cp -avL $(rdma-core_build_dir)/include $(rdma-core_install_dir) > $(rdma-core_install_log)
|
||||
cp -avL $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc \
|
||||
$(rdma-core_build_dir)/lib/pkgconfig/libmlx5.pc \
|
||||
$(rdma-core_build_dir)/lib/pkgconfig/libmlx4.pc \
|
||||
$(rdma-core_install_dir)/lib/pkgconfig >> $(rdma-core_install_log)
|
||||
cp -v $(rdma-core_build_dir)/lib/statics/libibverbs.a \
|
||||
cp -avL $(rdma-core_build_dir)/lib/statics/libibverbs.a \
|
||||
$(rdma-core_build_dir)/lib/statics/libmlx5.a \
|
||||
$(rdma-core_build_dir)/lib/statics/libmlx4.a \
|
||||
$(rdma-core_build_dir)/util/librdma_util.a \
|
||||
|
@ -41,7 +41,7 @@ BuildRequires: mbedtls-devel mbedtls
|
||||
%if 0%{?fedora}
|
||||
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
|
||||
Requires: compat-openssl10
|
||||
Requires: boost-filesystem mbedtls libffi-devel
|
||||
Requires: mbedtls libffi-devel
|
||||
BuildRequires: subunit, subunit-devel
|
||||
BuildRequires: compat-openssl10-devel
|
||||
BuildRequires: python, python-devel, python-virtualenv, python-ply
|
||||
@ -50,7 +50,7 @@ BuildRequires: cmake
|
||||
%else
|
||||
%if 0%{rhel} >= 7
|
||||
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36
|
||||
Requires: boost-filesystem mbedtls libffi-devel
|
||||
Requires: mbedtls libffi-devel
|
||||
BuildRequires: epel-release
|
||||
BuildRequires: mbedtls-devel mbedtls
|
||||
BuildREquires: openssl-devel
|
||||
@ -70,7 +70,6 @@ BuildRequires: redhat-lsb
|
||||
BuildRequires: apr-devel
|
||||
BuildRequires: numactl-devel
|
||||
BuildRequires: autoconf automake libtool byacc bison flex
|
||||
BuildRequires: boost boost-devel
|
||||
BuildRequires: selinux-policy selinux-policy-devel
|
||||
|
||||
Source: %{name}-%{_version}-%{_release}.tar.xz
|
||||
|
@ -3342,7 +3342,7 @@ nat44_ed_add_del_interface_address_cb (ip4_main_t *im, uword opaque,
|
||||
{
|
||||
rv = nat44_ed_add_static_mapping (
|
||||
rp->l_addr, address[0], rp->l_port, rp->e_port, rp->proto,
|
||||
rp->vrf_id, ~0, rp->flags, rp->pool_addr, rp->tag);
|
||||
rp->vrf_id, sw_if_index, rp->flags, rp->pool_addr, rp->tag);
|
||||
if (rv)
|
||||
{
|
||||
nat_elog_notice_X1 (sm, "add_static_mapping returned %d",
|
||||
|
@ -167,16 +167,19 @@ vcl_worker_alloc_and_init ()
|
||||
if (vcl_get_worker_index () != ~0)
|
||||
return 0;
|
||||
|
||||
/* Grab lock before selecting mem thread index */
|
||||
clib_spinlock_lock (&vcm->workers_lock);
|
||||
|
||||
/* Use separate heap map entry for worker */
|
||||
clib_mem_set_thread_index ();
|
||||
|
||||
if (pool_elts (vcm->workers) == vcm->cfg.max_workers)
|
||||
{
|
||||
VDBG (0, "max-workers %u limit reached", vcm->cfg.max_workers);
|
||||
return 0;
|
||||
wrk = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
clib_spinlock_lock (&vcm->workers_lock);
|
||||
wrk = vcl_worker_alloc ();
|
||||
vcl_set_worker_index (wrk->wrk_index);
|
||||
wrk->thread_id = pthread_self ();
|
||||
@ -203,9 +206,9 @@ vcl_worker_alloc_and_init ()
|
||||
vec_reset_length (wrk->mq_msg_vector);
|
||||
vec_validate (wrk->unhandled_evts_vector, 128);
|
||||
vec_reset_length (wrk->unhandled_evts_vector);
|
||||
clib_spinlock_unlock (&vcm->workers_lock);
|
||||
|
||||
done:
|
||||
clib_spinlock_unlock (&vcm->workers_lock);
|
||||
return wrk;
|
||||
}
|
||||
|
||||
|
@ -1222,6 +1222,9 @@ list(APPEND VNET_HEADERS
|
||||
fib/fib.h
|
||||
fib/fib_api.h
|
||||
fib/ip4_fib.h
|
||||
fib/ip4_fib_8.h
|
||||
fib/ip4_fib_16.h
|
||||
fib/ip4_fib_hash.h
|
||||
fib/ip6_fib.h
|
||||
fib/fib_types.h
|
||||
fib/fib_table.h
|
||||
|
@ -337,7 +337,7 @@ typedef struct
|
||||
i16 crypto_start_offset; /* first buffer offset */
|
||||
i16 integ_start_offset;
|
||||
/* adj total_length for integ, e.g.4 bytes for IPSec ESN */
|
||||
u16 integ_length_adj;
|
||||
i16 integ_length_adj;
|
||||
vnet_crypto_op_status_t status : 8;
|
||||
u8 flags; /**< share same VNET_CRYPTO_OP_FLAG_* values */
|
||||
} vnet_crypto_async_frame_elt_t;
|
||||
@ -621,7 +621,7 @@ static_always_inline void
|
||||
vnet_crypto_async_add_to_frame (vlib_main_t *vm, vnet_crypto_async_frame_t *f,
|
||||
u32 key_index, u32 crypto_len,
|
||||
i16 integ_len_adj, i16 crypto_start_offset,
|
||||
u16 integ_start_offset, u32 buffer_index,
|
||||
i16 integ_start_offset, u32 buffer_index,
|
||||
u16 next_node, u8 *iv, u8 *tag, u8 *aad,
|
||||
u8 flags)
|
||||
{
|
||||
|
@ -351,6 +351,9 @@ ip6_icmp_echo_request (vlib_main_t * vm,
|
||||
vnet_buffer (p1)->sw_if_index[VLIB_RX]);
|
||||
vnet_buffer (p1)->sw_if_index[VLIB_TX] = fib_index1;
|
||||
|
||||
p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
|
||||
p1->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
|
||||
|
||||
/* verify speculative enqueues, maybe switch current next frame */
|
||||
/* if next0==next1==next_index then nothing special needs to be done */
|
||||
vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
|
||||
@ -404,6 +407,7 @@ ip6_icmp_echo_request (vlib_main_t * vm,
|
||||
vnet_buffer (p0)->sw_if_index[VLIB_RX]);
|
||||
vnet_buffer (p0)->sw_if_index[VLIB_TX] = fib_index0;
|
||||
|
||||
p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
|
||||
/* Verify speculative enqueue, maybe switch current next frame */
|
||||
vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
|
||||
to_next, n_left_to_next,
|
||||
|
@ -236,6 +236,24 @@ esp_get_ip6_hdr_len (ip6_header_t * ip6, ip6_ext_header_t ** ext_hdr)
|
||||
return len;
|
||||
}
|
||||
|
||||
/* IPsec IV generation: IVs requirements differ depending of the
|
||||
* encryption mode: IVs must be unpredictable for AES-CBC whereas it can
|
||||
* be predictable but should never be reused with the same key material
|
||||
* for CTR and GCM.
|
||||
* We use a packet counter as the IV for CTR and GCM, and to ensure the
|
||||
* IV is unpredictable for CBC, it is then encrypted using the same key
|
||||
* as the message. You can refer to NIST SP800-38a and NIST SP800-38d
|
||||
* for more details. */
|
||||
static_always_inline void *
|
||||
esp_generate_iv (ipsec_sa_t *sa, void *payload, int iv_sz)
|
||||
{
|
||||
ASSERT (iv_sz >= sizeof (u64));
|
||||
u64 *iv = (u64 *) (payload - iv_sz);
|
||||
clib_memset_u8 (iv, 0, iv_sz);
|
||||
*iv = sa->iv_counter++;
|
||||
return iv;
|
||||
}
|
||||
|
||||
static_always_inline void
|
||||
esp_process_chained_ops (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
vnet_crypto_op_t * ops, vlib_buffer_t * b[],
|
||||
@ -389,27 +407,29 @@ esp_prepare_sync_op (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
vnet_crypto_op_t *op;
|
||||
vec_add2_aligned (crypto_ops[0], op, 1, CLIB_CACHE_LINE_BYTES);
|
||||
vnet_crypto_op_init (op, sa0->crypto_enc_op_id);
|
||||
u8 *crypto_start = payload;
|
||||
/* esp_add_footer_and_icv() in esp_encrypt_inline() makes sure we always
|
||||
* have enough space for ESP header and footer which includes ICV */
|
||||
ASSERT (payload_len > icv_sz);
|
||||
u16 crypto_len = payload_len - icv_sz;
|
||||
|
||||
/* generate the IV in front of the payload */
|
||||
void *pkt_iv = esp_generate_iv (sa0, payload, iv_sz);
|
||||
|
||||
op->src = op->dst = payload;
|
||||
op->key_index = sa0->crypto_key_index;
|
||||
op->len = payload_len - icv_sz;
|
||||
op->user_data = bi;
|
||||
|
||||
if (ipsec_sa_is_set_IS_CTR (sa0))
|
||||
{
|
||||
ASSERT (sizeof (u64) == iv_sz);
|
||||
/* construct nonce in a scratch space in front of the IP header */
|
||||
esp_ctr_nonce_t *nonce =
|
||||
(esp_ctr_nonce_t *) (payload - sizeof (u64) - hdr_len -
|
||||
sizeof (*nonce));
|
||||
u64 *pkt_iv = (u64 *) (payload - sizeof (u64));
|
||||
|
||||
(esp_ctr_nonce_t *) (pkt_iv - hdr_len - sizeof (*nonce));
|
||||
if (ipsec_sa_is_set_IS_AEAD (sa0))
|
||||
{
|
||||
/* constuct aad in a scratch space in front of the nonce */
|
||||
op->aad = (u8 *) nonce - sizeof (esp_aead_t);
|
||||
op->aad_len = esp_aad_fill (op->aad, esp, sa0, seq_hi);
|
||||
op->tag = payload + op->len;
|
||||
op->tag = payload + crypto_len;
|
||||
op->tag_len = 16;
|
||||
}
|
||||
else
|
||||
@ -418,13 +438,17 @@ esp_prepare_sync_op (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
}
|
||||
|
||||
nonce->salt = sa0->salt;
|
||||
nonce->iv = *pkt_iv = clib_host_to_net_u64 (sa0->ctr_iv_counter++);
|
||||
nonce->iv = *(u64 *) pkt_iv;
|
||||
op->iv = (u8 *) nonce;
|
||||
}
|
||||
else
|
||||
{
|
||||
op->iv = payload - iv_sz;
|
||||
op->flags = VNET_CRYPTO_OP_FLAG_INIT_IV;
|
||||
/* construct zero iv in front of the IP header */
|
||||
op->iv = pkt_iv - hdr_len - iv_sz;
|
||||
clib_memset_u8 (op->iv, 0, iv_sz);
|
||||
/* include iv field in crypto */
|
||||
crypto_start -= iv_sz;
|
||||
crypto_len += iv_sz;
|
||||
}
|
||||
|
||||
if (lb != b[0])
|
||||
@ -433,8 +457,15 @@ esp_prepare_sync_op (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
op->flags |= VNET_CRYPTO_OP_FLAG_CHAINED_BUFFERS;
|
||||
op->chunk_index = vec_len (ptd->chunks);
|
||||
op->tag = vlib_buffer_get_tail (lb) - icv_sz;
|
||||
esp_encrypt_chain_crypto (vm, ptd, sa0, b[0], lb, icv_sz, payload,
|
||||
payload_len, &op->n_chunks);
|
||||
esp_encrypt_chain_crypto (vm, ptd, sa0, b[0], lb, icv_sz,
|
||||
crypto_start, crypto_len + icv_sz,
|
||||
&op->n_chunks);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* not chained */
|
||||
op->src = op->dst = crypto_start;
|
||||
op->len = crypto_len;
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,26 +515,26 @@ esp_prepare_async_frame (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
u8 *tag, *iv, *aad = 0;
|
||||
u8 flag = 0;
|
||||
u32 key_index;
|
||||
i16 crypto_start_offset, integ_start_offset = 0;
|
||||
i16 crypto_start_offset, integ_start_offset;
|
||||
u16 crypto_total_len, integ_total_len;
|
||||
|
||||
post->next_index = next;
|
||||
|
||||
/* crypto */
|
||||
crypto_start_offset = payload - b->data;
|
||||
crypto_start_offset = integ_start_offset = payload - b->data;
|
||||
crypto_total_len = integ_total_len = payload_len - icv_sz;
|
||||
tag = payload + crypto_total_len;
|
||||
|
||||
key_index = sa->linked_key_index;
|
||||
|
||||
/* generate the IV in front of the payload */
|
||||
void *pkt_iv = esp_generate_iv (sa, payload, iv_sz);
|
||||
|
||||
if (ipsec_sa_is_set_IS_CTR (sa))
|
||||
{
|
||||
ASSERT (sizeof (u64) == iv_sz);
|
||||
/* construct nonce in a scratch space in front of the IP header */
|
||||
esp_ctr_nonce_t *nonce = (esp_ctr_nonce_t *) (payload - sizeof (u64) -
|
||||
hdr_len - sizeof (*nonce));
|
||||
u64 *pkt_iv = (u64 *) (payload - sizeof (u64));
|
||||
|
||||
esp_ctr_nonce_t *nonce =
|
||||
(esp_ctr_nonce_t *) (pkt_iv - hdr_len - sizeof (*nonce));
|
||||
if (ipsec_sa_is_set_IS_AEAD (sa))
|
||||
{
|
||||
/* constuct aad in a scratch space in front of the nonce */
|
||||
@ -517,13 +548,17 @@ esp_prepare_async_frame (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
}
|
||||
|
||||
nonce->salt = sa->salt;
|
||||
nonce->iv = *pkt_iv = clib_host_to_net_u64 (sa->ctr_iv_counter++);
|
||||
nonce->iv = *(u64 *) pkt_iv;
|
||||
iv = (u8 *) nonce;
|
||||
}
|
||||
else
|
||||
{
|
||||
iv = payload - iv_sz;
|
||||
flag |= VNET_CRYPTO_OP_FLAG_INIT_IV;
|
||||
/* construct zero iv in front of the IP header */
|
||||
iv = pkt_iv - hdr_len - iv_sz;
|
||||
clib_memset_u8 (iv, 0, iv_sz);
|
||||
/* include iv field in crypto */
|
||||
crypto_start_offset -= iv_sz;
|
||||
crypto_total_len += iv_sz;
|
||||
}
|
||||
|
||||
if (lb != b)
|
||||
@ -531,13 +566,14 @@ esp_prepare_async_frame (vlib_main_t *vm, ipsec_per_thread_data_t *ptd,
|
||||
/* chain */
|
||||
flag |= VNET_CRYPTO_OP_FLAG_CHAINED_BUFFERS;
|
||||
tag = vlib_buffer_get_tail (lb) - icv_sz;
|
||||
crypto_total_len = esp_encrypt_chain_crypto (vm, ptd, sa, b, lb, icv_sz,
|
||||
payload, payload_len, 0);
|
||||
crypto_total_len = esp_encrypt_chain_crypto (
|
||||
vm, ptd, sa, b, lb, icv_sz, b->data + crypto_start_offset,
|
||||
crypto_total_len + icv_sz, 0);
|
||||
}
|
||||
|
||||
if (sa->integ_op_id)
|
||||
{
|
||||
integ_start_offset = crypto_start_offset - iv_sz - sizeof (esp_header_t);
|
||||
integ_start_offset -= iv_sz + sizeof (esp_header_t);
|
||||
integ_total_len += iv_sz + sizeof (esp_header_t);
|
||||
|
||||
if (b != lb)
|
||||
|
@ -132,7 +132,7 @@ typedef struct
|
||||
u32 seq;
|
||||
u32 seq_hi;
|
||||
u64 replay_window;
|
||||
u64 ctr_iv_counter;
|
||||
u64 iv_counter;
|
||||
dpo_id_t dpo;
|
||||
|
||||
vnet_crypto_key_index_t crypto_key_index;
|
||||
|
@ -38,6 +38,12 @@ configure_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/vnet/config.h
|
||||
)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/vnet/config.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vpp/vnet
|
||||
COMPONENT vpp-dev
|
||||
)
|
||||
|
||||
set(VPP_API_FILES
|
||||
api/vpe_types.api
|
||||
api/vpe.api
|
||||
|
Loading…
x
Reference in New Issue
Block a user