From patchwork Thu Jul 25 16:23:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Marx X-Patchwork-Id: 142715 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F31E0456AC; Thu, 25 Jul 2024 18:24:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AA8243304; Thu, 25 Jul 2024 18:23:59 +0200 (CEST) Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by mails.dpdk.org (Postfix) with ESMTP id E5089427BA for ; Thu, 25 Jul 2024 18:23:34 +0200 (CEST) Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6b7a3e468a9so8128756d6.1 for ; Thu, 25 Jul 2024 09:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1721924614; x=1722529414; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2e0KOPU1BGAs66szevXsiZwNKyo57spTUZ2Ei2PVlsQ=; b=IIae8sOYfwOVdWHhK30t+HVKQ288VA/aBesxR8DEUectfYsnyRQn2oup2ezerOgBUM aLFuaqHHhc0xqdNyFX5eFdnRUA5gUJHz9SoNbeZidJEVLTq8yjg713IQBzxlYXr0ehzr lFSMyUY2++Mtyl09+fls4XsDCbnajKAvTvWqY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721924614; x=1722529414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2e0KOPU1BGAs66szevXsiZwNKyo57spTUZ2Ei2PVlsQ=; b=ZYoD5nK4I++b4V/Iy5BW5kaZzBcbCkEsUNswBmxaV6E8rY3YmxPY3XbCNxK3pYcZ5r rgZ2QKjMCBqj7vCnMLmfau19IatZHJd4zLvMnIiiYLGubzDX8DPJuM+JpET6CehFGWRv T11oHhyB8cGCJF7Fsh7RSrcGVhax9we8e/d/p1Q+nU7knWzJOVgfQJ3P8+gt6UZIinoK g6Dg2Nrhuv4ZYaUMJm5t7HtBxdt7b4D486Vr6W+0janJiJCSyUSfEiGhCZJ5MQZZdF7b j2TfluuEaeKUlyPpFgon6fRarADbuAwWtNKHrhtA0lZI51Y5e3ElRga6En8AJqHMqbk1 wr+w== X-Gm-Message-State: AOJu0YxQcEJ7l/ImLcacZB9VPgkRagv8cQVjty3cLTwxujLFKIsxweGT OlpKAtY6OBiXNgkYj4o7U7i7jFKQf3gRa32oxT/XEZTOP8v5Vv9YX2DVDoH3WIA= X-Google-Smtp-Source: AGHT+IEz5/zvg+KXqA6J1n4rapczIZfu/ex7NLsUckhMwbprZaDoS0iwrTBllbOO90eRT7uhl3Tt8g== X-Received: by 2002:a05:6214:f04:b0:6b7:9dc9:af28 with SMTP id 6a1803df08f44-6bb3cb16fb7mr40173316d6.57.1721924614231; Thu, 25 Jul 2024 09:23:34 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb3f8d8269sm8683196d6.20.2024.07.25.09.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 09:23:33 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, jspewock@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Dean Marx Subject: [RFC v1 1/3] dts: add UDP tunnel command to testpmd shell Date: Thu, 25 Jul 2024 12:23:23 -0400 Message-ID: <20240725162325.20933-2-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240725162325.20933-1-dmarx@iol.unh.edu> References: <20240725162325.20933-1-dmarx@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org add udp_tunnel_port command to testpmd shell class, also ports over set verbose method from vlan suite Signed-off-by: Dean Marx --- dts/framework/remote_session/testpmd_shell.py | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index eda6eb320f..26114091d6 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -804,7 +804,56 @@ def show_port_stats(self, port_id: int) -> TestPmdPortStats: return TestPmdPortStats.parse(output) - def _close(self) -> None: + def set_verbose(self, level: int, verify: bool = True): + """Set debug verbosity level. + + Args: + level: 0 - silent except for error + 1 - fully verbose except for Tx packets + 2 - fully verbose except for Rx packets + >2 - fully verbose + verify: If :data:`True` the command output will be scanned to verify that verbose level + is properly set. Defaults to :data:`True`. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and verbose level + is not correctly set. + """ + verbose_output = self.send_command(f"set verbose {level}") + if verify: + if "Change verbose level" not in verbose_output: + self._logger.debug(f"Failed to set verbose level to {level}: \n{verbose_output}") + raise InteractiveCommandExecutionError( + f"Testpmd failed to set verbose level to {level}." + ) + + def udp_tunnel_port( + self, port_id: int, add: bool, udp_port: int, protocol: str, verify: bool = True + ): + """Configures a UDP tunnel on the specified port, for the specified protocol. + + Args: + port_id: ID of the port to configure tunnel on. + add: If :data:`True`, adds tunnel, otherwise removes tunnel. + udp_port: ID of the UDP port to configure tunnel on. + protocol: Name of tunnelling protocol to use; options are vxlan, geneve, ecpri + verify: If :data:`True`, checks the output of the command to verify that + no errors were thrown. + + Raises: + InteractiveCommandExecutionError: If verify is :data:`True` and command + output shows an error. + """ + action = "add" if add else "rm" + cmd_output = self.send_command( + f"port config {port_id} udp_tunnel_port {action} {protocol} {udp_port}" + ) + if verify: + if "Operation not supported" in cmd_output or "Bad arguments" in cmd_output: + self._logger.debug(f"Failed to set UDP tunnel: \n{cmd_output}") + raise InteractiveCommandExecutionError(f"Failed to set UDP tunnel: \n{cmd_output}") + + def close(self) -> None: """Overrides :meth:`~.interactive_shell.close`.""" self.stop() self.send_command("quit", "Bye...") From patchwork Thu Jul 25 16:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Marx X-Patchwork-Id: 142716 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C0BF456AC; Thu, 25 Jul 2024 18:24:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96009433FB; Thu, 25 Jul 2024 18:24:00 +0200 (CEST) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mails.dpdk.org (Postfix) with ESMTP id 6853A427BA for ; Thu, 25 Jul 2024 18:23:36 +0200 (CEST) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6b797a2384cso5801376d6.0 for ; Thu, 25 Jul 2024 09:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1721924616; x=1722529416; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i4Goyi9htgy9zfke8lBz4ZJikg6XBUOvarvUMGNrXfQ=; b=apE2X/CSZia4VqO3btuHAmp3CM9SoAhfUqJndCfDOgcyR/bzORaPYXGyM+X5zSBoe0 8iCjxiE5cfntk+2O+yzRkCBDHSF7wCRz+t1eh3rH3cOiwfZF22Tvc9KNXK/8Jq5JqAQg bxqEUdV2bU78Yc3I2zwm9eBXkgys5mWZmVDsg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721924616; x=1722529416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4Goyi9htgy9zfke8lBz4ZJikg6XBUOvarvUMGNrXfQ=; b=gKw1K+LXsWeFwy+wgcgogINbO2i4MnDnI9iAGEWDNvIKWitip0dh3+wl3j0shNn+ak 4P2UFL2CTEZXVx4LyevROORvYjyxiwIddreYuDMz/h0ASuI0u+Z3QhK9Rap92Tybz5bs 4/kYS0/KnlEn9izOXgDgKFfXj9UR7FLTW67+gMrQ3Km1uEoZseqltF8vNjrDNuQ2jbXn PEte/lQvNDHO999Bo/b3HLv03g1GD1A4duerpaHRpgq4rgbLKwqoyEYhlPMZTw1rJ07s fY40DBe89ZF6gMJgJlXXZyMp9lZWCMJHWQaTmJqaCTxffiSqItIVsTj7SaOrUZgfgJn5 aBoQ== X-Gm-Message-State: AOJu0YxqysFR4RvjjSJVB18Qwg1/vksENmvfye2Mz5KAv4zP5fuyfS+A F7i5pGDb2ZSpP2otYCEXyOpzhF0txnpdws2GOA49IQB0Wkij9Phce0Voxd3iXsA= X-Google-Smtp-Source: AGHT+IEV2J1BEzaRJ1YI0I2NaI1VEY6z0fnbQd/rMOKDSQiNzwnqIGg+9n5VFrSkQq7qrqbTrf21Vw== X-Received: by 2002:a05:6214:1d25:b0:6b7:9afa:238f with SMTP id 6a1803df08f44-6bb3ca0d0e9mr40795936d6.21.1721924615621; Thu, 25 Jul 2024 09:23:35 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb3f8d8269sm8683196d6.20.2024.07.25.09.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 09:23:35 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, jspewock@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Dean Marx Subject: [RFC v1 2/3] dts: VXLAN gpe support test suite Date: Thu, 25 Jul 2024 12:23:24 -0400 Message-ID: <20240725162325.20933-3-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240725162325.20933-1-dmarx@iol.unh.edu> References: <20240725162325.20933-1-dmarx@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Test suite for verifying vxlan gpe support on NIC, as well as expected behavior while sending vxlan packets through tunnel Signed-off-by: Dean Marx --- dts/tests/TestSuite_vxlan_gpe_support.py | 77 ++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 dts/tests/TestSuite_vxlan_gpe_support.py diff --git a/dts/tests/TestSuite_vxlan_gpe_support.py b/dts/tests/TestSuite_vxlan_gpe_support.py new file mode 100644 index 0000000000..981f878a4c --- /dev/null +++ b/dts/tests/TestSuite_vxlan_gpe_support.py @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2024 University of New Hampshire + +"""VXLAN-GPE support test suite. + +This suite verifies virtual extensible local area network packets +are only received in the same state when a UDP tunnel port for VXLAN tunneling +protocols is enabled. GPE is the Generic Protocol Extension for VXLAN, +which is used for configuring fields in the VXLAN header through GPE tunnels. + +If a GPE tunnel is configured for the corresponding UDP port within a sent packet, +that packet should be received with its VXLAN layer. If there is no GPE tunnel, +the packet should be received without its VXLAN layer. + +""" + +from scapy.layers.inet import IP, UDP # type: ignore[import-untyped] +from scapy.layers.l2 import Ether # type: ignore[import-untyped] +from scapy.layers.vxlan import VXLAN # type: ignore[import-untyped] +from scapy.packet import Raw # type: ignore[import-untyped] + +from framework.params.testpmd import SimpleForwardingModes +from framework.remote_session.testpmd_shell import TestPmdShell +from framework.test_suite import TestSuite + + +class TestVxlanGpeSupport(TestSuite): + """DPDK VXLAN-GPE test suite. + + This suite consists of one test case (Port 4790 is designated for VXLAN-GPE streams): + 1. VXLAN-GPE ipv4 packet detect - configures a GPE tunnel on port 4790 + and sends packets with a matching UDP destination port. This packet + should be received by the traffic generator with its VXLAN layer. + Then, remove the GPE tunnel, send the same packet, and verify that + the packet is received without its VXLAN layer. + """ + + def set_up_suite(self) -> None: + """Set up the test suite. + + Setup: + Verify that we have at least 2 port links in the current test run. + """ + self.verify( + len(self._port_links) > 1, + "There must be at least two port links to run the scatter test suite", + ) + + def send_vxlan_packet_and_verify(self, udp_dport: int, should_receive_vxlan: bool) -> None: + """Generate a VXLAN GPE packet with the given UDP destination port, send and verify. + + Args: + udp_dport: The destination UDP port to generate in the packet. + should_receive_vxlan: Indicates whether the packet should be + received by the traffic generator with its VXLAN layer. + """ + packet = Ether() / IP() / UDP(dport=udp_dport) / VXLAN(flags=12) / IP() / Raw(load="xxxxx") + received = self.send_packet_and_capture(packet) + print(f"Received packets = {received}") + has_vxlan = any( + "VXLAN" in packet.summary() and "xxxxx" in str(packet.load) for packet in received + ) + self.verify( + not (has_vxlan ^ should_receive_vxlan), "Expected packet did not match received packet." + ) + + def test_gpe_tunneling(self) -> None: + """Verifies expected behavior of VXLAN packets through a GPE tunnel.""" + GPE_port = 4790 + with TestPmdShell(node=self.sut_node) as testpmd: + testpmd.set_forward_mode(SimpleForwardingModes.io) + testpmd.set_verbose(level=1) + testpmd.start() + testpmd.udp_tunnel_port(port_id=0, add=True, udp_port=GPE_port, protocol="vxlan") + self.send_vxlan_packet_and_verify(udp_dport=GPE_port, should_receive_vxlan=True) + testpmd.udp_tunnel_port(port_id=0, add=False, udp_port=GPE_port, protocol="vxlan") + self.send_vxlan_packet_and_verify(udp_dport=GPE_port, should_receive_vxlan=False) From patchwork Thu Jul 25 16:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Marx X-Patchwork-Id: 142717 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C025456AC; Thu, 25 Jul 2024 18:24:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C29A435B3; Thu, 25 Jul 2024 18:24:20 +0200 (CEST) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by mails.dpdk.org (Postfix) with ESMTP id 5018A427BA for ; Thu, 25 Jul 2024 18:23:38 +0200 (CEST) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-44931f038f9so19558971cf.0 for ; Thu, 25 Jul 2024 09:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1721924617; x=1722529417; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/JuHm0tunNPm3OMIl7HjBSxK7o/XsLJfjLjRs87uj58=; b=PYYb1MhjKY1IQbXLbF5RsluCYy3pklwM6BmuX/bWhbAjeYiZRXGmyXv8OTUVRV5e2d P+Po6IdXLUa5fl2l/mCLpNiRbnEE5iYALQlViIIlPl/IHLbyAlM/MUC+Fzqo9X7/vLkC H30ZyjUEMiqzFFW1rC7Sv+kFd9MiOdWrfc29k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721924617; x=1722529417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/JuHm0tunNPm3OMIl7HjBSxK7o/XsLJfjLjRs87uj58=; b=shZsdyyQKOsEwpBijV08WWUDx6AGBEYnr5i4l1GJ2TlzZuHEjd458YM9UAv0C5g2U/ 44zMSawhFMaWwAoRBbQia0m0CFCCYeYDQaetUHkNAYdpESjZ5joaaIifKllPwE1qAGwY YW5OzseDcQ45uBvTvMW/oKZ3Xfq8l9nwN+DOuQ2EX/iRlDrjK0GBa2gO8yLgJfQ+vCpj 1J1wHP40oKMgcMf/Zz11L8e0x8bEh2t6U2gDgKuPw5Zul5r4W1S8LAbPlKmt5GzKv+tN vn375rwAl0S2mCUy77U4SEdpMOVFvDOc80Ud/mxynCaMZ6W6ee/Sn2oPge/hVh0HTKvB 6Oxg== X-Gm-Message-State: AOJu0YxXjKq8NQyoJW5fnA2mUNz1VkVlE7CV9tTCG7WAcGA6rYSUYM2r uLs979SRPy5pxnjcr/CYZqL0PhJsdC7dW7YThICKWiAouqniTHIJPYHikZJzmt0= X-Google-Smtp-Source: AGHT+IEIKRj5U211cVndMuwOrwfXNCCPm6GMis2xLBL90daOXrvunKeb2qIJkL8d8S/ZSj5DtEvVBw== X-Received: by 2002:a05:6214:1308:b0:6b5:2a29:cd08 with SMTP id 6a1803df08f44-6b99155ff43mr127438016d6.27.1721924617475; Thu, 25 Jul 2024 09:23:37 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb3f8d8269sm8683196d6.20.2024.07.25.09.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 09:23:37 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, jspewock@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Dean Marx Subject: [RFC v1 3/3] dts: conf schema VXLAN gpe support Date: Thu, 25 Jul 2024 12:23:25 -0400 Message-ID: <20240725162325.20933-4-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240725162325.20933-1-dmarx@iol.unh.edu> References: <20240725162325.20933-1-dmarx@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Configuration schema to run vxlan gpe support test suite Signed-off-by: Dean Marx --- dts/framework/config/conf_yaml_schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index f02a310bb5..06c8978103 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -187,7 +187,8 @@ "enum": [ "hello_world", "os_udp", - "pmd_buffer_scatter" + "pmd_buffer_scatter", + "vxlan_gpe_support" ] }, "test_target": {