From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 156A043EE9; Tue, 23 Apr 2024 12:39:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 939EF40E54; Tue, 23 Apr 2024 12:39:55 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id D84EE402AB for ; Tue, 23 Apr 2024 12:39:54 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D3CA339; Tue, 23 Apr 2024 03:40:22 -0700 (PDT) Received: from [192.168.50.86] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E6AA43F7BD; Tue, 23 Apr 2024 03:39:52 -0700 (PDT) Message-ID: Date: Tue, 23 Apr 2024 11:39:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] dts: remove the OS UDP test suite Content-Language: en-GB To: =?UTF-8?Q?Juraj_Linke=C5=A1?= , thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, npratte@iol.unh.edu Cc: dev@dpdk.org References: <20240419135216.106445-1-juraj.linkes@pantheon.tech> From: Luca Vizzarro In-Reply-To: <20240419135216.106445-1-juraj.linkes@pantheon.tech> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 19/04/2024 14:52, Juraj Linkeš wrote: > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py > > - def configure_testbed_ipv4(self, restore: bool = False) -> None: > - """Configure IPv4 addresses on all testbed ports. > - > - The configured ports are: > - > - * SUT ingress port, > - * SUT egress port, > - * TG ingress port, > - * TG egress port. > - > - Args: > - restore: If :data:`True`, will remove the configuration instead. > - """ > - delete = True if restore else False > - enable = False if restore else True > - self._configure_ipv4_forwarding(enable) > - self.sut_node.configure_port_ip_address( > - self._sut_ip_address_egress, self._sut_port_egress, delete > - ) > - self.sut_node.configure_port_state(self._sut_port_egress, enable) > - self.sut_node.configure_port_ip_address( > - self._sut_ip_address_ingress, self._sut_port_ingress, delete > - ) > - self.sut_node.configure_port_state(self._sut_port_ingress, enable) > - self.tg_node.configure_port_ip_address( > - self._tg_ip_address_ingress, self._tg_port_ingress, delete > - ) > - self.tg_node.configure_port_state(self._tg_port_ingress, enable) > - self.tg_node.configure_port_ip_address( > - self._tg_ip_address_egress, self._tg_port_egress, delete > - ) > - self.tg_node.configure_port_state(self._tg_port_egress, enable) > - > - def _configure_ipv4_forwarding(self, enable: bool) -> None: > - self.sut_node.configure_ipv4_forwarding(enable) > - > > diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py > > - def configure_port_state(self, port: Port, enable: bool) -> None: > - """Overrides :meth:`~.os_session.OSSession.configure_port_state`.""" > - state = "up" if enable else "down" > - self.send_command(f"ip link set dev {port.logical_name} {state}", privileged=True) > - > - def configure_port_ip_address( > - self, > - address: Union[IPv4Interface, IPv6Interface], > - port: Port, > - delete: bool, > - ) -> None: > - """Overrides :meth:`~.os_session.OSSession.configure_port_ip_address`.""" > - command = "del" if delete else "add" > - self.send_command( > - f"ip address {command} {address} dev {port.logical_name}", > - privileged=True, > - verify=True, > - ) > - > > @@ -205,8 +185,3 @@ def configure_port_mtu(self, mtu: int, port: Port) -> None: > > - > - def configure_ipv4_forwarding(self, enable: bool) -> None: > - """Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`.""" > - state = 1 if enable else 0 > - self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True) > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py > > - def configure_port_state(self, port: Port, enable: bool = True) -> None: > - """Enable/disable `port`. > - > - Args: > - port: The port to enable/disable. > - enable: :data:`True` to enable, :data:`False` to disable. > - """ > - self.main_session.configure_port_state(port, enable) > - > - def configure_port_ip_address( > - self, > - address: Union[IPv4Interface, IPv6Interface], > - port: Port, > - delete: bool = False, > - ) -> None: > - """Add an IP address to `port` on this node. > - > - Args: > - address: The IP address with mask in CIDR format. Can be either IPv4 or IPv6. > - port: The port to which to add the address. > - delete: If :data:`True`, will delete the address from the port instead of adding it. > - """ > - self.main_session.configure_port_ip_address(address, port, delete) > - > > diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py > > - @abstractmethod > - def configure_port_state(self, port: Port, enable: bool) -> None: > - """Enable/disable `port` in the operating system. > - > - Args: > - port: The port to configure. > - enable: If :data:`True`, enable the port, otherwise shut it down. > - """ > - > - @abstractmethod > - def configure_port_ip_address( > - self, > - address: Union[IPv4Interface, IPv6Interface], > - port: Port, > - delete: bool, > - ) -> None: > - """Configure an IP address on `port` in the operating system. > - > - Args: > - address: The address to configure. > - port: The port to configure. > - delete: If :data:`True`, remove the IP address, otherwise configure it. > - """ > - > > diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py > > - def configure_ipv4_forwarding(self, enable: bool) -> None: > - """Enable/disable IPv4 forwarding on the node. > - > - Args: > - enable: If :data:`True`, enable the forwarding, otherwise disable it. > - """ > - self.main_session.configure_ipv4_forwarding(enable) > - While I agree to remove unused code, especially code that will never be used again. Is it worthwhile removing already implemented features? Unless we don't foresee using them ever again...