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 84E2143EEA; Tue, 23 Apr 2024 14:00:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 704A740E54; Tue, 23 Apr 2024 14:00:32 +0200 (CEST) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mails.dpdk.org (Postfix) with ESMTP id 42095402AB for ; Tue, 23 Apr 2024 14:00:30 +0200 (CEST) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-57215beb016so1329773a12.2 for ; Tue, 23 Apr 2024 05:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1713873630; x=1714478430; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hhbB0ZQSENmh5Aa2VYJBZ2/fZMaC9UI9L6pFwXPBhLc=; b=bEyMNnaGgncLJRKWxCtgKO9dd7v8pv8QN8YgYfA/PXDgq5xVQTuPIjP3ET+rjJq8fc C8ho8sIlU6PacxZDWwLxKXh01p1QAln1mtn+9TaSa9x40No99eR4WWfmXCt1uqaiYQ/F K6SiwjACbHAff9ajHPOgcDAEbmyCosf/+JI6NUe05sOBlQOtNf+eBIRsGUjvSgj6Ksk4 25ONm1Wk/YvBvTq1lmaSF0oivPKideGxRS6XC88dm9RUIBx72NyjPJ6vwLQBEclEzYIB niN40iJMQlAgiFjzj+H5g04QoRSObNhwnVGBaQyoVVWpVFAXZpYoZ9MupzRIVPqv68mP EKlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713873630; x=1714478430; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hhbB0ZQSENmh5Aa2VYJBZ2/fZMaC9UI9L6pFwXPBhLc=; b=R6boYjXgwvrFCeM1xyoE74UY5bLKY2bZUe6N+QTpst/eZ1ljLvMhTwI0kYWQ5u3sfn mNDdg5FK10hy0xqCQxDYBIkKGAf6y+tpvq5Rz8S8hcE+yg1So8bairxMGID4YnXeZ0Jf H2qojzm8t9x9u3qVxp917PFBNwCclVHD2biv8VtMK/QhTzCKYNUs6ywzKQeW3HL24X0O lI1tTqrm3HwXhC5d8IetEug/XxDklwc/9bFjnnzQr3SCf6CBYt1e3mwCF2D/l4duo+Sj H1oT1ukEBtkdwBWTQfAGxU/EHrj0cVHtL8F4QZ+GyL4QeKDICn8jIbH7JkdABMynebnn xDBA== X-Forwarded-Encrypted: i=1; AJvYcCU6cBkBPJOqpwpom63NCJQFKbHuaJKyHaaMN7h3s0gqz9iulcZo4P/ll17Zmp8LIYzL1TX2WMp+CulfW1s= X-Gm-Message-State: AOJu0YzxbVG19GGcHS1Lf3hu1fDsgiGaMP1QRCRlXcVbWNdm7z6rR+W7 huhyw3Urq/g7acwezIXlDYp6tC6yOlD8nIc1c6cN8K29okFJr1eGNm5T+og7LQ5RybliG6TyUDd G16xqD/UdhuAapHyaqa0ZljeN3mdTIbS4RGh7da1jS5HFtL3UvcY= X-Google-Smtp-Source: AGHT+IHRXbZsdBGLP/98nYykxsiOUyMFLrApGO90b1IQDP5RAvyjnU70q7wg/nEGvskd3Bs7FWaBq30hwKt3FTCbiSM= X-Received: by 2002:a17:906:5cc:b0:a52:6c23:fa90 with SMTP id t12-20020a17090605cc00b00a526c23fa90mr7849623ejt.1.1713873629898; Tue, 23 Apr 2024 05:00:29 -0700 (PDT) MIME-Version: 1.0 References: <20240419135216.106445-1-juraj.linkes@pantheon.tech> In-Reply-To: From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Tue, 23 Apr 2024 14:00:18 +0200 Message-ID: Subject: Re: [PATCH v1] dts: remove the OS UDP test suite To: Luca Vizzarro Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, npratte@iol.unh.edu, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Apr 23, 2024 at 12:39=E2=80=AFPM Luca Vizzarro wrote: > > On 19/04/2024 14:52, Juraj Linke=C5=A1 wrote: > > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py > > > > - def configure_testbed_ipv4(self, restore: bool =3D 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 in= stead. > > - """ > > - delete =3D True if restore else False > > - enable =3D 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, enab= le) > > - self.sut_node.configure_port_ip_address( > > - self._sut_ip_address_ingress, self._sut_port_ingress, dele= te > > - ) > > - self.sut_node.configure_port_state(self._sut_port_ingress, ena= ble) > > - 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, enabl= e) > > - 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/framewo= rk/testbed_model/linux_session.py > > > > - def configure_port_state(self, port: Port, enable: bool) -> None: > > - """Overrides :meth:`~.os_session.OSSession.configure_port_stat= e`.""" > > - state =3D "up" if enable else "down" > > - self.send_command(f"ip link set dev {port.logical_name} {state= }", privileged=3DTrue) > > - > > - def configure_port_ip_address( > > - self, > > - address: Union[IPv4Interface, IPv6Interface], > > - port: Port, > > - delete: bool, > > - ) -> None: > > - """Overrides :meth:`~.os_session.OSSession.configure_port_ip_a= ddress`.""" > > - command =3D "del" if delete else "add" > > - self.send_command( > > - f"ip address {command} {address} dev {port.logical_name}", > > - privileged=3DTrue, > > - verify=3DTrue, > > - ) > > - > > > > @@ -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_forw= arding`.""" > > - state =3D 1 if enable else 0 > > - self.send_command(f"sysctl -w net.ipv4.ip_forward=3D{state}", = privileged=3DTrue) > > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbe= d_model/node.py > > > > - def configure_port_state(self, port: Port, enable: bool =3D 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 =3D False, > > - ) -> None: > > - """Add an IP address to `port` on this node. > > - > > - Args: > > - address: The IP address with mask in CIDR format. Can be e= ither 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, del= ete) > > - > > > > 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 i= t 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/te= stbed_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... My thinking was that we don't need these for DPDK apps, but maybe we need some of them for Scapy (or any other tg using the OS networking stack). I'll verify this just to make sure we're not removing something that Scapy needs.