diff --git a/Dockerfile b/Dockerfile index fd7db80f2..f0f1f92fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,7 +100,6 @@ ARG DPSERVICE_FEATURES="" RUN meson setup release_build $DPSERVICE_FEATURES --buildtype=release && ninja -C release_build RUN CC=clang CXX=clang++ meson setup clang_build $DPSERVICE_FEATURES && ninja -C clang_build RUN meson setup xtratest_build $DPSERVICE_FEATURES -Denable_tests=true && ninja -C xtratest_build -RUN meson setup pf1_proxy_build $DPSERVICE_FEATURES -Denable_pf1_proxy=true && ninja -C pf1_proxy_build # Test-image to run pytest diff --git a/docs/deployment/help_dpservice-bin.md b/docs/deployment/help_dpservice-bin.md index b28e0ade0..960fb61e0 100644 --- a/docs/deployment/help_dpservice-bin.md +++ b/docs/deployment/help_dpservice-bin.md @@ -6,8 +6,6 @@ | -v, --version | None | display version and exit | | | --pf0 | IFNAME | first physical interface (e.g. eth0) | | | --pf1 | IFNAME | second physical interface (e.g. eth1) | | -| --pf1-proxy | IFNAME | VF representor to use as a proxy for pf1 packets | | -| --pf1-proxy-vf | IFNAME | VF interface of the pf1-proxy VF representor | | | --ipv6 | ADDR6 | IPv6 underlay address | | | --vf-pattern | PATTERN | virtual interface name pattern (e.g. 'eth1vf') | | | --dhcp-mtu | SIZE | set the mtu field in DHCP responses (68 - 1500) | | diff --git a/docs/deployment/mellanox.md b/docs/deployment/mellanox.md index 2c6103360..f0c595f4f 100644 --- a/docs/deployment/mellanox.md +++ b/docs/deployment/mellanox.md @@ -43,9 +43,11 @@ For this mode to be functional, an additional firmware setting `LAG_RESOURCE_ALL In some cases (looks like a nic/switch combination) performance is severly affected when VM traffic is happening. This has been observed to be fixed by setting `ROCE_CONTROL=1` (this means "disabled", the default is `2` meaning "enabled"). The actual cause of this is yet to be discovered. +> For this to work, kernal has to have "TC recirculation support" (CONFIG_NET_TC_SKB_EXT) enabled. This is not the default for Debian. + ## Dp-service setup Either `prepare.sh` script or `preparedp.service` systemd unit needs to be run before dp-service can work properly. This should already be done automatically if using the Docker image provided. Make sure this does not produce any errors. ### Multiport-eswitch -The `prepare.sh` script supports `--multiport-eswitch` argument to set the card up in multiport-eswitch mode. There is an additional `--pf1-proxy` argument to also create a VF on PF1 for proxying PF1 traffic. Currently both arguments are needed to properly run dpservice in multiport-eswitch mode due to a (suspected) driver bug. +The `prepare.sh` script supports `--multiport-eswitch` argument to set the card up in multiport-eswitch mode. diff --git a/docs/development/running.md b/docs/development/running.md index 69b976b28..22b36c409 100644 --- a/docs/development/running.md +++ b/docs/development/running.md @@ -80,10 +80,3 @@ In this mode, only the PF0 (which is bonded with PF1) needs to be specified: ```bash ./dpservice-bin -a 0000:03:00.0,class=rxq_cqe_comp_en=0,rx_vec_en=1,dv_flow_en=2,dv_esw_en=1,fdb_def_rule_en=1,representor=pf[0-1]vf[0-5] -l 0,1 -- --pf0=enp59s0f1 --pf1=enp59s0f1 --vf-pattern=enp59s0f0_ --ipv6=2a10:afc0:e01f:209:: --no-stats --no-offload --multiport-eswitch ``` - -#### PF1-proxy -In multiport-eswitch mode, currently PF1 is not usable (suspected driver problem), so dpservice provides a way to proxy the communication over a separate VF on PF1. -```bash -./dpservice-bin -a 0000:03:00.0,class=rxq_cqe_comp_en=0,rx_vec_en=1,dv_flow_en=2,dv_esw_en=1,fdb_def_rule_en=1,representor=pf[0-1]vf[0-5] -l 0,1 -- --pf0=enp59s0f1 --pf1=enp59s0f1 --vf-pattern=enp59s0f0_ --ipv6=2a10:afc0:e01f:209:: --no-stats --no-offload --multiport-eswitch --pf1-proxy enp59s0f1npf1vf0 --pf1-proxy-vf enp59s0f1v0 -``` -The `--pf1-proxy` is the representor used by dpservice for proxying packets. The `--pf1-proxy-vf` is the VF used by the Linux kernel to receive packets, i.e. the replacement for PF1. Without `--pf1-proxy-vf` dpservice is unable to determine the MAC address to use for host-host overlay traffic. diff --git a/docs/sys_design/README.md b/docs/sys_design/README.md index 1d07e49a6..4e693a0dc 100644 --- a/docs/sys_design/README.md +++ b/docs/sys_design/README.md @@ -5,14 +5,6 @@ This is the graph topology for packets handled by dpservice. Offloaded packets n Note that every graph node actually has one other edge to it that leads to a **"Drop"** node, but for clarity this is omitted. As the name suggests, that node has no other edge and is simply dropping the packets without sending them anywhere. -## PF1-proxy -When using a (conditionally compiled-in) pf1-proxy feature, all traffic for the host (i.e. not underlay traffic for dpservice) needs to be forwarded to a special VF on PF1 called "pf1-proxy" and back. - -### Traffic from proxy to PF1 -Since **all packets** without exception need to be forwarded directly to PF1, an rte-rule is installed to do just that, so all packets are offloaded and never enter the graph. - -### Traffic from PF1 to proxy -Only non-underlay IPv6 packets, i.e. IPv6 packets with destination IP matching the host's IP (`--ipv6` command-line argument) are directly forwarded by offloading via an rte-rule. The remaining packets enter dpservice normally and if they are classified as "unusable" (i.e. should be dropped by "Classify" node), they are instead forwarded to pf1-proxy. See the dashed graph edge above. ## Virtual services If virtual services are compiled-in, there is another path for packets to take. Packets going from a virtual IPv4 and TCP/UDP port to a specific web-service (i.e. specific IPv6 and TCP/UDP port) undergo an IP header replacement (from IPv4 to IPv6 and back) to enable VMs to contact IPv6 web-services without the use of NAT. This is useful for services that are heavily used by many connections, like DNS, k8s api-servers, etc. diff --git a/hack/dp_conf.json b/hack/dp_conf.json index 75387ee4d..c4c3c40c7 100644 --- a/hack/dp_conf.json +++ b/hack/dp_conf.json @@ -19,24 +19,6 @@ "type": "char", "array_size": "IF_NAMESIZE" }, - { - "lgopt": "pf1-proxy", - "arg": "IFNAME", - "help": "VF representor to use as a proxy for pf1 packets", - "var": "pf1_proxy", - "type": "char", - "array_size": "IF_NAMESIZE", - "ifdef": "ENABLE_PF1_PROXY" - }, - { - "lgopt": "pf1-proxy-vf", - "arg": "IFNAME", - "help": "VF interface of the pf1-proxy VF representor", - "var": "pf1_proxy_vf", - "type": "char", - "array_size": "IF_NAMESIZE", - "ifdef": "ENABLE_PF1_PROXY" - }, { "lgopt": "ipv6", "arg": "ADDR6", diff --git a/hack/prepare.sh b/hack/prepare.sh index 54bf807b1..640bf0833 100755 --- a/hack/prepare.sh +++ b/hack/prepare.sh @@ -10,7 +10,6 @@ set -Eeuo pipefail # OPT_MULTIPORT=false -OPT_PF1_PROXY=false BLUEFIELD_IDENTIFIERS=("MT_0000000543", "MT_0000000541") MAX_NUMVFS_POSSIBLE=126 @@ -166,10 +165,6 @@ function create_vf() { # plus we don't need to unbind them before enabling switchdev mode log "disabling automatic binding of VFs on pf0 '$pf0'" echo 0 > /sys/bus/pci/devices/$pf0/sriov_drivers_autoprobe - if [[ "$OPT_PF1_PROXY" == "true" ]]; then - log "enabling automatic binding of VFs on pf1 '$pf1'" - echo 1 > /sys/bus/pci/devices/$pf1/sriov_drivers_autoprobe - fi if [[ "$IS_X86_WITH_MLX" == "true" ]]; then # enable switchdev mode, this operation takes most time @@ -193,20 +188,6 @@ function create_vf() { actualvfs=$((NUMVFS_DESIRED /sys/bus/pci/devices/$pf0/sriov_numvfs - if [[ "$OPT_PF1_PROXY" == "true" ]]; then - log "creating pf1-proxy virtual function" - echo 1 > /sys/bus/pci/devices/$pf1/sriov_numvfs - log "configuring pf1-proxy" - local pf1proxy=$(get_pf1_proxy $pf1) - ip link set $pf1proxy mtu 9100 - ip link set $pf1proxy up - local pf1_name=$(get_ifname 1) - local pf1_mac=$(cat /sys/class/net/$pf1_name/address) - local pf1proxy_vf=$(get_pf1_proxy_vf) - ip link set $pf1proxy_vf mtu 9100 - ip link set $pf1proxy_vf address $pf1_mac - ip link set $pf1proxy_vf up - fi } function get_pattern() { @@ -220,27 +201,6 @@ function get_pattern() { echo "$pattern" } -function get_pf1_proxy() { - local dev=$1 - proxy=$(devlink port | grep pci/$dev/ | grep "virtual\|pcivf" | awk '{print $5}' | uniq) - if [ -z "$proxy" ]; then - err "can't determine the pf1-proxy vf for $dev" - elif [ $(wc -l <<< "$proxy") -ne 1 ]; then - err "multiple pf1-proxy devices found for $dev" - fi - echo "$proxy" -} - -function get_pf1_proxy_vf() { - vf=$(devlink port | grep auxiliary/mlx5_core.eth.2/ | grep virtual | awk '{print $5}' | uniq) - if [ -z "$vf" ]; then - err "can't determine the pf1-proxy vf" - elif [ $(wc -l <<< "$vf") -ne 1 ]; then - err "multiple pf1-proxy vfs found" - fi - echo "$vf" -} - function get_ifname() { local port=$1 devlink port | grep "physical port $port" | awk '{ print $5}' @@ -268,10 +228,6 @@ function make_config() { conf_pf1="$(get_ifname 1)" conf_vf_pattern="$(get_pattern ${devs[0]})" conf_ipv6="$(get_ipv6)" - if [[ "$OPT_MULTIPORT" == "true" ]]; then - conf_pf1_proxy="$(get_pf1_proxy ${devs[1]})" - conf_pf1_proxy_vf="$(get_pf1_proxy_vf)" - fi { echo "# This has been generated by prepare.sh" echo "no-stats" @@ -281,10 +237,6 @@ function make_config() { echo "ipv6 $conf_ipv6" if [[ "$OPT_MULTIPORT" == "true" ]]; then echo "a-pf0 ${devs[0]},class=rxq_cqe_comp_en=0,rx_vec_en=1,dv_flow_en=2,dv_esw_en=1,fdb_def_rule_en=1,representor=pf[0-1]vf[0-$[$actualvfs-1]]" - if [[ "$OPT_PF1_PROXY" == "true" ]]; then - echo "pf1-proxy $conf_pf1_proxy" - echo "pf1-proxy-vf $conf_pf1_proxy_vf" - fi echo "multiport-eswitch" else echo "a-pf0 ${devs[0]},class=rxq_cqe_comp_en=0,rx_vec_en=1,representor=pf[0]vf[0-$[$actualvfs-1]]" @@ -293,9 +245,6 @@ function make_config() { if [[ "$OPT_MULTIPORT" == "true" ]]; then log "dpservice configured in multiport-eswitch mode" - if [[ "$OPT_PF1_PROXY" == "true" ]]; then - log "dpservice will create a pf1-proxy" - fi else log "dpservice configured in normal mode" fi @@ -312,9 +261,6 @@ while [[ $# -gt 0 ]]; do --multiport-eswitch) OPT_MULTIPORT=true ;; - --pf1-proxy) - OPT_PF1_PROXY=true - ;; --force) CONFIG_EXISTS=false ;; diff --git a/include/dp_conf.h b/include/dp_conf.h index 318b8e412..4526a05e7 100644 --- a/include/dp_conf.h +++ b/include/dp_conf.h @@ -48,10 +48,6 @@ const union dp_ipv6 *dp_conf_get_underlay_ip(void); const struct dp_conf_dhcp_dns *dp_conf_get_dhcp_dns(void); const struct dp_conf_dhcp_dns *dp_conf_get_dhcpv6_dns(void); -#ifdef ENABLE_PF1_PROXY -bool dp_conf_is_pf1_proxy_enabled(void); -#endif - #ifdef ENABLE_VIRTSVC const struct dp_conf_virtual_services *dp_conf_get_virtual_services(void); #endif diff --git a/include/dp_conf_opts.h b/include/dp_conf_opts.h index a7c0b2dd1..33d9f8260 100644 --- a/include/dp_conf_opts.h +++ b/include/dp_conf_opts.h @@ -27,12 +27,6 @@ enum dp_conf_log_format { const char *dp_conf_get_pf0_name(void); const char *dp_conf_get_pf1_name(void); -#ifdef ENABLE_PF1_PROXY -const char *dp_conf_get_pf1_proxy(void); -#endif -#ifdef ENABLE_PF1_PROXY -const char *dp_conf_get_pf1_proxy_vf(void); -#endif const char *dp_conf_get_vf_pattern(void); int dp_conf_get_dhcp_mtu(void); int dp_conf_get_wcmp_perc(void); diff --git a/include/dp_port.h b/include/dp_port.h index 74886899e..793ce45a9 100644 --- a/include/dp_port.h +++ b/include/dp_port.h @@ -58,10 +58,6 @@ struct dp_port_async_template { enum dp_port_async_template_type { DP_PORT_ASYNC_TEMPLATE_PF_ISOLATION, -#ifdef ENABLE_PF1_PROXY - DP_PORT_ASYNC_TEMPLATE_PF1_FROM_PROXY, - DP_PORT_ASYNC_TEMPLATE_PF1_TO_PROXY, -#endif #ifdef ENABLE_VIRTSVC DP_PORT_ASYNC_TEMPLATE_VIRTSVC_TCP_ISOLATION, DP_PORT_ASYNC_TEMPLATE_VIRTSVC_UDP_ISOLATION, @@ -72,10 +68,6 @@ enum dp_port_async_template_type { enum dp_port_async_flow_type { DP_PORT_ASYNC_FLOW_ISOLATE_IPIP, DP_PORT_ASYNC_FLOW_ISOLATE_IPV6, -#ifdef ENABLE_PF1_PROXY - DP_PORT_ASYNC_FLOW_PF1_FROM_PROXY, - DP_PORT_ASYNC_FLOW_PF1_TO_PROXY, -#endif DP_PORT_ASYNC_FLOW_COUNT, }; @@ -120,9 +112,6 @@ struct dp_ports { // hidden structures for inline functions to access extern struct dp_port *_dp_port_table[DP_MAX_PORTS]; extern struct dp_port *_dp_pf_ports[DP_MAX_PF_PORTS]; -#ifdef ENABLE_PF1_PROXY -extern struct dp_port _dp_pf1_proxy_port; -#endif extern struct dp_ports _dp_ports; @@ -134,9 +123,6 @@ void dp_ports_free(void); int dp_start_port(struct dp_port *port); int dp_start_pf_port(uint16_t index); -#ifdef ENABLE_PF1_PROXY -int dp_start_pf1_proxy_port(void); -#endif int dp_stop_port(struct dp_port *port); void dp_start_acquiring_neigh_mac(struct dp_port *port); @@ -210,14 +196,6 @@ struct dp_port *dp_get_port_by_pf_index(uint16_t index) return index < RTE_DIM(_dp_pf_ports) ? _dp_pf_ports[index] : NULL; } -#ifdef ENABLE_PF1_PROXY -static __rte_always_inline -const struct dp_port *dp_get_pf1_proxy(void) -{ - return &_dp_pf1_proxy_port; -} -#endif - #ifdef __cplusplus } #endif diff --git a/include/dpdk_layer.h b/include/dpdk_layer.h index df0010825..0af00de62 100644 --- a/include/dpdk_layer.h +++ b/include/dpdk_layer.h @@ -14,11 +14,7 @@ extern "C" { #define DP_MAX_PF_PORTS 2 #define DP_MAX_VF_PORTS 126 -#ifdef ENABLE_PF1_PROXY -#define DP_MAX_PORTS (DP_MAX_PF_PORTS + DP_MAX_VF_PORTS + 1) -#else #define DP_MAX_PORTS (DP_MAX_PF_PORTS + DP_MAX_VF_PORTS) -#endif #define DP_NR_STD_RX_QUEUES 1 #define DP_NR_STD_TX_QUEUES 1 @@ -47,17 +43,8 @@ extern "C" { // max Ether MTU 1500 + frame header 14 + frame footer 4 + IPv6 tunnel header 40 #define DP_MBUF_BUF_SIZE (1558 + RTE_PKTMBUF_HEADROOM) -#ifdef ENABLE_PF1_PROXY -#define DP_JUMBO_MBUF_POOL_SIZE (50*1024) -// max Jumbo Ether MTU 9100 + frame header 14 + frame footer 4 -#define DP_JUMBO_MBUF_BUF_SIZE (9118 + RTE_PKTMBUF_HEADROOM) -#endif - struct dp_dpdk_layer { struct rte_mempool *rte_mempool; -#ifdef ENABLE_PF1_PROXY - struct rte_mempool *rte_jumbo_mempool; -#endif struct rte_ring *grpc_tx_queue; struct rte_ring *grpc_rx_queue; struct rte_ring *periodic_msg_queue; diff --git a/include/nodes/cls_node.h b/include/nodes/cls_node.h deleted file mode 100644 index 04ca2f57c..000000000 --- a/include/nodes/cls_node.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors -// SPDX-License-Identifier: Apache-2.0 - -#ifndef __INCLUDE_CLS_NODE_H__ -#define __INCLUDE_CLS_NODE_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ENABLE_PF1_PROXY -int cls_node_append_tx(uint16_t port_id, const char *tx_node_name); -#endif - -#ifdef __cplusplus -} -#endif -#endif diff --git a/include/rte_flow/dp_rte_async_flow_pf1_proxy.h b/include/rte_flow/dp_rte_async_flow_pf1_proxy.h deleted file mode 100644 index cf9cd1efe..000000000 --- a/include/rte_flow/dp_rte_async_flow_pf1_proxy.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors -// SPDX-License-Identifier: Apache-2.0 - -#ifndef __INCLUDE_DP_RTE_FLOW_ASYNC_FLOW_PF1_PROXY_H__ -#define __INCLUDE_DP_RTE_FLOW_ASYNC_FLOW_PF1_PROXY_H__ - -#define DP_PF1_PROXY_RULE_COUNT 2 - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dp_port.h" - -int dp_create_pf_async_from_proxy_templates(struct dp_port *port); -int dp_create_pf_async_to_proxy_templates(struct dp_port *port); - -uint16_t dp_create_pf1_proxy_async_isolation_rules(struct dp_port *port); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/rte_flow/dp_rte_flow_helpers.h b/include/rte_flow/dp_rte_flow_helpers.h index 0953c97c0..7061a2975 100644 --- a/include/rte_flow/dp_rte_flow_helpers.h +++ b/include/rte_flow/dp_rte_flow_helpers.h @@ -38,12 +38,6 @@ union dp_flow_item_l4 { struct rte_flow_item_icmp6 icmp6; }; -#ifdef ENABLE_PF1_PROXY -static const struct rte_flow_item_ethdev dp_flow_item_ethdev_mask = { - .port_id = 0xffff, -}; -#endif - static const struct rte_flow_item_eth dp_flow_item_eth_mask = { .hdr.ether_type = 0xffff, }; @@ -75,11 +69,6 @@ static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_src_dst_mask = { .hdr.proto = 0xff, }; #endif -#ifdef ENABLE_PF1_PROXY -static const struct rte_flow_item_ipv6 dp_flow_item_ipv6_dst_only_mask = { - .hdr.dst_addr = "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", -}; -#endif static const struct rte_flow_item_ipv4 dp_flow_item_ipv4_dst_mask = { .hdr.dst_addr = 0xffffffff, diff --git a/meson.build b/meson.build index e5665970d..ed92177cc 100644 --- a/meson.build +++ b/meson.build @@ -56,9 +56,6 @@ endif if get_option('enable_tests') add_global_arguments('-DENABLE_PYTEST', language: ['c', 'cpp']) endif -if get_option('enable_pf1_proxy') - add_global_arguments('-DENABLE_PF1_PROXY', language: ['c', 'cpp']) -endif dpdk_dep = dependency('libdpdk', version: '>=21.11.0') proto_dep = dependency('protobuf') diff --git a/meson_options.txt b/meson_options.txt index c236b51a4..c8f35c1c3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,6 +10,3 @@ option('compiler_suggestions', type: 'boolean', value: false, description: 'Show various compiler suggestions (warnings)') option('build_dpservice_cli', type: 'boolean', value: false, description: 'Enable building of dpservice-cli golang gRPC client') -option('enable_pf1_proxy', type: 'boolean', value: false, description: - 'Enable the workaround solution to allow PF1 to communicate with the outside world') - diff --git a/src/dp_conf.c b/src/dp_conf.c index 2e6767d34..2081345a4 100644 --- a/src/dp_conf.c +++ b/src/dp_conf.c @@ -38,13 +38,6 @@ static struct dp_conf_dhcp_dns dhcpv6_dns = {0}; static struct dp_conf_virtual_services virtual_services = {0}; #endif -#ifdef ENABLE_PF1_PROXY -bool dp_conf_is_pf1_proxy_enabled(void) -{ - return *pf1_proxy; -} -#endif - int dp_conf_is_wcmp_enabled(void) { return wcmp_perc < 100; diff --git a/src/dp_conf_opts.c b/src/dp_conf_opts.c index a06d718cd..a2ef668cf 100644 --- a/src/dp_conf_opts.c +++ b/src/dp_conf_opts.c @@ -20,12 +20,6 @@ enum { _OPT_SHOPT_MAX = 255, OPT_PF0, OPT_PF1, -#ifdef ENABLE_PF1_PROXY - OPT_PF1_PROXY, -#endif -#ifdef ENABLE_PF1_PROXY - OPT_PF1_PROXY_VF, -#endif OPT_IPV6, OPT_VF_PATTERN, OPT_DHCP_MTU, @@ -62,12 +56,6 @@ static const struct option dp_conf_longopts[] = { { "version", 0, 0, OPT_VERSION }, { "pf0", 1, 0, OPT_PF0 }, { "pf1", 1, 0, OPT_PF1 }, -#ifdef ENABLE_PF1_PROXY - { "pf1-proxy", 1, 0, OPT_PF1_PROXY }, -#endif -#ifdef ENABLE_PF1_PROXY - { "pf1-proxy-vf", 1, 0, OPT_PF1_PROXY_VF }, -#endif { "ipv6", 1, 0, OPT_IPV6 }, { "vf-pattern", 1, 0, OPT_VF_PATTERN }, { "dhcp-mtu", 1, 0, OPT_DHCP_MTU }, @@ -117,12 +105,6 @@ static const char *log_format_choices[] = { static char pf0_name[IF_NAMESIZE]; static char pf1_name[IF_NAMESIZE]; -#ifdef ENABLE_PF1_PROXY -static char pf1_proxy[IF_NAMESIZE]; -#endif -#ifdef ENABLE_PF1_PROXY -static char pf1_proxy_vf[IF_NAMESIZE]; -#endif static char vf_pattern[IF_NAMESIZE]; static int dhcp_mtu = 1500; static int wcmp_perc = 100; @@ -152,20 +134,6 @@ const char *dp_conf_get_pf1_name(void) return pf1_name; } -#ifdef ENABLE_PF1_PROXY -const char *dp_conf_get_pf1_proxy(void) -{ - return pf1_proxy; -} - -#endif -#ifdef ENABLE_PF1_PROXY -const char *dp_conf_get_pf1_proxy_vf(void) -{ - return pf1_proxy_vf; -} - -#endif const char *dp_conf_get_vf_pattern(void) { return vf_pattern; @@ -262,12 +230,6 @@ static inline void dp_argparse_help(const char *progname, FILE *outfile) " -v, --version display version and exit\n" " --pf0=IFNAME first physical interface (e.g. eth0)\n" " --pf1=IFNAME second physical interface (e.g. eth1)\n" -#ifdef ENABLE_PF1_PROXY - " --pf1-proxy=IFNAME VF representor to use as a proxy for pf1 packets\n" -#endif -#ifdef ENABLE_PF1_PROXY - " --pf1-proxy-vf=IFNAME VF interface of the pf1-proxy VF representor\n" -#endif " --ipv6=ADDR6 IPv6 underlay address\n" " --vf-pattern=PATTERN virtual interface name pattern (e.g. 'eth1vf')\n" " --dhcp-mtu=SIZE set the mtu field in DHCP responses (68 - 1500)\n" @@ -306,14 +268,6 @@ static int dp_conf_parse_arg(int opt, const char *arg) return dp_argparse_string(arg, pf0_name, ARRAY_SIZE(pf0_name)); case OPT_PF1: return dp_argparse_string(arg, pf1_name, ARRAY_SIZE(pf1_name)); -#ifdef ENABLE_PF1_PROXY - case OPT_PF1_PROXY: - return dp_argparse_string(arg, pf1_proxy, ARRAY_SIZE(pf1_proxy)); -#endif -#ifdef ENABLE_PF1_PROXY - case OPT_PF1_PROXY_VF: - return dp_argparse_string(arg, pf1_proxy_vf, ARRAY_SIZE(pf1_proxy_vf)); -#endif case OPT_IPV6: return dp_argparse_opt_ipv6(arg); case OPT_VF_PATTERN: diff --git a/src/dp_graph.c b/src/dp_graph.c index 76c28e454..0af56663f 100644 --- a/src/dp_graph.c +++ b/src/dp_graph.c @@ -10,7 +10,6 @@ #include "dp_timers.h" #include "monitoring/dp_graphtrace.h" #include "nodes/arp_node.h" -#include "nodes/cls_node.h" #include "nodes/dhcp_node.h" #include "nodes/dhcpv6_node.h" #include "nodes/ipip_encap_node.h" @@ -121,37 +120,6 @@ static rte_graph_t dp_graph_create(unsigned int lcore_id) return graph_id; } -#ifdef ENABLE_PF1_PROXY -static int dp_graph_init_pf1_proxy(void) -{ - char name[RTE_NODE_NAMESIZE]; - uint16_t port_id; - - if (!dp_conf_is_pf1_proxy_enabled()) - return DP_OK; - - // pf1-proxy is not part of dp_ports list - // so create a separate Tx and wire Tx to CLS node - port_id = dp_get_pf1_proxy()->port_id; - - // Note that there is no Rx node since all pf1-proxy -> pf1 packets are offloaded - if (DP_FAILED(tx_node_create(port_id))) - return DP_ERROR; - - snprintf(name, sizeof(name), "tx-%u", port_id); - if (DP_FAILED(cls_node_append_tx(port_id, name))) - return DP_ERROR; - - // also wire the PF1 Tx for return path - port_id = dp_get_pf1()->port_id; - snprintf(name, sizeof(name), "tx-%u", port_id); - if (DP_FAILED(cls_node_append_tx(port_id, name))) - return DP_ERROR; - - return DP_OK; -} -#endif - static int dp_graph_init_nodes(void) { char name[RTE_NODE_NAMESIZE]; @@ -203,11 +171,6 @@ int dp_graph_init(void) if (DP_FAILED(dp_graph_init_nodes())) return DP_ERROR; -#ifdef ENABLE_PF1_PROXY - if (DP_FAILED(dp_graph_init_pf1_proxy())) - return DP_ERROR; -#endif - // find the right core(s) to run on // start from second core, first core is for main loop, not graph for (unsigned int lcore_id = 1; lcore_id < RTE_MAX_LCORE; ++lcore_id) { diff --git a/src/dp_port.c b/src/dp_port.c index 0f42c1192..0176be84d 100644 --- a/src/dp_port.c +++ b/src/dp_port.c @@ -17,7 +17,6 @@ #include "nodes/rx_node.h" #include "rte_flow/dp_rte_async_flow.h" #include "rte_flow/dp_rte_async_flow_isolation.h" -#include "rte_flow/dp_rte_async_flow_pf1_proxy.h" #include "rte_flow/dp_rte_async_flow_template.h" #include "rte_flow/dp_rte_flow.h" #include "rte_flow/dp_rte_flow_capture.h" @@ -26,9 +25,6 @@ #define DP_PORT_INIT_PF true #define DP_PORT_INIT_VF false -#define DP_PORT_PROXIED true -#define DP_PORT_NORMAL false - #define DP_PORT_NEIGHMAC_INITIAL_PERIOD 1 #define DP_PORT_NEIGHMAC_BACKOFF_COEF 2 #define DP_PORT_NEIGHMAC_MAX_PERIOD 60 @@ -61,9 +57,6 @@ static const struct rte_meter_srtcm_params dp_srtcm_params_base = { struct dp_port *_dp_port_table[DP_MAX_PORTS]; struct dp_port *_dp_pf_ports[DP_MAX_PF_PORTS]; -#ifdef ENABLE_PF1_PROXY -struct dp_port _dp_pf1_proxy_port; -#endif struct dp_ports _dp_ports; static int dp_port_register_pf(struct dp_port *port) @@ -102,7 +95,6 @@ static int dp_port_init_ethdev(struct dp_port *port, struct rte_eth_dev_info *de struct rte_eth_rxconf rxq_conf; struct rte_eth_conf port_conf = port_conf_default; uint16_t nr_hairpin_queues; - struct rte_mempool *mempool; int ret; /* Default config */ @@ -129,15 +121,10 @@ static int dp_port_init_ethdev(struct dp_port *port, struct rte_eth_dev_info *de /* RX and TX queues config */ for (uint16_t i = 0; i < DP_NR_STD_RX_QUEUES; ++i) { - mempool = dp_layer->rte_mempool; -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() && (port == dp_get_pf1() || port == dp_get_pf1_proxy())) - mempool = dp_layer->rte_jumbo_mempool; -#endif ret = rte_eth_rx_queue_setup(port->port_id, i, 1024, port->socket_id, &rxq_conf, - mempool); + dp_layer->rte_mempool); if (DP_FAILED(ret)) { DPS_LOG_ERR("Rx queue setup failed", DP_LOG_PORT(port), DP_LOG_RET(ret)); return DP_ERROR; @@ -221,7 +208,7 @@ static int dp_get_port_socket_id(uint16_t port_id) return socket_id; } -static struct dp_port *dp_port_init_interface(uint16_t port_id, struct rte_eth_dev_info *dev_info, bool is_pf, bool is_proxied) +static struct dp_port *dp_port_init_interface(uint16_t port_id, struct rte_eth_dev_info *dev_info, bool is_pf) { static int last_pf1_hairpin_tx_rx_queue_offset = 1; struct dp_port *port; @@ -232,11 +219,9 @@ static struct dp_port *dp_port_init_interface(uint16_t port_id, struct rte_eth_d if (DP_FAILED(socket_id) && socket_id != SOCKET_ID_ANY) return NULL; - if (is_pf && !is_proxied) { - if (dp_conf_get_nic_type() != DP_CONF_NIC_TYPE_TAP) - if (DP_FAILED(dp_port_flow_isolate(port_id))) - return NULL; - } + if (is_pf && dp_conf_get_nic_type() != DP_CONF_NIC_TYPE_TAP) + if (DP_FAILED(dp_port_flow_isolate(port_id))) + return NULL; // oveflow check done by liming the number of calls to this function port = _dp_ports.end++; @@ -275,38 +260,6 @@ static struct dp_port *dp_port_init_interface(uint16_t port_id, struct rte_eth_d return port; } -#ifdef ENABLE_PF1_PROXY -static struct dp_port *dp_port_init_pf1_proxy_interface(uint16_t port_id, struct rte_eth_dev_info *dev_info) -{ - struct dp_port *port; - uint32_t if_index; - int socket_id; - - socket_id = dp_get_port_socket_id(port_id); - if (DP_FAILED(socket_id) && socket_id != SOCKET_ID_ANY) - return NULL; - - if_index = if_nametoindex(dp_conf_get_pf1_proxy_vf()); - if (if_index == 0) { - DPS_LOG_ERR("Cannot get pf1-proxy vf interface index", DP_LOG_IFACE(dp_conf_get_pf1_proxy_vf())); - return NULL; - } - - port = &_dp_pf1_proxy_port; - port->is_pf = false; - port->port_id = port_id; - port->socket_id = socket_id; - port->if_index = if_index; - rte_timer_init(&port->neighmac_timer); - _dp_port_table[port_id] = port; - - if (DP_FAILED(dp_port_init_ethdev(port, dev_info))) - return NULL; - - return port; -} -#endif - static int dp_port_set_up_hairpins(void) { const struct dp_port *pf0 = dp_get_pf0(); @@ -345,18 +298,12 @@ static int dp_port_init_pf(const char *pf_name) uint16_t port_id; struct rte_eth_dev_info dev_info; struct dp_port *port; - bool proxied; if (DP_FAILED(dp_find_port(pf_name, &port_id, &dev_info))) return DP_ERROR; DPS_LOG_INFO("INIT initializing PF port", DP_LOG_PORTID(port_id), DP_LOG_IFNAME(pf_name)); -#ifdef ENABLE_PF1_PROXY - proxied = dp_conf_is_pf1_proxy_enabled() && !strcmp(pf_name, dp_conf_get_pf1_name()); -#else - proxied = false; -#endif - port = dp_port_init_interface(port_id, &dev_info, DP_PORT_INIT_PF, proxied); + port = dp_port_init_interface(port_id, &dev_info, DP_PORT_INIT_PF); if (!port) return DP_ERROR; @@ -364,29 +311,6 @@ static int dp_port_init_pf(const char *pf_name) return DP_OK; } -#ifdef ENABLE_PF1_PROXY -static int dp_port_init_pf1_proxy(const char *pf1_proxy_name) -{ - uint16_t port_id; - struct rte_eth_dev_info dev_info; - struct dp_port *port; - - if (!dp_conf_is_pf1_proxy_enabled()) - return DP_OK; - - if (DP_FAILED(dp_find_port(pf1_proxy_name, &port_id, &dev_info))) - return DP_ERROR; - - DPS_LOG_INFO("INIT initializing PF1 proxy port", DP_LOG_PORTID(port_id), DP_LOG_IFNAME(pf1_proxy_name)); - port = dp_port_init_pf1_proxy_interface(port_id, &dev_info); - if (!port) - return DP_ERROR; - - snprintf(port->port_name, sizeof(port->port_name), "%s", pf1_proxy_name); - return DP_OK; -} -#endif - static int dp_port_init_vfs(const char *vf_pattern, int num_of_vfs) { uint16_t port_id; @@ -400,7 +324,7 @@ static int dp_port_init_vfs(const char *vf_pattern, int num_of_vfs) return DP_ERROR; if (strstr(ifname, vf_pattern) && ++vf_count <= num_of_vfs) { DPS_LOG_INFO("INIT initializing VF port", DP_LOG_PORTID(port_id), DP_LOG_IFNAME(ifname)); - port = dp_port_init_interface(port_id, &dev_info, DP_PORT_INIT_VF, DP_PORT_NORMAL); + port = dp_port_init_interface(port_id, &dev_info, DP_PORT_INIT_VF); if (!port) return DP_ERROR; snprintf(port->port_name, sizeof(port->port_name), "%s", vf_pattern); @@ -432,9 +356,6 @@ int dp_ports_init(void) // these need to be done in order if (DP_FAILED(dp_port_init_pf(dp_conf_get_pf0_name())) || DP_FAILED(dp_port_init_pf(dp_conf_get_pf1_name())) -#ifdef ENABLE_PF1_PROXY - || DP_FAILED(dp_port_init_pf1_proxy(dp_conf_get_pf1_proxy())) -#endif || DP_FAILED(dp_port_init_vfs(dp_conf_get_vf_pattern(), num_of_vfs))) return DP_ERROR; @@ -481,11 +402,6 @@ void dp_ports_stop(void) // in multiport-mode, PF0 needs to be stopped last struct dp_port *pf0 = dp_get_port_by_pf_index(0); -#ifdef ENABLE_PF1_PROXY - if (_dp_pf1_proxy_port.allocated) - dp_stop_eth_port(&_dp_pf1_proxy_port); -#endif - // without stopping started ports, DPDK complains DP_FOREACH_PORT(&_dp_ports, port) { if (port->allocated && port != pf0) @@ -554,17 +470,6 @@ static int dp_port_create_default_pf_async_templates(struct dp_port *port) DPS_LOG_ERR("Failed to create pf async isolation templates", DP_LOG_PORT(port)); return DP_ERROR; } -#ifdef ENABLE_PF1_PROXY - // Even though this is PF1 linking to VF on PF1, the rules need to be created in PF0 (multiport-eswitch mode) - if (dp_conf_is_pf1_proxy_enabled() && port == dp_get_pf0()) { - if (DP_FAILED(dp_create_pf_async_from_proxy_templates(port)) - || DP_FAILED(dp_create_pf_async_to_proxy_templates(port)) - ) { - DPS_LOG_ERR("Failed to create pf async proxy templates", DP_LOG_PORT(port)); - return DP_ERROR; - } - } -#endif #ifdef ENABLE_VIRTSVC if (DP_FAILED(dp_create_virtsvc_async_isolation_templates(port, IPPROTO_TCP)) || DP_FAILED(dp_create_virtsvc_async_isolation_templates(port, IPPROTO_UDP)) @@ -607,30 +512,18 @@ static void dp_acquire_neigh_mac(struct dp_port *port) return; } -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() && port == dp_get_pf1_proxy()) - port = dp_get_port_by_pf_index(1); -#endif if (DP_FAILED(dp_send_event_neighmac_msg(port->port_id, &pf_neigh_mac))) DPS_LOG_WARNING("Cannot send neigboring router mac to worker thread"); } void dp_start_acquiring_neigh_mac(struct dp_port *port) { -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() && port == dp_get_pf1()) - port = &_dp_pf1_proxy_port; -#endif port->neighmac_period = DP_PORT_NEIGHMAC_INITIAL_PERIOD; dp_acquire_neigh_mac(port); } void dp_stop_acquiring_neigh_mac(struct dp_port *port) { -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() && port == dp_get_pf1()) - port = &_dp_pf1_proxy_port; -#endif rte_timer_stop_sync(&port->neighmac_timer); } @@ -661,13 +554,9 @@ static int dp_init_port(struct dp_port *port) if (port->is_pf) { if (dp_conf_is_multiport_eswitch()) { - // no isolation on proxied PF -#ifdef ENABLE_PF1_PROXY - if (port == dp_get_pf0() || !dp_conf_is_pf1_proxy_enabled()) -#endif - if (DP_FAILED(dp_port_create_default_pf_async_templates(port)) - || DP_FAILED(dp_port_install_async_isolated_mode(port))) - return DP_ERROR; + if (DP_FAILED(dp_port_create_default_pf_async_templates(port)) + || DP_FAILED(dp_port_install_async_isolated_mode(port))) + return DP_ERROR; } else if (DP_FAILED(dp_port_install_sync_isolated_mode(port->port_id))) return DP_ERROR; @@ -734,34 +623,11 @@ int dp_start_pf_port(uint16_t index) DPS_LOG_INFO("Received initial PF link state", DP_LOG_LINKSTATE(port->link_status), DP_LOG_PORT(port)); if (port->link_status == RTE_ETH_LINK_UP) -#ifdef ENABLE_PF1_PROXY - // Do not use PF1 in pf1-proxy mode as Linux does not use it then (thus the mac will never be there) - if (!dp_conf_is_pf1_proxy_enabled() || port != dp_get_pf1()) -#endif - dp_start_acquiring_neigh_mac(port); + dp_start_acquiring_neigh_mac(port); return DP_OK; } -#ifdef ENABLE_PF1_PROXY -int dp_start_pf1_proxy_port(void) -{ - int ret; - - ret = rte_eth_dev_start(_dp_pf1_proxy_port.port_id); - if (DP_FAILED(ret)) { - DPS_LOG_ERR("Cannot start ethernet port", DP_LOG_PORT(&_dp_pf1_proxy_port), DP_LOG_RET(ret)); - return ret; - } - - if (dp_get_pf1()->link_status == RTE_ETH_LINK_UP) - dp_start_acquiring_neigh_mac(&_dp_pf1_proxy_port); - - _dp_pf1_proxy_port.allocated = true; - return DP_OK; -} -#endif - int dp_stop_port(struct dp_port *port) { if (DP_FAILED(dp_destroy_default_flow(port))) diff --git a/src/dp_service.c b/src/dp_service.c index 5b58aa33a..c0309221e 100644 --- a/src/dp_service.c +++ b/src/dp_service.c @@ -166,12 +166,6 @@ static int init_interfaces(void) if (DP_FAILED(dp_start_pf_port(1))) return DP_ERROR; -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() - && DP_FAILED(dp_start_pf1_proxy_port())) - return DP_ERROR; -#endif - // VFs are started by GRPC later if (DP_FAILED(dp_flow_init(pf0_socket_id)) @@ -241,21 +235,6 @@ static int run_service(void) DP_EARLY_ERR("HW offloading is currently not supported for multi-port eswitch mode"); return DP_ERROR; } -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled()) { - if (*dp_conf_get_pf1_proxy_vf() == '\0') { - DP_EARLY_ERR("PF1-proxy also requires --pf1-proxy-vf argument to be set"); - return DP_ERROR; - } - } -#endif - } else { -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled()) { - DP_EARLY_ERR("PF1-proxy is only supported for multiport-eswitch mode"); - return DP_ERROR; - } -#endif } if (DP_FAILED(dp_log_init())) diff --git a/src/dpdk_layer.c b/src/dpdk_layer.c index be4b87283..366063172 100644 --- a/src/dpdk_layer.c +++ b/src/dpdk_layer.c @@ -43,19 +43,6 @@ static int dp_dpdk_layer_init_unsafe(void) return DP_ERROR; } -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled()) { - dp_layer.rte_jumbo_mempool = rte_pktmbuf_pool_create("jumbo_mbuf_pool", DP_JUMBO_MBUF_POOL_SIZE, - DP_MEMPOOL_CACHE_SIZE, DP_MBUF_PRIV_DATA_SIZE, - DP_JUMBO_MBUF_BUF_SIZE, - rte_socket_id()); - if (!dp_layer.rte_jumbo_mempool) { - DPS_LOG_ERR("Cannot create jumbo mbuf pool", DP_LOG_RET(rte_errno)); - return DP_ERROR; - } - } -#endif - dp_layer.num_of_vfs = dp_get_num_of_vfs(); if (DP_FAILED(dp_layer.num_of_vfs)) return DP_ERROR; @@ -94,9 +81,6 @@ void dp_dpdk_layer_free(void) ring_free(dp_layer.periodic_msg_queue); ring_free(dp_layer.grpc_rx_queue); ring_free(dp_layer.grpc_tx_queue); -#ifdef ENABLE_PF1_PROXY - rte_mempool_free(dp_layer.rte_jumbo_mempool); -#endif rte_mempool_free(dp_layer.rte_mempool); } diff --git a/src/meson.build b/src/meson.build index 80d523ae4..8efd0e4a3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -73,11 +73,6 @@ if get_option('enable_virtual_services') 'dp_virtsvc.c', ] endif -if get_option('enable_pf1_proxy') - dp_sources += [ - 'rte_flow/dp_rte_async_flow_pf1_proxy.c', - ] -endif exe = executable('dpservice-bin', sources: [ dp_sources, grpc_generated, version_h ], diff --git a/src/monitoring/dp_graphtrace.c b/src/monitoring/dp_graphtrace.c index 1ec95920b..79b7b74ad 100644 --- a/src/monitoring/dp_graphtrace.c +++ b/src/monitoring/dp_graphtrace.c @@ -40,11 +40,7 @@ static int dp_graphtrace_init_memory(void) graphtrace.mempool = rte_pktmbuf_pool_create(DP_GRAPHTRACE_MEMPOOL_NAME, DP_GRAPHTRACE_RINGBUF_SIZE-1, DP_MEMPOOL_CACHE_SIZE, DP_MBUF_PRIV_DATA_SIZE + sizeof(struct dp_graphtrace_pktinfo), -#ifdef ENABLE_PF1_PROXY - DP_JUMBO_MBUF_BUF_SIZE, -#else DP_MBUF_BUF_SIZE, -#endif rte_socket_id()); if (!graphtrace.mempool) { DPS_LOG_ERR("Cannot allocate graphtrace pool", DP_LOG_RET(rte_errno)); diff --git a/src/nodes/cls_node.c b/src/nodes/cls_node.c index aa9588475..4e1179fed 100644 --- a/src/nodes/cls_node.c +++ b/src/nodes/cls_node.c @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors // SPDX-License-Identifier: Apache-2.0 -#include "nodes/cls_node.h" #include #include #include @@ -33,19 +32,8 @@ DP_NODE_REGISTER(CLS, cls, NEXT_NODES); -#ifdef ENABLE_PF1_PROXY -static bool pf1_proxy_enabled = false; -static uint16_t pf1_port_id; -static uint16_t pf1_proxy_port_id; -#endif - static int cls_node_init(__rte_unused const struct rte_graph *graph, __rte_unused struct rte_node *node) { -#ifdef ENABLE_PF1_PROXY - pf1_proxy_enabled = dp_conf_is_pf1_proxy_enabled(); - pf1_port_id = dp_get_pf1()->port_id; - pf1_proxy_port_id = dp_get_pf1_proxy()->port_id; -#endif #ifdef ENABLE_VIRTSVC virtsvc_present = dp_virtsvc_get_count() > 0; virtsvc_ipv4_tree = dp_virtsvc_get_ipv4_tree(); @@ -54,15 +42,6 @@ static int cls_node_init(__rte_unused const struct rte_graph *graph, __rte_unuse return DP_OK; } -#ifdef ENABLE_PF1_PROXY -static uint16_t next_tx_index[DP_MAX_PORTS]; - -int cls_node_append_tx(uint16_t port_id, const char *tx_node_name) -{ - return dp_node_append_tx(DP_NODE_GET_SELF(cls), next_tx_index, port_id, tx_node_name); -} -#endif - static __rte_always_inline int is_arp(const struct rte_ether_hdr *ether_hdr) { const struct rte_arp_hdr *arp_hdr = (const struct rte_arp_hdr *)(ether_hdr + 1); @@ -150,8 +129,6 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod struct dp_virtsvc *virtsvc; #endif - // this is where pf1-proxy -> pf1 should happen, but that is done via rte_flow rule - if (unlikely((m->packet_type & RTE_PTYPE_L2_MASK) != RTE_PTYPE_L2_ETHER)) return CLS_NEXT_DROP; @@ -228,19 +205,6 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod return CLS_NEXT_DROP; } -#ifdef ENABLE_PF1_PROXY -static __rte_always_inline rte_edge_t get_next_index_proxy(struct rte_node *node, struct rte_mbuf *m) -{ - rte_edge_t next = get_next_index(node, m); - - if (next == CLS_NEXT_DROP && pf1_proxy_enabled && m->port == pf1_port_id) - return next_tx_index[pf1_proxy_port_id]; - - return next; -} -#define get_next_index get_next_index_proxy -#endif - static uint16_t cls_node_process(struct rte_graph *graph, struct rte_node *node, void **objs, diff --git a/src/rte_flow/dp_rte_async_flow_isolation.c b/src/rte_flow/dp_rte_async_flow_isolation.c index ad118c5f5..82b54d0ad 100644 --- a/src/rte_flow/dp_rte_async_flow_isolation.c +++ b/src/rte_flow/dp_rte_async_flow_isolation.c @@ -8,9 +8,6 @@ #include "dp_virtsvc.h" #endif #include "rte_flow/dp_rte_async_flow.h" -#ifdef ENABLE_PF1_PROXY -#include "rte_flow/dp_rte_async_flow_pf1_proxy.h" -#endif #include "rte_flow/dp_rte_async_flow_template.h" #include "rte_flow/dp_rte_flow_helpers.h" @@ -231,14 +228,6 @@ int dp_create_pf_async_isolation_rules(struct dp_port *port) rule_count++; } -#ifdef ENABLE_PF1_PROXY - if (dp_conf_is_pf1_proxy_enabled() && port == dp_get_pf0()) { - rules_required += DP_PF1_PROXY_RULE_COUNT; - rule_count += dp_create_pf1_proxy_async_isolation_rules(port); - // cannot return, need to push all previous rules and then return error - } -#endif - #ifdef ENABLE_VIRTSVC rules_required += dp_virtsvc_get_count(); rule_count += dp_create_virtsvc_async_isolation_rules(port->port_id, diff --git a/src/rte_flow/dp_rte_async_flow_pf1_proxy.c b/src/rte_flow/dp_rte_async_flow_pf1_proxy.c deleted file mode 100644 index 0d70a7650..000000000 --- a/src/rte_flow/dp_rte_async_flow_pf1_proxy.c +++ /dev/null @@ -1,207 +0,0 @@ -// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors -// SPDX-License-Identifier: Apache-2.0 - -#include "rte_flow/dp_rte_async_flow_pf1_proxy.h" -#include "rte_flow/dp_rte_async_flow.h" -#include "rte_flow/dp_rte_async_flow_template.h" -#include "rte_flow/dp_rte_flow_helpers.h" - -// having MAX equal to actual number of rules impacts throughput (for unknown reason) -#define DP_PF1_DEFAULT_TABLE_MAX_RULES (DP_PF1_PROXY_RULE_COUNT+1) - -enum dp_pf1_proxy_pattern_type { - DP_PF1_PROXY_PATTERN_REPR_PORT, - DP_PF1_PROXY_PATTERN_COUNT, -}; - -enum dp_pf1_proxy_actions_type { - DP_PF1_PROXY_ACTIONS_REPR_PORT, - DP_PF1_PROXY_ACTIONS_COUNT, -}; - -static const struct rte_flow_pattern_template_attr transfer_pattern_template_attr = { - .transfer = 1 -}; - -static const struct rte_flow_actions_template_attr transfer_actions_template_attr = { - .transfer = 1 -}; - -static const struct rte_flow_template_table_attr pf_transfer_template_table_attr = { - .flow_attr = { - .group = 0, - .transfer = 1, - }, - .nb_flows = DP_PF1_DEFAULT_TABLE_MAX_RULES, -}; - - -int dp_create_pf_async_from_proxy_templates(struct dp_port *port) -{ - struct dp_port_async_template *tmpl; - - tmpl = dp_alloc_async_template(DP_PF1_PROXY_PATTERN_COUNT, DP_PF1_PROXY_ACTIONS_COUNT); - if (!tmpl) - return DP_ERROR; - - port->default_async_rules.default_templates[DP_PORT_ASYNC_TEMPLATE_PF1_FROM_PROXY] = tmpl; - - static const struct rte_flow_item pattern[] = { - { .type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, - .mask = &dp_flow_item_ethdev_mask, - }, - { .type = RTE_FLOW_ITEM_TYPE_END }, - }; - tmpl->pattern_templates[DP_PF1_PROXY_PATTERN_REPR_PORT] - = dp_create_async_pattern_template(port->port_id, &transfer_pattern_template_attr, pattern); - - static const struct rte_flow_action actions[] = { - { .type = RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, }, - { .type = RTE_FLOW_ACTION_TYPE_END, }, - }; - tmpl->actions_templates[DP_PF1_PROXY_ACTIONS_REPR_PORT] - = dp_create_async_actions_template(port->port_id, &transfer_actions_template_attr, actions, actions); - - tmpl->table_attr = &pf_transfer_template_table_attr; - - return dp_init_async_template(port->port_id, tmpl); -} - -int dp_create_pf_async_to_proxy_templates(struct dp_port *port) -{ - struct dp_port_async_template *tmpl; - - tmpl = dp_alloc_async_template(DP_PF1_PROXY_PATTERN_COUNT, DP_PF1_PROXY_ACTIONS_COUNT); - if (!tmpl) - return DP_ERROR; - - port->default_async_rules.default_templates[DP_PORT_ASYNC_TEMPLATE_PF1_TO_PROXY] = tmpl; - - static const struct rte_flow_item pattern[] = { - { .type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, - .mask = &dp_flow_item_ethdev_mask, - }, - { .type = RTE_FLOW_ITEM_TYPE_ETH, - .mask = &dp_flow_item_eth_mask, - }, - { .type = RTE_FLOW_ITEM_TYPE_IPV6, - .mask = &dp_flow_item_ipv6_dst_only_mask, - }, - { .type = RTE_FLOW_ITEM_TYPE_END }, - }; - tmpl->pattern_templates[DP_PF1_PROXY_PATTERN_REPR_PORT] - = dp_create_async_pattern_template(port->port_id, &transfer_pattern_template_attr, pattern); - - static const struct rte_flow_action actions[] = { - { .type = RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, }, - { .type = RTE_FLOW_ACTION_TYPE_END, }, - }; - tmpl->actions_templates[DP_PF1_PROXY_ACTIONS_REPR_PORT] - = dp_create_async_actions_template(port->port_id, &transfer_actions_template_attr, actions, actions); - - tmpl->table_attr = &pf_transfer_template_table_attr; - - return dp_init_async_template(port->port_id, tmpl); -} - - -static struct rte_flow *dp_create_pf_async_from_proxy_rule(uint16_t port_id, - uint16_t src_port_id, uint16_t dst_port_id, - struct rte_flow_template_table *template_table) -{ - const struct rte_flow_item_ethdev src_port_pattern = { - .port_id = src_port_id, - }; - const struct rte_flow_item pattern[] = { - { .type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, - .spec = &src_port_pattern, - }, - { .type = RTE_FLOW_ITEM_TYPE_END }, - }; - - const struct rte_flow_item_ethdev dst_port_action = { - .port_id = dst_port_id, - }; - const struct rte_flow_action actions[] = { - { .type = RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, - .conf = &dst_port_action, - }, - { .type = RTE_FLOW_ACTION_TYPE_END }, - }; - - return dp_create_async_rule(port_id, template_table, - pattern, DP_PF1_PROXY_PATTERN_REPR_PORT, - actions, DP_PF1_PROXY_ACTIONS_REPR_PORT); -} - -static struct rte_flow *dp_create_pf_async_to_proxy_rule(uint16_t port_id, - uint16_t src_port_id, uint16_t dst_port_id, - struct rte_flow_template_table *template_table) -{ - const struct rte_flow_item_ethdev src_port_pattern = { - .port_id = src_port_id, - }; - const struct rte_flow_item_eth eth_ipv6_pattern = { - .type = htons(RTE_ETHER_TYPE_IPV6), - }; - const struct rte_flow_item_ipv6 ipv6_dst_pattern = { - .hdr.dst_addr = DP_INIT_FROM_IPV6(dp_conf_get_underlay_ip()), - }; - const struct rte_flow_item pattern[] = { - { .type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, - .spec = &src_port_pattern, - }, - { .type = RTE_FLOW_ITEM_TYPE_ETH, - .spec = ð_ipv6_pattern, - }, - { .type = RTE_FLOW_ITEM_TYPE_IPV6, - .spec = &ipv6_dst_pattern, - }, - { .type = RTE_FLOW_ITEM_TYPE_END }, - }; - - const struct rte_flow_item_ethdev dst_port_action = { - .port_id = dst_port_id, - }; - const struct rte_flow_action actions[] = { - { .type = RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, - .conf = &dst_port_action, - }, - { .type = RTE_FLOW_ACTION_TYPE_END }, - }; - - return dp_create_async_rule(port_id, template_table, - pattern, DP_PF1_PROXY_PATTERN_REPR_PORT, - actions, DP_PF1_PROXY_ACTIONS_REPR_PORT); -} - -uint16_t dp_create_pf1_proxy_async_isolation_rules(struct dp_port *port) -{ - uint16_t pf1_port_id = dp_get_pf1()->port_id; - uint16_t proxy_port_id = dp_get_pf1_proxy()->port_id; - struct dp_port_async_template **templates = port->default_async_rules.default_templates; - struct rte_flow *flow; - uint16_t rule_count = 0; - - flow = dp_create_pf_async_from_proxy_rule(port->port_id, proxy_port_id, pf1_port_id, - templates[DP_PORT_ASYNC_TEMPLATE_PF1_FROM_PROXY]->template_table); - if (!flow) { - DPS_LOG_ERR("Failed to install PF async pf1 from proxy rule", DP_LOG_PORT(port)); - return rule_count; - } - - port->default_async_rules.default_flows[DP_PORT_ASYNC_FLOW_PF1_FROM_PROXY] = flow; - rule_count++; - - flow = dp_create_pf_async_to_proxy_rule(port->port_id, pf1_port_id, proxy_port_id, - templates[DP_PORT_ASYNC_TEMPLATE_PF1_TO_PROXY]->template_table); - if (!flow) { - DPS_LOG_ERR("Failed to install PF async pf1 to proxy rule", DP_LOG_PORT(port)); - return rule_count; - } - - port->default_async_rules.default_flows[DP_PORT_ASYNC_FLOW_PF1_TO_PROXY] = flow; - rule_count++; - - return rule_count; -} diff --git a/test/local/dp_service.py b/test/local/dp_service.py index e376c4645..51d0bf5db 100755 --- a/test/local/dp_service.py +++ b/test/local/dp_service.py @@ -125,8 +125,6 @@ def reconfigure_tests(self, cfgfile): PF0.tap = value elif key == "pf1": PF1.tap = value - elif key == "pf1-proxy": - PF1.tap = "pf1-tap" # TODO works for now, but make better elif key == "vf-pattern": # MACs cannot be changed for VFs, use actual values VM1.mac = get_if_hwaddr(f"{value}0") diff --git a/test/local/tcp_tester.py b/test/local/tcp_tester.py index ff654d3a6..b14a8bdbb 100644 --- a/test/local/tcp_tester.py +++ b/test/local/tcp_tester.py @@ -224,7 +224,7 @@ def __init__(self, client_vm, client_port, pf_spec, server_ip, server_port, clie # Virtual-service communication, no tunnel, replace header with IPv6 def get_server_l3_reply(self, pkt): return (Ether(dst=pkt[Ether].src, src=pkt[Ether].dst, type=0x86DD) / - IPv6(dst=router_ul_ipv6, src=pkt[IPv6].dst, nh=6)) + IPv6(dst=pkt[IPv6].src, src=pkt[IPv6].dst, nh=6)) class TCPTesterPublic(_TCPTester): def __init__(self, client_vm, client_port, nat_ul_ipv6, pf_spec, server_ip, server_port, client_pkt_check=None, server_pkt_check=None): diff --git a/test/local/test_telemetry.py b/test/local/test_telemetry.py index cc615452b..ee97e05a3 100644 --- a/test/local/test_telemetry.py +++ b/test/local/test_telemetry.py @@ -27,7 +27,6 @@ HW_IFACE_STATS = ( 'rx_broadcast_bytes', 'rx_broadcast_packets', 'tx_broadcast_bytes', 'tx_broadcast_packets', 'rx_multicast_bytes', 'rx_multicast_packets', 'tx_multicast_bytes', 'tx_multicast_packets', - 'rx_out_of_buffer', 'rx_phy_bytes', 'rx_phy_crc_errors', 'rx_phy_discard_packets', 'rx_phy_in_range_len_errors', 'rx_phy_packets', 'rx_phy_symbol_errors', 'tx_phy_bytes', 'tx_phy_discard_packets', 'tx_phy_errors', 'tx_phy_packets', 'rx_prio0_buf_discard_packets', 'rx_prio0_cong_discard_packets', @@ -41,7 +40,7 @@ 'rx_unicast_bytes', 'rx_unicast_packets', 'tx_unicast_bytes', 'tx_unicast_packets', 'rx_vport_bytes', 'rx_vport_packets', 'tx_vport_bytes', 'tx_vport_packets', 'rx_wqe_errors', - 'tx_pp_clock_queue_errors', 'tx_pp_jitter', 'tx_pp_missed_interrupt_errors', 'tx_pp_rearm_queue_errors', 'tx_pp_sync_lost', 'tx_pp_timestamp_future_errors', 'tx_pp_timestamp_order_errors', 'tx_pp_timestamp_past_errors', 'tx_pp_wander', + 'tx_pp_clock_queue_errors', 'tx_pp_missed_interrupt_errors', 'tx_pp_rearm_queue_errors', 'tx_pp_timestamp_future_errors', 'tx_pp_timestamp_order_errors', 'tx_pp_timestamp_past_errors', ) HW_PF1_IFACE_STATS = ( 'rx_q1_bytes', 'rx_q1_errors', 'rx_q1_packets', 'tx_q1_bytes', 'tx_q1_packets', @@ -152,8 +151,6 @@ def test_telemetry_exporter(request, prepare_ifaces, start_exporter): graph_nodes += ('virtsvc',) if request.config.getoption("--hw"): iface_stats += HW_IFACE_STATS - if PF1.tap == "pf1-tap": - graph_nodes += ('tx-6',) if 'rx_q1_bytes' in ethdev_stats: iface_stats += HW_PF1_IFACE_STATS assert graph_stats == set(graph_nodes), \ diff --git a/test/local/test_virtsvc.py b/test/local/test_virtsvc.py index 379b9a5e8..884693854 100644 --- a/test/local/test_virtsvc.py +++ b/test/local/test_virtsvc.py @@ -23,7 +23,7 @@ def reply_udp(pf_name): udp_used_port = pkt[UDP].sport reply_pkt = (Ether(dst=pkt[Ether].src, src=pkt[Ether].dst, type=0x86DD) / - IPv6(dst=router_ul_ipv6, src=pkt[IPv6].dst, nh=17) / + IPv6(dst=pkt[IPv6].src, src=pkt[IPv6].dst, nh=17) / UDP(dport=pkt[UDP].sport, sport=pkt[UDP].dport)) delayed_sendp(reply_pkt, pf_name) @@ -47,16 +47,11 @@ def test_virtsvc_udp(request, prepare_ipv4, port_redundancy): if not request.config.getoption("--virtsvc"): pytest.skip("Virtual services not enabled") # port numbers chosen so that they cause the right redirection - # (port numbers are part of the hash here, so pf1-proxy changes everything) pf0_ports = [ 12345, 12346, 12347, 12349, 12350 ] - if request.config.getoption("--hw") and PF1.tap != "pf1-tap": - pf0_ports = [ 12352, 12355, 12360, 12361, 12362 ] for port in pf0_ports: request_udp(port, PF0.tap) if port_redundancy: pf1_ports = [ 12348, 12351, 12354, 12355, 12357 ] - if request.config.getoption("--hw") and PF1.tap != "pf1-tap": - pf1_ports = [ 12345, 12346, 12347, 12348, 12349 ] for port in pf1_ports: request_udp(port, PF1.tap) @@ -71,7 +66,7 @@ def test_virtsvc_tcp(request, prepare_ipv4, port_redundancy): if not request.config.getoption("--virtsvc"): pytest.skip("Virtual services not enabled") - port = 12352 if request.config.getoption("--hw") and PF1.tap != "pf1-tap" else 12345 + port = 12345 tester = TCPTesterVirtsvc(VM1, port, PF0, virtsvc_tcp_virtual_ip, virtsvc_tcp_virtual_port, server_pkt_check=tcp_server_virtsvc_pkt_check) tester.communicate()