# Release Notes {#release_notes} * @subpage release_notes_1908 * @subpage release_notes_1904 * @subpage release_notes_19011 * @subpage release_notes_1901 * @subpage release_notes_1810 * @subpage release_notes_1807 * @subpage release_notes_1804 * @subpage release_notes_18012 * @subpage release_notes_18011 * @subpage release_notes_1801 * @subpage release_notes_1710 * @subpage release_notes_1707 * @subpage release_notes_1704 * @subpage release_notes_17011 * @subpage release_notes_1701 * @subpage release_notes_1609 * @subpage release_notes_1606 @page release_notes_1908 Release notes for VPP 19.08 TBD @page release_notes_1904 Release notes for VPP 19.04 TBD @page release_notes_19011 Release notes for VPP 19.01.1 This is bug fix release. For the full list of fixed issues please refer to: - fd.io [JIRA](https://jira.fd.io) - git [commit log](https://git.fd.io/vpp/log/?h=stable/1901) @page release_notes_1901 Release notes for VPP 19.01 More than 649 commits since the 18.10 release. ## Features ### Infrastructure - NUMA-aware, growable physical memory allocator (pmalloc) - FIB: sticky load-balance - C11 safe string handling: provide and use "safe" C string handling functions - vlib: allocate buffers on local numa, not on numa 1 - vppinfra: autodetect default hugepage size - Move RPC traffic off the shared-memory API queue - IPv6: Make link-local configurable per-interface - IGMP: improve CLI debug output - IPSec: split ipsec nodes into ip4/ip6 nodes - IPSec: infra for selecting backends - vhost-user: cleanup and performance optimizations - ethernet-input, memif improvements and optimizations - DPDK: bump to DPDK 18.11 - reassembly: harden reassembly code - stats: Deprecate old (event-based) stats framework - vlib: support Hyper-V/Azure VMBus - binary api clients: wait for vpp to start - graph dispatch trace: capture packet data and buffer metadata, output in pcap format - improve feature arc order constraint specification ### VNET & Plugins - pktgen: correctly replay a mix of single and multi-buffer packets - add wireshark dissector to extras - avf: optimizations - acl-plugin: use L2 feature arc instead of L2 classifier - acl-plugin: performance enhancement - dpdk: allow interface name to be specified from startup.conf - dpdk: blacklist PCI devices by type - dpdk: switch to in-memory mode, deprecate use of socket-mem - vnet: store hw interface speed in kbps instead of using flags - vmxnet3: enable promiscuous mode & cli enhancements - gbp: Add support for flow hash profile & l3-out subnets - map: Add API support for setting parameters. - map: Convert from DPO to input feature - nat: improve expired sessions reuse in NAT44 - nat: syslog - sessions logging - nsim: add packet loss simulation, docs - perfmon: x86_64 perf counter plugin - vnet: L2 feature arc infrastructure ### Host stack - TCP congestion control improvements - TCP Cubic congestion control algorithm - TCP fast path optimizations - Transport tx connection pacer. TCP uses it by default - Basic support for session flushing and TCP PSH segments - TCP/session api support for configuring custom local src ip/port - VCL/LDP basic support for multi-process applications - Overall code hardening, cleanup and bugfixing for tcp, session, vcl and ldp ### PAPI & Test framework - add specific API types for IP addresses, MAC address, interface index etc. - add timeout support for socket transport - add support for format/unformat functions - generic API types format/unformat support for VAT and custom dump - python3 test adjustments - make test: create virtualenv under /test/ - make test: print TEST= values for failed tests - add human-friendly annotations to log messages ### VOM - Add support for redirect contracts in gbp - deprecate TAP add ip-punt redirect dump - vxlan-gbp support ## Known issues For the full list of issues please refer to fd.io [JIRA](https://jira.fd.io). ## Issues fixed For the full list of fixed issues please refer to: - fd.io [JIRA](https://jira.fd.io) - git [commit log](https://git.fd.io/vpp/log/?h=stable/1810) ## API changes Description of results: * _Definition changed_: indicates that the API file was modified between releases. * _Only in image_: indicates the API is new for this release. * _Only in file_: indicates the API has been removed in this release. Message Name | Results ------------------------------------------------------------ | ---------------- acl_plugin_get_conn_table_max_entries | only in image acl_plugin_get_conn_table_max_entries_reply | only in image app_worker_add_del | definition changed app_worker_add_del_reply | definition changed application_attach_reply | definition changed bd_ip_mac_add_del | definition changed bd_ip_mac_details | definition changed bd_ip_mac_flush | only in image bd_ip_mac_flush_reply | only in image bond_create | definition changed cli_inband | definition changed cli_inband_reply | definition changed gbp_bridge_domain_add | only in image gbp_bridge_domain_add_reply | only in image gbp_bridge_domain_del | only in image gbp_bridge_domain_del_reply | only in image gbp_bridge_domain_details | only in image gbp_bridge_domain_dump | only in image gbp_bridge_domain_dump_reply | only in image gbp_endpoint_details | definition changed gbp_endpoint_group_add | only in image gbp_endpoint_group_add_del | only in file gbp_endpoint_group_add_del_reply | only in file gbp_endpoint_group_add_reply | only in image gbp_endpoint_group_del | only in image gbp_endpoint_group_del_reply | only in image gbp_endpoint_learn_set_inactive_threshold | only in image gbp_endpoint_learn_set_inactive_threshold_reply | only in image gbp_ext_itf_add_del | only in image gbp_ext_itf_add_del_reply | only in image gbp_ext_itf_details | only in image gbp_ext_itf_dump | only in image gbp_route_domain_add | only in image gbp_route_domain_add_reply | only in image gbp_route_domain_del | only in image gbp_route_domain_del_reply | only in image gbp_route_domain_details | only in image gbp_route_domain_dump | only in image gbp_route_domain_dump_reply | only in image gbp_vxlan_tunnel_add | only in image gbp_vxlan_tunnel_add_reply | only in image gbp_vxlan_tunnel_del | only in image gbp_vxlan_tunnel_del_reply | only in image gbp_vxlan_tunnel_details | only in image gbp_vxlan_tunnel_dump | only in image igmp_proxy_device_add_del | only in image igmp_proxy_device_add_del_interface | only in image igmp_proxy_device_add_del_interface_reply | only in image igmp_proxy_device_add_del_reply | only in image ip6_mfib_details | definition changed ip_container_proxy_details | only in image ip_container_proxy_dump | only in image ip_mfib_details | definition changed ip_punt_redirect | definition changed ip_punt_redirect_details | only in image ip_punt_redirect_dump | only in image ip_source_check_interface_add_del | only in image ip_source_check_interface_add_del_reply | only in image ipip_6rd_add_tunnel_reply | definition changed ipip_6rd_del_tunnel | definition changed ipip_add_tunnel_reply | definition changed ipip_del_tunnel | definition changed ipip_tunnel_details | definition changed ipip_tunnel_dump | definition changed ipsec_backend_details | only in image ipsec_backend_dump | only in image ipsec_sa_details | definition changed ipsec_select_backend | only in image ipsec_select_backend_reply | only in image ipsec_tunnel_if_add_del | definition changed map_add_d
/*
* Copyright (c) 2020 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cnat/cnat_src_policy.h>
#include <cnat/cnat_inline.h>
#include <cnat/cnat_session.h>
#include <cnat/cnat_translation.h>
cnat_src_policy_main_t cnat_src_policy_main;
void
cnat_register_vip_src_policy (cnat_vip_source_policy_t fp)
{
cnat_src_policy_main.vip_policy = fp;
}
cnat_source_policy_errors_t
cnat_vip_default_source_policy (vlib_main_t * vm,
vlib_buffer_t * b,
cnat_session_t * session,
u32 * rsession_flags,
const cnat_translation_t * ct,
cnat_node_ctx_t * ctx)
{
ip_protocol_t iproto;
udp_header_t *udp0;
ip4_header_t *ip4;
ip6_header_t *ip6;
if (AF_IP4 == ctx->af)
{
ip4 = vlib_buffer_get_current (b);
iproto = ip4->protocol;
udp0 = (udp_header_t *) (ip4 + 1);
}
else
{
ip6 = vlib_buffer_get_current (b);
iproto = ip6->protocol;
udp0 = (udp_header_t *) (ip6 + 1);
}
int rv = 0;
if (!session->value.cs_port[VLIB_RX])
{
u16 sport;
sport = udp0->src_port;
/* Allocate a port only if asked and if we actually sNATed */
if ((ct->flags & CNAT_TRANSLATION_FLAG_ALLOCATE_PORT)
&& (*rsession_flags & CNAT_SESSION_FLAG_HAS_SNAT))
{
sport = 0; /* force allocation */
session->value.flags |= CNAT_SESSION_FLAG_ALLOC_PORT;
rv = cnat_allocate_port (&sport, iproto);
if (rv)
return CNAT_SOURCE_ERROR_EXHAUSTED_PORTS;
}
session->value.cs_port[VLIB_RX] = sport;
}
return 0;
}
always_inline cnat_src_port_allocator_t *
cnat_get_src_port_allocator (ip_protocol_t iproto)
{
cnat_src_policy_main_t *cspm = &cnat_src_policy_main;
switch (iproto)
{
case IP_PROTOCOL_TCP:
return &cspm->src_ports[CNAT_SPORT_PROTO_TCP];
case IP_PROTOCOL_UDP:
return &cspm->src_ports[CNAT_SPORT_PROTO_UDP];
case IP_PROTOCOL_ICMP:
return &cspm->src_ports[CNAT_SPORT_PROTO_ICMP];
case IP_PROTOCOL_ICMP6:
return &cspm->src_ports[CNAT_SPORT_PROTO_ICMP6];
default:
return 0;
}
}
void
cnat_free_port (u16 port, ip_protocol_t iproto)
{
cnat_src_port_allocator_t *ca;
ca = cnat_get_src_port_allocator (iproto);
if (!ca)
return;
clib_spinlock_lock (&ca->lock);
clib_bitmap_set_no_check (ca->bmap, port, 0);
clib_spinlock_unlock (&ca->lock);
}
int
cnat_allocate_port (u16 * port, ip_protocol_t iproto)
{
*port = clib_net_to_host_u16 (*port);
if (*port == 0)
*port = MIN_SRC_PORT;
cnat_src_port_allocator_t *ca;
ca = cnat_get_src_port_allocator (iproto);
if (!ca)
return -1;
clib_spinlock_lock (&ca->lock);
if (clib_bitmap_get_no_check (ca->bmap, *port))
{
*port = clib_bitmap_next_clear (ca->bmap, *port);
if (PREDICT_FALSE (*port >= UINT16_MAX))
*port = clib_bitmap_next_clear (ca->bmap, MIN_SRC_PORT);
if (PREDICT_FALSE (*port >= UINT16_MAX))
return -1;
}
clib_bitmap_set_no_check (ca->bmap, *port, 1);
*port = clib_host_to_net_u16 (*port);
clib_spinlock_unlock (&ca->lock);
return 0;
}
static clib_error_t *
cnat_src_policy_init (vlib_main_t * vm)
{
cnat_src_policy_main_t *cspm = &cnat_src_policy_main;
cspm->vip_policy = cnat_vip_default_source_policy;
cspm->default_policy = cnat_vip_default_source_policy;
vec_validate (cspm->src_ports, CNAT_N_SPORT_PROTO);
for (int i = 0; i < CNAT_N_SPORT_PROTO; i++)
{
clib_spinlock_init (&cspm->src_ports[i].lock);
clib_bitmap_validate (cspm->src_ports[i].bmap, UINT16_MAX);
}
/* Inject cleanup callback */
cnat_free_port_cb = cnat_free_port;
return (NULL);
}
VLIB_INIT_FUNCTION (cnat_src_policy_init);
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/