diff options
| author | Viacheslav <v.gletenko@vyos.io> | 2025-08-07 08:43:24 +0000 |
|---|---|---|
| committer | Viacheslav <v.gletenko@vyos.io> | 2025-08-07 08:43:24 +0000 |
| commit | 9e8b9eea45d92d6e886b1fbd6ac1b832ae44c720 (patch) | |
| tree | d93a2fce931a8203219cfacf39b4137c82042c80 /data | |
| parent | 8b9eabd3b636ab5bc1542843f265718c2e245baf (diff) | |
| parent | 1550cb9b84595a672d99694b838aa633800452ec (diff) | |
| download | vyos-1x-9e8b9eea45d92d6e886b1fbd6ac1b832ae44c720.tar.gz vyos-1x-9e8b9eea45d92d6e886b1fbd6ac1b832ae44c720.zip | |
T7697: Merge remote-tracking branch 'vpp/current' into vyos-1x
Diffstat (limited to 'data')
| -rw-r--r-- | data/config-mode-dependencies/vyos-vpp.json | 69 | ||||
| -rw-r--r-- | data/templates/vpp/override.conf.j2 | 14 | ||||
| -rw-r--r-- | data/templates/vpp/startup.conf.j2 | 209 |
3 files changed, 292 insertions, 0 deletions
diff --git a/data/config-mode-dependencies/vyos-vpp.json b/data/config-mode-dependencies/vyos-vpp.json new file mode 100644 index 000000000..32b53508e --- /dev/null +++ b/data/config-mode-dependencies/vyos-vpp.json @@ -0,0 +1,69 @@ +{ + "vpp": { + "ethernet": ["interfaces_ethernet"], + "vpp_interfaces_bonding": ["vpp_interfaces_bonding"], + "vpp_interfaces_bridge": ["vpp_interfaces_bridge"], + "vpp_interfaces_ethernet": ["vpp_interfaces_ethernet"], + "vpp_interfaces_geneve": ["vpp_interfaces_geneve"], + "vpp_interfaces_gre": ["vpp_interfaces_gre"], + "vpp_interfaces_ipip": ["vpp_interfaces_ipip"], + "vpp_interfaces_loopback": ["vpp_interfaces_loopback"], + "vpp_interfaces_vxlan": ["vpp_interfaces_vxlan"], + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"], + "vpp_sflow": ["vpp_sflow"] + }, + "vpp_interfaces_bonding": { + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_ethernet": { + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_geneve": { + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_gre": { + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_ipip": { + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_loopback": { + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + }, + "vpp_interfaces_vxlan": { + "vpp_interfaces_bridge": ["vpp_interfaces_bridge"], + "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_acl": ["vpp_acl"], + "vpp_nat": ["vpp_nat"], + "vpp_nat_cgnat": ["vpp_nat_cgnat"], + "vpp_kernel_interface": ["vpp_kernel-interfaces"] + } +} + diff --git a/data/templates/vpp/override.conf.j2 b/data/templates/vpp/override.conf.j2 new file mode 100644 index 000000000..04bb7be15 --- /dev/null +++ b/data/templates/vpp/override.conf.j2 @@ -0,0 +1,14 @@ +[Unit] +After= +After=vyos-router.service +ConditionPathExists= +ConditionPathExists=/run/vpp/vpp.conf +OnFailure=vpp-failure-handler.service + +[Service] +EnvironmentFile= +ExecStart= +ExecStart=/usr/bin/vpp -c /run/vpp/vpp.conf +WorkingDirectory= +WorkingDirectory=/run/vpp +Restart=no diff --git a/data/templates/vpp/startup.conf.j2 b/data/templates/vpp/startup.conf.j2 new file mode 100644 index 000000000..b7515889a --- /dev/null +++ b/data/templates/vpp/startup.conf.j2 @@ -0,0 +1,209 @@ +# Generated by ${vyos_conf_scripts_dir}/vpp.py + +unix { + nodaemon + log /var/log/vpp.log + full-coredump + cli-listen /run/vpp/cli.sock + gid vpp + # exec /etc/vpp/bootstrap.vpp +{% if unix is vyos_defined %} +{% if unix.poll_sleep_usec is vyos_defined %} + poll-sleep-usec {{ unix.poll_sleep_usec }} +{% endif %} +{% endif %} +} + +{% if cpu is vyos_defined %} +cpu { +{% if cpu.main_core is vyos_defined %} + main-core {{ cpu.main_core }} +{% endif %} +{% if cpu.corelist_workers is vyos_defined %} + corelist-workers {{ cpu.corelist_workers | join(',') }} +{% endif %} +{% if cpu.skip_cores is vyos_defined %} + skip-cores {{ cpu.skip_cores }} +{% endif %} +{% if cpu.workers is vyos_defined %} + workers {{ cpu.workers }} +{% endif %} +} +{% endif %} + +{% if buffers is vyos_defined %} +buffers { +{% if buffers.buffers_per_numa is vyos_defined %} + buffers-per-numa {{ buffers.buffers_per_numa }} +{% endif %} +{% if buffers.data_size is vyos_defined %} + default data-size {{ buffers.data_size }} +{% endif %} +{% if buffers.page_size is vyos_defined %} + page-size {{ buffers.page_size }} +{% endif %} +} +{% endif %} + +{% if ipv6 is vyos_defined %} +ip6 { +{% if ipv6.hash_buckets is vyos_defined %} + hash-buckets {{ ipv6.hash_buckets }} +{% endif %} +{% if ipv6.heap_size is vyos_defined %} + heap-size {{ ipv6.heap_size }} +{% endif %} +} +{% endif %} + +{% if l2learn is vyos_defined %} +l2learn { +{% if l2learn.limit is vyos_defined %} + limit {{ l2learn.limit }} +{% endif %} +} +{% endif %} + +{% if logging is vyos_defined %} +logging { +{% if logging.default_log_level is vyos_defined %} + default-log-level {{ logging.default_log_level }} + default-syslog-log-level {{ logging.default_log_level }} +{% endif %} +} +{% endif %} + +{% if physmem is vyos_defined %} +physmem { +{% if physmem.max_size is vyos_defined %} + max-size {{ physmem.max_size }} +{% endif %} +} +{% endif %} + +plugins { + path /usr/lib/x86_64-linux-gnu/vpp_plugins/ + plugin default { disable } + plugin af_xdp_plugin.so { enable } + plugin avf_plugin.so { enable } + plugin dpdk_plugin.so { enable } + plugin vmxnet3_plugin.so { enable } + plugin lacp_plugin.so { enable } + plugin linux_cp_plugin.so { enable } + plugin linux_nl_plugin.so { enable } + plugin pppoe_plugin.so { enable } + plugin sflow_plugin.so { enable } + # NAT uncomment if needed + # plugin cnat_plugin.so { enable } + plugin nat_plugin.so { enable } + plugin nat44_ei_plugin.so { enable } + plugin det44_plugin.so { enable } + # plugin nat44_ei_plugin.so { enable } + # plugin nat64_plugin.so { enable } + # plugin nat66_plugin.so { enable } + # plugin pnat_plugin.so { enable } + # Tunnels + plugin geneve_plugin.so { enable } + plugin gre_plugin.so { enable } + plugin vxlan_plugin.so { enable } + # Secure + # plugin ikev2_plugin.so { enable } + # plugin dns_plugin.so { enable } # Probably required for FQDN peers +{% if ipsec is vyos_defined %} + plugin crypto_ipsecmb_plugin.so { enable } + plugin crypto_native_plugin.so { enable } + plugin crypto_openssl_plugin.so { enable } +{% endif %} + # plugin wireguard_plugin.so { enable } + # ACL + plugin acl_plugin.so { enable } +} + +linux-cp { + lcp-sync + lcp-auto-subint +{% if lcp.ignore_kernel_routes is not vyos_defined %} + route-no-paths +{% endif %} +} + +{% if lcp.netlink is vyos_defined %} +linux-nl { +{% if lcp.netlink.rx_buffer_size is vyos_defined %} + nl-rx-buffer-size {{ lcp.netlink.rx_buffer_size }} +{% endif %} +{% if lcp.netlink.batch_size is vyos_defined %} + nl-batch-size {{ lcp.netlink.batch_size }} +{% endif %} +{% if lcp.netlink.batch_delay_ms is vyos_defined %} + nl-batch-delay-ms {{ lcp.netlink.batch_delay_ms }} +{% endif %} +} +{% endif %} + +{% if statseg is vyos_defined %} +statseg { +{% if statseg.size is vyos_defined %} + size {{ statseg.size }} +{% endif %} +{% if statseg.page_size is vyos_defined %} + page-size {{ statseg.page_size }} +{% endif %} +} +{% endif %} + +{% if memory is vyos_defined %} +memory { +{% if memory.main_heap_size is vyos_defined %} + main-heap-size {{ memory.main_heap_size }} +{% endif %} +{% if memory.main_heap_page_size is vyos_defined %} + main-heap-page-size {{ memory.main_heap_page_size }} +{% endif %} +{% if memory.default_hugepage_size is vyos_defined %} + default-hugepage-size {{ memory.default_hugepage_size }} +{% endif %} +} +{% endif %} + +dpdk { + # Whitelist the fake PCI address 0000:00:00.0 + # This prevents all devices from being added to VPP-DPDK by default + dev 0000:00:00.0 +{% for iface, iface_config in interface.items() %} +{% if iface_config.driver == 'dpdk' %} + dev {{ iface_config.dpdk_options.dev_id }} { + name {{ iface }} +{% if iface_config.dpdk_options.num_rx_desc is vyos_defined %} + num-rx-desc {{ iface_config.dpdk_options.num_rx_desc }} +{% endif %} +{% if iface_config.dpdk_options.num_tx_desc is vyos_defined %} + num-tx-desc {{ iface_config.dpdk_options.num_tx_desc }} +{% endif %} +{% if iface_config.dpdk_options.num_rx_queues is vyos_defined %} + num-rx-queues {{ iface_config.dpdk_options.num_rx_queues }} +{% endif %} +{% if iface_config.dpdk_options.num_tx_queues is vyos_defined %} + num-tx-queues {{ iface_config.dpdk_options.num_tx_queues }} +{% endif %} + } +{% endif %} +{% endfor %} + uio-bind-force +} + +{% if ipsec is vyos_defined %} +linux-xfrm-nl { + enable-route-mode-ipsec + interface {{ ipsec.interface_type }} +{% if ipsec.netlink.batch_delay_ms is vyos_defined %} + nl-batch-delay-ms {{ ipsec.netlink.batch_delay_ms }} +{% endif %} +{% if ipsec.netlink.batch_size is vyos_defined %} + nl-batch-size {{ ipsec.netlink.batch_size }} +{% endif %} +{% if ipsec.netlink.rx_buffer_size is vyos_defined %} + nl-rx-buffer-size {{ ipsec.netlink.rx_buffer_size }} +{% endif %} +} +{% endif %} |
